← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~adam-collard/maas-ci/+git/maas-ci-config:de-script-systemtests into ~maas-committers/maas-ci/+git/maas-ci-config:master

 

Adam Collard has proposed merging ~adam-collard/maas-ci/+git/maas-ci-config:de-script-systemtests into ~maas-committers/maas-ci/+git/maas-ci-config:master.

Commit message:
[systemtests{,_snap,_wip}] Remove redundant script{} blocks



Requested reviews:
  MAAS Committers (maas-committers)

For more details, see:
https://code.launchpad.net/~adam-collard/maas-ci/+git/maas-ci-config/+merge/437489
-- 
Your team MAAS Committers is requested to review the proposed merge of ~adam-collard/maas-ci/+git/maas-ci-config:de-script-systemtests into ~maas-committers/maas-ci/+git/maas-ci-config:master.
diff --git a/jenkins/jobs/systemtests.yaml b/jenkins/jobs/systemtests.yaml
index 5462809..31bb01b 100644
--- a/jenkins/jobs/systemtests.yaml
+++ b/jenkins/jobs/systemtests.yaml
@@ -22,7 +22,6 @@
         stages {
           stage('Checkout') {
             steps {
-              script {
               sh """
                 lxc list
                 pgrep -a qemu || true
@@ -30,7 +29,6 @@
                 git clone ${params.GIT_REPO} --branch ${params.GIT_BRANCH} --depth 10 system-tests
                 cd system-tests && git show --no-patch
               """
-              }
             }
           }
           stage('Clean') {
@@ -40,27 +38,22 @@
               }
             }
             steps {
-              script {
               sh """
                 lxc delete maas-system-build --force || true
                 lxc delete maas-system-maas --force || true
                 lxc delete maas-client --force || true
               """
-              }
             }
           }
           stage('Setup') {
             steps {
-              script {
               sh """
                 sudo apt-get install -y tox
               """
-              }
             }
           }
           stage('System Tests') {
             steps {
-              script {
                 writeFile file: 'system-tests/config.yaml', text: """
       proxy:
           use_internal: true
@@ -260,8 +253,6 @@
                           Xwjk99gnvag+HswBDB7A7DCTEqhkUQ==
                           -----END PRIVATE KEY-----
       """
-              }
-              script {
               sh """
                 cd system-tests
                 cat config.yaml
@@ -276,7 +267,6 @@
               }
             }
           }
-        }
         post {
           always {
             sh """
diff --git a/jenkins/jobs/systemtests_snap.yaml b/jenkins/jobs/systemtests_snap.yaml
index 06c6799..f49ef3b 100644
--- a/jenkins/jobs/systemtests_snap.yaml
+++ b/jenkins/jobs/systemtests_snap.yaml
@@ -22,7 +22,6 @@
         stages {
           stage('Checkout') {
             steps {
-              script {
               sh """
                 lxc list
                 pgrep -a qemu || true
@@ -30,7 +29,6 @@
                 git clone ${params.GIT_REPO} --branch ${params.GIT_BRANCH} --depth 10 system-tests
                 env -C system-tests git show --no-patch
               """
-              }
             }
           }
           stage('Clean') {
@@ -40,27 +38,22 @@
               }
             }
             steps {
-              script {
               sh """
                 lxc delete maas-system-build --force || true
                 lxc delete maas-system-maas --force || true
                 lxc delete maas-client --force || true
               """
-              }
             }
           }
           stage('Setup') {
             steps {
-              script {
               sh """
                 sudo apt-get install -y tox
               """
-              }
             }
           }
           stage('System Tests') {
             steps {
-              script {
                 writeFile file: 'system-tests/config.yaml', text: """
       proxy:
           use_internal: true
@@ -259,8 +252,6 @@
           maas_channel: ${params.MAAS_SNAP_CHANNEL}
           test_db_channel: ${params.TEST_DB_SNAP_CHANNEL}
       """
-              }
-              script {
               sh """
                 cd system-tests
                 cat config.yaml
@@ -272,7 +263,6 @@
                 tox -p all -e vm1,natasha -- ${params.PYTEST_ARGS}
                 tox -p all -e opelt,arm64,ppc64le,vm2 -- ${params.PYTEST_ARGS}
                 """
-              }
             }
           }
         }
diff --git a/jenkins/jobs/systemtests_v3.yaml b/jenkins/jobs/systemtests_v3.yaml
index c0796fc..60e618f 100644
--- a/jenkins/jobs/systemtests_v3.yaml
+++ b/jenkins/jobs/systemtests_v3.yaml
@@ -42,7 +42,6 @@
         stages {
           stage('Checkout') {
             steps {
-              script {
               sh """
                 lxc list
                 pgrep -a qemu || true
@@ -50,7 +49,6 @@
                 git clone ${params.SYSTEMTESTS_GIT_REPO} --branch ${params.SYSTEMTESTS_GIT_BRANCH} --depth 10 system-tests
                 cd system-tests && git show --no-patch
               """
-              }
             }
           }
           stage('Clean') {
@@ -60,24 +58,19 @@
               }
             }
             steps {
-              script {
               sh """
                 lxc delete maas-system-build --force || true
                 lxc delete maas-system-maas --force || true
                 lxc delete maas-client --force || true
               """
-              }
             }
           }
           stage('Setup') {
             steps {
-              script {
               sh """
                 sudo apt-get install -y tox
               """
-              }
-              script {
-                writeFile file: 'system-tests/base_config.yaml', text: """
+              writeFile file: 'system-tests/base_config.yaml', text: """
       proxy:
           use_internal: true
           http: http://squid.internal:3128
@@ -270,38 +263,35 @@
                           HXvIdwLsUASyKB/LlM6dESXr9K4r/im3sn+9oza9mbwsRnBIJ9YU9llTw9j5aUlw
                           Xwjk99gnvag+HswBDB7A7DCTEqhkUQ==
                           -----END PRIVATE KEY-----
-      """
-              }
+            """
             }
           }
           stage('Generate configuration') {
             steps {
-              script {
-                if (params.INSTALLATION_METTHOD == 'SNAP') {
-                  gen_config_cmd = "${gen_config_cmd} --snap --snap-channel ${params.MAAS_SNAP_CHANNEL}"
-                  if (params.TEST_DB_SNAP_CHANNEL) {
-                    gen_config_cmd ="${gen_config_cmd} --test-db-channel ${params.TEST_DB_SNAP_CHANNEL}"
-                  }
-                } else {
-                  gen_config_cmd = "${gen_config_cmd} --deb --git-repo ${params.MAAS_GIT_REPO} --git-branch ${params.MAAS_GIT_BRANCH} --ppa ${params.MAAS_PPA}"
-                }
-                if (params.ENABLE_TLS) {
-                  gen_config_cmd = "${gen_config_cmd} --tls"
-                }
-                if (params.ENABLE_OBSERVABILITY) {
-                  gen_config_cmd = "${gen_config_cmd} --o11y"
-                }
-                if (params.ENABLE_HW_SYNC_TEST) {
-                  gen_config_cmd = "${gen_config_cmd} --hw-sync"
-                }
-                if (params.GEN_CONFIG_ARGS) {
-                  gen_config_cmd = "${gen_config_cmd} ${params.GEN_CONFIG_ARGS}"
-                }
+               if (params.INSTALLATION_METTHOD == 'SNAP') {
+                 gen_config_cmd = "${gen_config_cmd} --snap --snap-channel ${params.MAAS_SNAP_CHANNEL}"
+                 if (params.TEST_DB_SNAP_CHANNEL) {
+                   gen_config_cmd ="${gen_config_cmd} --test-db-channel ${params.TEST_DB_SNAP_CHANNEL}"
+                 }
+               } else {
+                 gen_config_cmd = "${gen_config_cmd} --deb --git-repo ${params.MAAS_GIT_REPO} --git-branch ${params.MAAS_GIT_BRANCH} --ppa ${params.MAAS_PPA}"
+               }
+               if (params.ENABLE_TLS) {
+                 gen_config_cmd = "${gen_config_cmd} --tls"
+               }
+               if (params.ENABLE_OBSERVABILITY) {
+                 gen_config_cmd = "${gen_config_cmd} --o11y"
+               }
+               if (params.ENABLE_HW_SYNC_TEST) {
+                 gen_config_cmd = "${gen_config_cmd} --hw-sync"
+               }
+               if (params.GEN_CONFIG_ARGS) {
+                 gen_config_cmd = "${gen_config_cmd} ${params.GEN_CONFIG_ARGS}"
+               }
 
-                sh """
-                  ${gen_config_cmd} --containers-image=${params.CONTAINERS_IMAGE} base_config.yaml config.yaml
-                  """
-              }
+               sh """
+                 ${gen_config_cmd} --containers-image=${params.CONTAINERS_IMAGE} base_config.yaml config.yaml
+                 """
             }
           }
           stage('System Tests') {
@@ -312,7 +302,6 @@
             }
 
             steps {
-              script {
                 sh """
                 cd system-tests
                 cat config.yaml
@@ -327,8 +316,7 @@
                 sh """
                     ${cd_tox} -p all -e ${ENVS2} -- ${params.PYTEST_ARGS}
                 """
-                  }
-              }
+                }
             }
           }
         }

Follow ups