surefire结果未显示在gitlab CI/CD的测试选项卡中 [英] surefire results not showing in the test tab of gitlab CI/CD

查看:204
本文介绍了surefire结果未显示在gitlab CI/CD的测试选项卡中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java Maven应用程序,我试图在gitlab上显示我的junit结果,如gitlab帮助中所示:

I have a java-maven application and I am trying to display my junit results on gitlab as shown in the gitlab help here: https://docs.gitlab.com/ee/ci/junit_test_reports.html#viewing-junit-test-reports-on-gitlab

我在pom版本中添加了maven-surefire-plugin,并在pom报告部分中添加了maven-surefire-report-plugin.我检查了它是否有效,因为surefire-report.html是在我的本地目标存储库中正确创建的,并带有测试结果.

I added the maven-surefire-plugin in the pom build and the maven-surefire-report-plugin in the pom reporting section. I checked that it works because the surefire-report.html is correctly created in my local target repository, with the test results.

然后我通过添加最后几行来配置gitlabci.yaml:

Then i configured my gitlabci.yaml by adding the last lines:

image: "maven"
before_script:
  - cd gosecuri
stages:
  - build
  - test
  - run
job_build:
  stage: build
  script:
    - mvn compile
job_test:
  stage: test
  script:
    - mvn package
  artifacts:
    paths:
    - gosecuri/target/*.war
    expire_in: 1 week
    reports:
      junit:
        - target/surefire-reports/TEST-*.xml

管道成功.在gitlab中,我收到消息没有要显示的测试".在作业测试标签和控制台中,我收到以下警告: target/surefire-reports/TEST-*.xml:没有匹配的文件

The pipeline succeeds. In gitlab i have the message "There are no tests to show." in the job tests tab, and in the console I have this warning: target/surefire-reports/TEST-*.xml: no matching files

我想念什么?谢谢

PS:我正在gitlab.com中运行Saas免费计划

PS: i'm running in gitlab.com Saas free plan

推荐答案

在您提到的文档之后,立即有

Right after docs you mentioned there is Enabling the feature paragraph.

此功能随附:junit_pipeline_view功能标志已禁用 默认情况下.

This feature comes with the :junit_pipeline_view feature flag disabled by default.

在公共gitlab.com上禁用了类似功能.如果启动GitLab实例,则可以启用它.

Looks like feature is disabled on public gitlab.com. If you launch your instance of GitLab you can enable it.

更新:报告路径不正确:target/...应该为gosecuri/target/...

Update: Path to reports was incorrect: target/... should be gosecuri/target/...

这篇关于surefire结果未显示在gitlab CI/CD的测试选项卡中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆