gpt4 book ai didi

java - 将运行 JUnit 测试作为 Jenkins 配置的一部分

转载 作者:行者123 更新时间:2023-11-30 11:05:26 28 4
gpt4 key购买 nike

我正在尝试配置 Jenkins 以包含一个构建后步骤来运行 JUnit 测试,但我收到一个错误:

Jenkins 步骤本身显示了一个问题:

target/surefire-reports/*.xml
‘target/surefire-reports/*.xml’ doesn’t match anything, but ‘*.xml’ does. Perhaps that’s what you mean?

这并不奇怪,因为我在 targets 下没有 surefire-reports 子文件夹,而且我不知道我必须做什么才能生成 xml 报告。我不熟悉 Java、Maven、Eclipse、Linux - 一切 - 并且独自工作。

我的主要问题是:

此配置是否表明我必须考虑使用 ANT 集成?我什至不知道我应该阅读哪些首字母缩略词,我希望能找到一些方向来削减曲线.

我看到了有关设置此构建后步骤的内部说明,但现在我需要知道如何才能使其正常工作。

谢谢

INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ FDE ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.445 s
[INFO] Finished at: 2015-04-15T10:59:18-04:00
[INFO] Final Memory: 16M/38M
[INFO] ------------------------------------------------------------------------
Changing BUILD_ID variable (job build time) with the date pattern MM/dd/yyyy hh:mm a.
Recording test results
Changing BUILD_ID variable (job build time) with the date pattern MM/dd/yyyy hh:mm a.
No test report files were found. Configuration error?
Build step 'Publish JUnit test result report' changed build result to FAILURE
Checking for post-build
Performing post-build step
Checking if email needs to be generated
Email was triggered for: Failure
Sending email for trigger: Failure
Overriding default server settings, creating our own session
Changing BUILD_ID variable (job build time) with the date pattern MM/dd/yyyy hh:mm a.
Changing BUILD_ID variable (job build time) with the date pattern MM/dd/yyyy hh:mm a.
messageContentType = text/html; charset=UTF-8
Changing BUILD_ID variable (job build time) with the date pattern MM/dd/yyyy hh:mm a.
Adding developers
Changing BUILD_ID variable (job build time) with the date pattern MM/dd/yyyy hh:mm a.
Setting In-Reply-To since last build was not successful
Successfully created MimeMessage
Sending email to: John.Doe@MyCom.com
Changing BUILD_ID variable (job build time) with the date pattern MM/dd/yyyy hh:mm a.
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Notifying upstream projects of job completion
Finished: FAILURE

enter image description here

最佳答案

有一个用于生成 JUnit 报告的 Ant 任务。添加<junitreport>任务到您的 Ant 构建并使其依赖于 <junit>任务。

关于java - 将运行 JUnit 测试作为 Jenkins 配置的一部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29654426/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com