← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~adam-collard/maas-ci/+git/maas-ci-config:filter-envs-output-file into ~maas-committers/maas-ci/+git/maas-ci-config:master

 

Adam Collard has proposed merging ~adam-collard/maas-ci/+git/maas-ci-config:filter-envs-output-file into ~maas-committers/maas-ci/+git/maas-ci-config:master.

Commit message:
Use filter-env's --output-file


Requested reviews:
  MAAS Committers (maas-committers)

For more details, see:
https://code.launchpad.net/~adam-collard/maas-ci/+git/maas-ci-config/+merge/434567
-- 
Your team MAAS Committers is requested to review the proposed merge of ~adam-collard/maas-ci/+git/maas-ci-config:filter-envs-output-file into ~maas-committers/maas-ci/+git/maas-ci-config:master.
diff --git a/jenkins/jobs/systemtests_executor.groovy b/jenkins/jobs/systemtests_executor.groovy
index 183453f..28f4d0e 100644
--- a/jenkins/jobs/systemtests_executor.groovy
+++ b/jenkins/jobs/systemtests_executor.groovy
@@ -47,36 +47,37 @@ pipeline {
                 }
             }
         }
+	stage('Cog') {
+	    steps {
+		script {
+		    sh 'env -C system-tests tox run -e cog'
+		}
+	    }
+	}
+	stage('Filter envs') {
+	    steps {
+		script {
+		    sh 'env -C system-tests tox run -e filter_envs -- --output-file=envs1 vm1,natasha'
+		    sh 'env -C system-tests tox run -e filter_envs -- --output-file=envs2 opelt,arm64,ppc64le,vm2'
+		}
+	    }
+	}
         stage('System Tests') {
-            environment {
-                COG = sh(script:'env -C system-tests tox -e cog', returnStdout: true).trim()
-                ENVS1 = sh(script: 'env -C system-tests tox -qq -e filter_envs -- vm1,natasha',
-                           returnStdout: true).trim()
-                ENVS2 = sh(script: 'env -C system-tests tox -qq -e filter_envs -- opelt,arm64,ppc64le,vm2',
-                           returnStdout: true).trim()
-            }
-
             steps {
                 script {
                     sh """
                     cd system-tests
                     cat config.yaml
-                    tox -e env_builder,general_tests -- ${params.PYTEST_ARGS}
+                    tox run -e env_builder,general_tests -- ${params.PYTEST_ARGS}
                     """
-                    status1 = 0
-                    status2 = 0
-                    if (ENVS1) {
-                        status1 = sh(script:"""
-                            cd system-tests
-                            tox -p all -e ${ENVS1} -- ${params.PYTEST_ARGS}
-                        """, returnStatus: true)
-                    }
-                    if (ENVS2) {
-                        status2 = sh(script:"""
-                            cd system-tests
-                            tox -p all -e ${ENVS2} -- ${params.PYTEST_ARGS}
-                        """, returnStatus: true)
-                    }
+		    status1 = sh(script:"""
+                    cd system-tests
+                    if test -s envs1; then tox run-parallel -e \$(cat envs1) -- ${params.PYTEST_ARGS}; else true; fi
+                    """, returnStatus: true)
+		    status2 = sh(script:"""
+                    cd system-tests
+                    if test -s envs2; then tox run-parallel -e \$(cat envs2) -- ${params.PYTEST_ARGS}; else true; fi
+                    """, returnStatus: true)
                     if (status1 || status2) {
                         sh 'exit 1'
                     }
@@ -86,9 +87,7 @@ pipeline {
     }
     post {
         always {
-            sh '''
-            cd system-tests && tox -e collect_sos_report
-            '''
+            sh 'env -C system-tests tox run -e collect_sos_report || true'
             archiveArtifacts(
                 artifacts:'system-tests/sosreport/*,' +
                           'system-tests/*.log,' +

Follow ups