Jenkins多配置项目处理并发设备使用情况 [英] Jenkins multiconfiguration project handle concurrent device usage

查看:246
本文介绍了Jenkins多配置项目处理并发设备使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在移动设备(Android,iOS)上进行了Jenkins奴隶女巫运行的葫芦测试.为了分开在哪台计算机(iOS的Mac或Android的Linux)上运行测试,我还使用了 Throttle Concurrent Builds插件.这样,我就可以将设备连接到的Android或Mac Jenkins从站之间进行分离.

I have a Jenkins slave witch run's calabash tests on mobile devices (android, ios). To separate on which machines (the mac for iOS or Linux for Android) the tests is run, I also use the Throttle Concurrent Builds Plug-in. This way I separate between the Android or Mac Jenkins slaves the devices are hooked to.

我使用映射表和自写的bash脚本按名称调用设备,并在此特定从站上执行测试.映射表将名称映射到设备ID(或iOS的IP).

I use a mapping table and a self written bash script to call a device by name and execute a test on this specific slave. The mapping table map's the name to the device id (or IP for iOS).

体系结构如下:

[Master]--(Slave-iOS)---------iPhone6
 |             |--------------iPhone5
 |            
 |--------(Slave-Android)-----HTCOne
               |--------------Nexus
               |--------------G4

要将设备移交给bash脚本,我使用 Jenkins Matrix Project插件,它使我可以创建设备和测试用例的列表,例如:

To hand over the device to the bash script I use the Jenkins Matrix Project Plugin, which lets me create a list of devices and test cases like:

          HTCOne Nexus G4
Run         x     x     x
Delete      x     x     x
CreateUser  x     x     x

遗憾的是,该列表只能顺序执行.现在,我还想同时在多个设备上构建测试,反之亦然.

Sadly this list can only be executed sequentially. Now I also want to build tests on multiple devices in parallel and cross vice versa.

我搜索一个处理设备分配的Jenkins插件.如果一个触发器需要一台特定的设备,则应等待直到可以访问该触发器并可以执行测试.该插件应与Jenkins中的shell执行集成.

I search for a Jenkins plugin which handles devices allocation. If one trigger needs a specific device it should wait until this one is accessible and the test can be executed. The plugin should integrate with the shell execution in Jenkins.

如果可以与Matrix Project插件结合使用,那就大有好处了!

A big plus would be, if it can be combined with the Matrix Project Plugin!

到目前为止我一直在研究:

What I looked into so far:

  • 排除插件
  • 油门并发构建插件,[用于指定从属]
  • 锁和闩锁插件, 对于到目前为止列出的所有组件,我都不知道如何将它们链接到矩阵配置并动态获取设备.我也不知道 如何将锁定的资源信息获取到我的脚本中.
  • 端口分配器插件,未经测试,但似乎有相同的问题
  • 外部资源分派器,似乎仅分配一种资源,如果是矩阵配置,则找不到任何东西.
  • Exclusion-Plugin,
  • Throttle Concurrent Builds Plug-in, [used to specifiy the slave]
  • Locks and Latches plugin, For all the listed ones so far, I don't know how to link them to the matrix configuration and get a device dynamically. I also don't know how to get the locked resource information into my script.
  • Port Allocator Plugin, not tested but seems to have the same problem
  • External Resource Dispatcher, seem to allocate only one resource and is not finding anything if it is a matrix configuration.

我发现的相关问题有帮助,但未能解决问题:

Related questions I found, which helped but didn't solved the problem:

  • How to prevent certain Jenkins jobs from running simultaneously?
  • Jenkins: group jobs and limit build processors for this group
  • Jenkins to not allow the same job to run concurrently on the same node?
  • How do I ensure that only one of a certain category of job runs at once in Hudson?
  • Disable Jenkins Job from Another Job

推荐答案

如果在您的多配置项目中无法正常工作,请尝试 排除插件,带有动态资源名称,例如: SEMAPHORE_MATRIX_ $ {NODE_NAME}

If Throttle Concurrent Builds Plugin doesn't work as required in your multi-configuration project, try Exclusion Plugin with a dynamic resource name, like: SEMAPHORE_MATRIX_${NODE_NAME}

然后添加一个构建步骤关键块开始"(和一个可选的关键块结束"步骤),该步骤将保持该构建块的执行,直到SEMAPHORE_MATRIX _ $ {NODE_NAME}未在任何其他作业(包括当前作业)上使用矩阵子作业.

Then add a Build step "Critical block start" (and an optional "Critical block end" step), which will hold this build block execution until SEMAPHORE_MATRIX_${NODE_NAME} is not in use on any other job, including the current Matrix child jobs.

(...构建步骤仅在SEMAPHORE_MATRIX _ $ {NODE_NAME}可用时才运行...)

这篇关于Jenkins多配置项目处理并发设备使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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