哈德逊成绩落后一步

发布于 2024-09-01 13:03:14 字数 378 浏览 3 评论 0原文

我正在使用 Hudson 的 filesytem 插件,当构建发生时,它会查找新的/修改的文件,将它们复制到工作区,使用 Rake 运行测试,然后发布这些 junit xml 结果文件。

但是,更新后的 junit xml 结果文件在下一次构建之前不会推送到工作区。这意味着当 junit xml 结果文件发布时,它总是落后一步。这意味着我需要在结果显示之前运行构建两次。

Rake 任务正在项目目录中创建 junit xml 文件。我尝试输出到工作区目录,但这似乎使事情变得更糟,并且结果根本没有发布。

我在这里做的是根本错误的事情吗?是否有一种简单的方法可以将这些 junit xml 结果推送到工作区,以便构建后的“发布 JUnit 测试结果报告”实际上针对新创建的 xml 文件运行?

I'm using the filesytem plugin for Hudson, and when a build happens it looks for new/modified files, copies them to the Workspace, runs tests using Rake, and then publishes those junit xml result files.

However, the updated junit xml result files don't get pushed to the workspace until the next build. This means that when the publishing of the junit xml result files happens, it's always one step behind. And this means I need to run a build twice before the results show.

The Rake task is creating the junit xml files in the project directory. I've tried outputting to the workspace directory, but it seems to make things worse and the results don't get published at all.

Am I doing something fundamentally wrong here? Is there a simple way of getting those junit xml results pushed to the workspace so that the post-build "Publish JUnit test result report" actually runs against the newly created xml files?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅笑依然 2024-09-08 13:03:14

我对下面这句话感到困惑:

但是,更新后的 junit xml 结果文件不会推送到
工作空间直到下一个构建。

Rake 会生成 junit.xml 吗?整个描述听起来像:构建发生在哈德逊之外。构建会生成 junit.xml,Hudson 只是获取构建和 junit.xml,并将其复制到工作区中以发布 junit.xml。因此,Hudson 在构建(包括 junit 测试)完成之前检测到更改,并且只获得一半的构建,甚至是旧的构建。解决方法是配置比构建所需的时间更长的周期,或者让构建通知 Hudson 何时运行 rake 作业。配置设置将是“触发远程构建”而不是轮询 SCM。即使 rake 生成 junit.xml,rake 也可能实际上在旧版本的代码上运行,因为 rake 作业在新的构建工件可用之前启动。

我的建议是使用 Hudson 来构建并将这两个作业链接在一起,以便在构建作业完成时触发 rake 作业。必要的构建工件的传输可以通过 Hudson 外部的存储库(可以像网络共享一样简单)。在这种情况下,构建作业将必要的文件复制到存储库中,然后 rake 作业再次提取它。您还可以使用 Hudson 的存档工件功能。另一个更优雅的选项是克隆工作区 SCM 插件,它处理工作空间到另一个作业的转移。

I am confused with the following sentence:

However, the updated junit xml result files don't get pushed to the
workspace until the next build.

Does Rake produce the junit.xml? The whole description sounds like: The build happens outside of Hudson. The build produces the junit.xml and Hudson just picks up the build and the junit.xml and copies it into the workspace for publishing the junit.xml. So hudson detects the changes before the build (including junit tests) is finished and there only gets half of the build or even the old build. The fix would be to configure either quite periode longer than what your build takes or let your build notify Hudson when to run your rake job. The configuration setting would be "Trigger builds remotly" instead of poll SCM. Even if rake produces the junit.xml, it might be that rake actually runs on an old version of code, because the rake job starts before the new build artifacts are available.

My suggestion would be to use Hudson for building and chain both jobs together so that the rake job will be triggered when the build job is finished. The transfer of the necessary build artifacts can be through an repository outside of Hudson (could be as simple as a network share). In this case the build job copies the necessary files into the repository and the rake job pulls it again. You can also play around with the archive artifacts functions from Hudson. Another more elegant option is the Clone Workspace SCM Plugin, which handles the transfer of a workspace to another job.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文