Skip to content

Commit e33e362

Browse files
committed
ci: use lockable resources to limit e2e build to one per host
Referenced issue: * status-im/infra-ci#86
1 parent 7390095 commit e33e362

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

ci/Jenkinsfile.tests-e2e.windows

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -168,26 +168,29 @@ pipeline {
168168
steps {
169169
timeout(time: getTestStageTimeout()) {
170170
dir('test/e2e') {
171-
script {
172-
def flags = []
173-
if (params.TEST_NAME) { flags.add("-k=${params.TEST_NAME}") }
174-
if (params.TEST_SCOPE_FLAG) { flags.add(params.TEST_SCOPE_FLAG) }
175-
if (params.LOG_LEVEL) { flags.addAll(["--log-level=${params.LOG_LEVEL}", "--log-cli-level=${params.LOG_LEVEL}"]) }
176-
def flagStr = flags.join(' ')
177-
178-
withCredentials([
179-
usernamePassword(credentialsId: 'test-rail-api-devops', usernameVariable: 'TESTRAIL_USR', passwordVariable: 'TESTRAIL_PSW'),
180-
string(credentialsId: 'wallet-test-user-seed', variable: 'WALLET_TEST_USER_SEED')
181-
]) {
182-
sh"""
183-
pushd configs
184-
ln -sf _local.ci.py _local.py || cp _local.ci.py _local.py
185-
popd
186-
187-
"""
188-
bat"""
189-
python310 -m pytest -m "not keycard" -v --reruns=1 --timeout=300 ${flagStr} --disable-warnings --alluredir=./allure-results -o timeout_func_only=true
190-
"""
171+
/* Lock the agent so we run only one e2e build at a time */
172+
lock(resource: "e2e-windows-${env.NODE_NAME}", quantity: 1) {
173+
script {
174+
def flags = []
175+
if (params.TEST_NAME) { flags.add("-k=${params.TEST_NAME}") }
176+
if (params.TEST_SCOPE_FLAG) { flags.add(params.TEST_SCOPE_FLAG) }
177+
if (params.LOG_LEVEL) { flags.addAll(["--log-level=${params.LOG_LEVEL}", "--log-cli-level=${params.LOG_LEVEL}"]) }
178+
def flagStr = flags.join(' ')
179+
180+
withCredentials([
181+
usernamePassword(credentialsId: 'test-rail-api-devops', usernameVariable: 'TESTRAIL_USR', passwordVariable: 'TESTRAIL_PSW'),
182+
string(credentialsId: 'wallet-test-user-seed', variable: 'WALLET_TEST_USER_SEED')
183+
]) {
184+
sh"""
185+
pushd configs
186+
ln -sf _local.ci.py _local.py || cp _local.ci.py _local.py
187+
popd
188+
189+
"""
190+
bat"""
191+
python310 -m pytest -m "not keycard" -v --reruns=1 --timeout=300 ${flagStr} --disable-warnings --alluredir=./allure-results -o timeout_func_only=true
192+
"""
193+
}
191194
}
192195
}
193196
}

0 commit comments

Comments
 (0)