Skip to content

Commit

Permalink
ci: use virtualenv to avoid race conditions
Browse files Browse the repository at this point in the history
Desktop QA tests also use Pytest packages and their versions are
different, so we can't install them globally, it needs to be done per
build using `WORKSPACE_TMP` as destination.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
  • Loading branch information
jakubgs committed Apr 16, 2024
1 parent 8a12ad3 commit 7c901fa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
9 changes: 8 additions & 1 deletion ci/tests/Jenkinsfile.e2e-nightly
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ pipeline {
))
}

environment {
/* Avoid race conditions with other builds using virtualenv. */
VIRTUAL_ENV = "${WORKSPACE_TMP}/venv"
PATH = "${VIRTUAL_ENV}/bin:${PATH}"
}

stages {
stage('Fetch') {
steps { script {
Expand All @@ -52,7 +58,8 @@ pipeline {
stage('Setup') {
steps { script {
dir('test/appium') {
sh 'pip3 install --user -r requirements.txt'
sh "python3 -m venv ${VIRTUAL_ENV}"
sh 'pip3 install -r requirements.txt'
}
} }
}
Expand Down
9 changes: 8 additions & 1 deletion ci/tests/Jenkinsfile.e2e-prs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ pipeline {
))
}

environment {
/* Avoid race conditions with other builds using virtualenv. */
VIRTUAL_ENV = "${WORKSPACE_TMP}/venv"
PATH = "${VIRTUAL_ENV}/bin:${PATH}"
}

stages {
stage('Prep') {
steps { script {
Expand All @@ -79,7 +85,8 @@ pipeline {
stage('Setup') {
steps { script {
dir('test/appium') {
sh 'pip3 install --user -r requirements.txt'
sh "python3 -m venv ${VIRTUAL_ENV}"
sh 'pip3 install -r requirements.txt'
}
} }
}
Expand Down
8 changes: 7 additions & 1 deletion ci/tests/Jenkinsfile.e2e-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ pipeline {
))
}

environment {
/* Avoid race conditions with other builds using virtualenv. */
VIRTUAL_ENV = "${WORKSPACE_TMP}/venv"
PATH = "${VIRTUAL_ENV}/bin:${PATH}"
}

stages {
stage('Prep') {
Expand All @@ -51,7 +56,8 @@ pipeline {
stage('Setup') {
steps { script {
dir('test/appium') {
sh 'pip3 install --user -r requirements.txt'
sh "python3 -m venv ${VIRTUAL_ENV}"
sh 'pip3 install -r requirements.txt'
}
} }
}
Expand Down

0 comments on commit 7c901fa

Please sign in to comment.