当前,我的Jenkins运行在使用Windows 10 Pro x64的主服务器(主机)和一个也使用Windows 10 Pro x64(虚拟机)的从节点上。
我还配置了以下Jenkins管道作业:
pipeline {
agent any
tools {nodejs "node"}
stages {
stage('Cypress Parallel Test Suite') {
parallel {
stage('Test_1') {
steps {
git 'https://github.com/quser/cypress-auto-framework.git'
bat 'npm install'
bat 'npm update'
bat 'npm run triggerAllTests-dashboard'
}
}
stage('Test_2') {
agent {
label "remote"
}
steps {
git 'https://github.com/quser/cypress-auto-framework.git'
bat 'npm install'
bat 'npm update'
bat 'npm run triggerAllTests-dashboard'
}
}
}
}
}
}
从主节点触发作业时,我可以看到从节点指示以下消息:
In order to run in parallel mode each machine must send identical environment parameters such as:
- specs
- osName
- osVersion
- browserName
- browserVersion (major)
This machine sent the following parameters:
{ "osName": "win32", "osVersion": "10.0.18363", "browserName": "Electron", "browserVersion": "80.0.3987.158", "specs": [
"cypress\\integration\\examples\\aliasing.spec.js",
"cypress\\integration\\examples\\assertions.spec.js",
"cypress\\integration\\examples\\webdriverUni\\actions.spec.js" ]
}
请注意,我已在自定义节点脚本(triggerAllTests-dashboard)中添加了--parallel键。
有什么想法吗?
谢谢