如何同时在控制器上的作业中同时运行2个Jenkins代理

发布于 2025-01-26 14:39:50 字数 235 浏览 3 评论 0原文

我有一个带有Maven的Selenium Automation项目,目前我正在使用XML文件在本地运行测试用例的批次。

现在,我需要在詹金斯(Jenkins)运行整个套件,为此,我有2个代理EC2实例。我为这两个代理配置了两个XML文件,以将套件划分。现在我可以单独构建它们。

我正在寻找一种解决方案,以同时触发我的两个代理商,当时主要是在构建主要工作时,以便我可以与詹金斯管道(Jenkins Pipeline)同样执行它们。

I have a selenium automation project with Maven and I am currently using XML files to run the batches of test cases locally.

Now I have a requirement to run the whole suite in Jenkins, and for that, I have 2 agent EC2 instances with the project. I configured two XML files for those two agents to divide the suite among them. Now I can build them separately.

I am looking for a solution to trigger both my agents at the same time when the job on the main is being built so that I can parallely execute them with my Jenkins pipeline.

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

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

发布评论

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

评论(1

围归者 2025-02-02 14:39:50

标记您的两个实例,假设label1label2

然后..

stage('Tests') {
        parallel {
            stage('Suite1') {
                steps {
                    node('label1') {
                       //do something...
                    } 
                }
            }
            stage('Suite2') {
                steps {
                    node('label2') {
                       //do something...
                    }
                }
            }
        }
    }

Label both your instances, lets say label1 and label2

then..

stage('Tests') {
        parallel {
            stage('Suite1') {
                steps {
                    node('label1') {
                       //do something...
                    } 
                }
            }
            stage('Suite2') {
                steps {
                    node('label2') {
                       //do something...
                    }
                }
            }
        }
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文