简体   繁体   English

并行测试执行詹金斯

[英]Parallel Test Execution Jenkins

I have some automated tests that I'm running using Jenkins. 我有一些正在使用Jenkins运行的自动化测试。

I've Jenkins connected to my GitSwarm which pulls the code from my branch and then exectutes it. 我将Jenkins连接到我的GitSwarm,它从我的分支中提取代码,然后将其执行。

I have installed the "Parallel Test Job Execution Plugin" for Jenkins. 我已经为Jenkins安装了“并行测试作业执行插件”。

In the plugin I have specified the tests to run in 3 batches 在插件中,我指定了要分三批运行的测试

截图

Is there anything else I should specify? 还有什么我应该指定的吗? I didn't think I would have to since I'm connecting to GitSwarm to run the code. 我认为我不必这样做,因为我正在连接到GitSwarm来运行代码。 The console output seems to state otherwise ! 控制台输出似乎表明否则!

Building in workspace C:\\Jenkins\\jobs\\GIT_DVT\\workspace 在工作空间C:\\ Jenkins \\ jobs \\ GIT_DVT \\ workspace中构建

git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git.exe config remote.origin.url https://.../VMAX_UNISPHERE/stoage_mgmt.git # timeout=10
Fetching upstream changes from https://.../VMAX_UNISPHERE/stoage_mgmt.git
git.exe --version # timeout=10
using .gitcredentials to set credentials
git.exe config --local credential.username reganc3 # timeout=10
git.exe config --local credential.helper store --file=\"C:\Users\ADMINI~1\AppData\Local\Temp\2\git5891789764540509525.credentials\" # timeout=10
git.exe -c core.askpass=true fetch --tags --progress https://.../VMAX_UNISPHERE/stoage_mgmt.git +refs/heads/*:refs/remotes/origin/*
git.exe config --local --remove-section credential # timeout=10
git.exe rev-parse "origin/Uni_360_1.0^{commit}" # timeout=10
Checking out Revision 08df9a379e14d8a634e4533d962f5919f755ae67 (origin/Uni_360_1.0)
git.exe config core.sparsecheckout # timeout=10
git.exe checkout -f 08df9a379e14d8a634e4533d962f5919f755ae67
git.exe rev-list 08df9a379e14d8a634e4533d962f5919f755ae67 # timeout=10
No record available, so executing everything in one place
[parameterized-trigger] Current build has no parameters.
ERROR: Build aborted. No projects to trigger. Check your configuration!
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: C:\jenkins\jobs\GIT_DVT\workspace\unisphere360\target\surefire-reports\
Did not find any matching files.
Finished: FAILURE

Any help would be greatly appreciated, it does seem like an easy way to have tests running parallel so hopefully its only a small error. 任何帮助将不胜感激,这似乎是使测试并行运行的一种简便方法,因此希望它只是一个很小的错误。

I think you have misunderstood the plugin: 我认为您误解了插件:

This plugin adds a new builder that lets you easily execute tests defined in a separate job in parallel. 该插件添加了一个新的构建器,使您可以轻松地并行执行在单独作业中定义的测试。 This is achieved by having Jenkins look at the test execution time of the last run, split tests into multiple units of roughly equal size, then execute them in parallel. 这是通过让詹金斯查看上一次运行的测试执行时间,将测试分为大小大致相等的多个单元然后并行执行来实现的。

You have do define a new job to run the tests which is called by this plugin. 您确实定义了一个新作业来运行此插件调用的测试。 ( source ) 来源

But I want to ... 但是我要 ...

You can achieve this on different ways: 您可以通过不同的方式实现这一目标:

  • Use the parallel keyword of TestNG 使用TestNG的parallel关键字
    You can define test suites and say how they should be executed. 您可以定义测试套件并说出应如何执行。
  • Create a new job which takes the test to run as parameter and call it via the plugin (You need a new job and have the overhead of Jenkins) 创建一个新测试,将测试作为参数运行,并通过插件调用它(您需要一个新工作,并且需要詹金斯管理)
  • Use the parallel keyword of the Job DSL Plugin or Pipeline Plugin (You have to recreate the job definition) 使用Job DSL插件管道插件的parallel关键字(您必须重新创建作业定义)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM