windows Jenkins:运行远程测试脚本并报告结果

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5110669/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:16:17  来源:igfitidea点击:

Jenkins: Running remote test scripts and reporting results

windowstestinghudsonautomated-testsjenkins

提问by DanTheMan

I'm trying to take Jenkins from a CI machine, and I would like to have it begin to automatically start testing of the applications it builds.

我正在尝试从 CI 机器中获取 Jenkins,我希望它开始自动开始测试它构建的应用程序。

My setup is this:

我的设置是这样的:

  • 1 central build server
  • 8 dedicated test machines.
  • 1 个中央构建服务器
  • 8台专用测试机。

Currently when build is finished (and label applied), we manually walk around, install the new build, and begin the tests. The tests each take 8-24 hours, so running them in parallel is pretty necessary. Later on, we walk around and see the results.

目前当构建完成(并应用标签)时,我们手动走动,安装新构建,并开始测试。每个测试需要 8-24 小时,因此并行运行它们是非常必要的。后来,我们四处走走看看结果。

I'd like to automate:

我想自动化:

  • Distribution of the build
  • Installation of the program
  • Beginning of the test scripts
  • Collection of the data.
  • 构建分布
  • 安装程序
  • 测试脚本的开始
  • 数据的收集。

I'm assuming I can use Jenkins for all of this, but I haven't been able to find a good / easy tutorial that tells me how to do this. I'm sure it involves installing the 'slave' service on all the test machines, but the instructions for even that don't seem to be working very well.

我假设我可以将 Jenkins 用于所有这些,但我一直无法找到一个好的/简单的教程来告诉我如何做到这一点。我确信它涉及在所有测试机器上安装“从属”服务,但即使是这样的说明似乎也不能很好地工作。

Any ideas for a good tutorial? Any pointers from all of you? Thanks!

有什么好的教程的想法吗?大家有什么指点吗?谢谢!

回答by Sagar

Since your builds are done on the master, I'm assuming you are going to require this:

由于您的构建是在 master 上完成的,我假设您将需要以下内容:

http://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin

http://wiki.jenkins-ci.org/display/JENKINS/Copy+To+Slave+Plugin

I would try something like this:

我会尝试这样的事情:

  • Create Job # 1 that builds your application/program/library/whatever else.

  • Create Job #2

    • Use this job and the above plugin to copy over the resultant files over to the test slave
    • Use this job to install the artifacts that were copied over by job #1 using the "Windows Batch Command" build step.
    • Use this job to run your tests
  • Use the "Build other projects" option under "Post build actions" in Job #1 to trigger Job #2. This can be a multi-configuration project, so you can pick multiple slaves for it.

  • 创建构建您的应用程序/程序/库/其他任何内容的作业 # 1。

  • 创建作业 #2

    • 使用此作业和上述插件将生成的文件复制到测试从站
    • 使用此作业安装由作业 #1 使用“Windows 批处理命令”构建步骤复制的工件。
    • 使用此作业运行您的测试
  • 使用 Job #1 中“Post build actions”下的“Build other projects”选项来触发 Job #2。这可以是一个多配置项目,因此您可以为其选择多个从站。

This way, anytime you start Job #1, and it is successful, #2 will be triggered, and it will copy over files, install them, and start the test.

这样,只要您启动 Job #1,并且它成功,就会触发 #2,它将复制文件、安装它们并开始测试。

Two things I've assumed here: your software can be installed via command line, and that it can be installed without human intervention, or at least using some sort of script.

我在这里假设了两件事:您的软件可以通过命令行安装,并且可以在没有人工干预的情况下安装,或者至少使用某种脚本。

回答by lwells

You might also find Jenkins/Hudson creator Kohsuke Kawaguchi's new white paper helpful... 7 Ways to Optimize Jenkins

您可能还会发现 Jenkins/Hudson 创建者 Kohsuke Kawaguchi 的新白皮书很有帮助... 优化 Jenkins 的 7 种方法