Revert "Update stage1 and stage3 to run robot tests with tag"
[osm/devops.git] / jenkins / ci-pipelines / ci_stage_3.groovy
index d42c6dd..f5fa75d 100644 (file)
@@ -35,13 +35,15 @@ properties([
         booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_FAIL'),
         booleanParam(defaultValue: false, description: '', name: 'SAVE_CONTAINER_ON_PASS'),
         booleanParam(defaultValue: true, description: '', name: 'SAVE_ARTIFACTS_ON_SMOKE_SUCCESS'),
+        booleanParam(defaultValue: true, description: '', name: 'DO_STAGE_4'),
         booleanParam(defaultValue: true, description: '',  name: 'DO_BUILD'),
         booleanParam(defaultValue: true, description: '', name: 'DO_INSTALL'),
+        booleanParam(defaultValue: true, description: '', name: 'DO_SMOKE'),
         booleanParam(defaultValue: true, description: '', name: 'DO_DOCKERPUSH'),
         booleanParam(defaultValue: false, description: '', name: 'SAVE_ARTIFACTS_OVERRIDE'),
         string(defaultValue: '/home/jenkins/hive/openstack-etsi.rc', description: '', name: 'HIVE_VIM_1'),
-        booleanParam(defaultValue: true, description: '', name: 'DO_ROBOT'),
-        string(defaultValue: 'sanity', description: 'sanity/regression/daily are the common options', name: 'ROBOT_TAG'),
+        booleanParam(defaultValue: false, description: '', name: 'DO_ROBOT'),
+        string(defaultValue: 'daily', description: 'sanity/regression/daily are the common options', name: 'TEST_NAME'),
         string(defaultValue: '/home/jenkins/hive/robot-systest.cfg', description: '', name: 'ROBOT_VIM'),
         string(defaultValue: '/home/jenkins/hive/kubeconfig.yaml', description: '', name: 'KUBECONFIG'),
         string(defaultValue: '/home/jenkins/hive/clouds.yaml', description: '', name: 'CLOUDS'),
@@ -473,53 +475,56 @@ node("${params.NODE}") {
                         osmHostname = IP_ADDRESS
                     }
                 } // stage("Install")
+            } // if ( params.DO_INSTALL )
+
 ///////////////////////////////////////////////////////////////////////////////////////
 // Health check of installed OSM in remote vm
 ///////////////////////////////////////////////////////////////////////////////////////
+            if ( params.DO_SMOKE ) {
                 stage("OSM Health") {
                     stackName = "osm"
                     sshCommand remote: remote, command: """
                         /usr/share/osm-devops/installers/osm_health.sh -k -s ${stackName}
                     """
-                } // stage("OSM Health")
+                }
             }
-            } // if ( params.DO_INSTALL )
-
 
 ///////////////////////////////////////////////////////////////////////////////////////
 // Execute Robot tests
 ///////////////////////////////////////////////////////////////////////////////////////
             stage_archive = false
-            if ( params.DO_ROBOT ) {
+            if ( params.DO_STAGE_4 ) {
                 try {
                     stage("System Integration Test") {
-                        if ( useCharmedInstaller ) {
-                            tempdir = sh(returnStdout: true, script: "mktemp -d").trim()
-                            sh(script: "touch ${tempdir}/hosts")
-                            hostfile="${tempdir}/hosts"
-                            sh """cat << EOF > ${hostfile}
+                        if ( params.DO_ROBOT ) {
+                            if( useCharmedInstaller ) {
+                                tempdir = sh(returnStdout: true, script: "mktemp -d").trim()
+                                sh(script: "touch ${tempdir}/hosts")
+                                hostfile="${tempdir}/hosts"
+                                sh """cat << EOF > ${hostfile}
 127.0.0.1           localhost
 ${remote.host}      prometheus.${remote.host}.xip.io nbi.${remote.host}.xip.io
 EOF"""
-                        } else {
-                            hostfile=null
-                        }
+                            } else {
+                                hostfile=null
+                            }
 
-                        jujuPassword=sshCommand remote: remote, command: """
-                            echo `juju gui 2>&1 | grep password | cut -d: -f2`
-                        """
-
-                        run_robot_systest(
-                            container_name,
-                            params.ROBOT_TAG,
-                            osmHostname,
-                            prometheusHostname,
-                            prometheusPort,
-                            params.ROBOT_VIM,
-                            params.KUBECONFIG,
-                            params.CLOUDS,
-                            hostfile,
-                            jujuPassword)
+                            jujuPassword=sshCommand remote: remote, command: """
+                                echo `juju gui 2>&1 | grep password | cut -d: -f2`
+                            """
+
+                            run_robot_systest(
+                                container_name,
+                                params.TEST_NAME,
+                                osmHostname,
+                                prometheusHostname,
+                                prometheusPort,
+                                params.ROBOT_VIM,
+                                params.KUBECONFIG,
+                                params.CLOUDS,
+                                hostfile,
+                                jujuPassword)
+                        }
                     } // stage("System Integration Test")
                 } finally {
                     stage("Archive Container Logs") {
@@ -535,7 +540,7 @@ EOF"""
                         }
                     }
                 }
-            } // if ( params.DO_ROBOT )
+            } // if ( params.DO_STAGE_4 )
 
             if ( params.SAVE_ARTIFACTS_OVERRIDE || stage_archive ) {
                 stage("Archive") {