Oleksii Zhurba | b469859 | 2017-10-05 14:01:07 -0500 | [diff] [blame] | 1 | /** |
| 2 | * |
Oleksii Zhurba | 2423124 | 2017-11-10 16:05:02 -0600 | [diff] [blame] | 3 | * Launch sanity verification of the cloud |
Oleksii Zhurba | b469859 | 2017-10-05 14:01:07 -0500 | [diff] [blame] | 4 | * |
| 5 | * Expected parameters: |
| 6 | * SALT_MASTER_URL URL of Salt master |
| 7 | * SALT_MASTER_CREDENTIALS Credentials to the Salt API |
| 8 | * |
| 9 | * SANITY_TESTS_SET Leave empty for full run or choose a file (test), e.g. test_mtu.py |
| 10 | * SANITY_TESTS_REPO CVP-sanity-checks repo to clone |
Oleksii Zhurba | 2423124 | 2017-11-10 16:05:02 -0600 | [diff] [blame] | 11 | * SANITY_TESTS_SETTINGS Additional envrionment variables for cvp-sanity-checks |
Oleksii Zhurba | b469859 | 2017-10-05 14:01:07 -0500 | [diff] [blame] | 12 | * PROXY Proxy to use for cloning repo or for pip |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | validate = new com.mirantis.mcp.Validate() |
| 17 | |
| 18 | def artifacts_dir = 'validation_artifacts/' |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 19 | timeout(time: 12, unit: 'HOURS') { |
| 20 | node() { |
| 21 | try{ |
| 22 | stage('Initialization') { |
| 23 | validate.prepareVenv(SANITY_TESTS_REPO, PROXY) |
| 24 | } |
Oleksii Zhurba | b469859 | 2017-10-05 14:01:07 -0500 | [diff] [blame] | 25 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 26 | stage('Run Infra tests') { |
| 27 | sh "mkdir -p ${artifacts_dir}" |
Oleksii Zhurba | 2423124 | 2017-11-10 16:05:02 -0600 | [diff] [blame] | 28 | validate.runSanityTests(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS, SANITY_TESTS_SET, artifacts_dir, SANITY_TESTS_SETTINGS) |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame] | 29 | } |
| 30 | stage ('Publish results') { |
| 31 | archiveArtifacts artifacts: "${artifacts_dir}/*" |
| 32 | junit "${artifacts_dir}/*.xml" |
| 33 | } |
| 34 | } catch (Throwable e) { |
| 35 | // If there was an error or exception thrown, the build failed |
| 36 | currentBuild.result = "FAILURE" |
| 37 | throw e |
Oleksii Zhurba | b469859 | 2017-10-05 14:01:07 -0500 | [diff] [blame] | 38 | } |
Oleksii Zhurba | b469859 | 2017-10-05 14:01:07 -0500 | [diff] [blame] | 39 | } |
| 40 | } |