Oleksii Zhurba | b469859 | 2017-10-05 14:01:07 -0500 | [diff] [blame] | 1 | /** |
| 2 | * |
| 3 | * Launch sanity validation of the cloud |
| 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 |
| 11 | * PROXY Proxy to use for cloning repo or for pip |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | validate = new com.mirantis.mcp.Validate() |
| 16 | |
| 17 | def artifacts_dir = 'validation_artifacts/' |
| 18 | |
| 19 | node() { |
| 20 | try{ |
| 21 | stage('Initialization') { |
| 22 | validate.prepareVenv(SANITY_TESTS_REPO, PROXY) |
| 23 | } |
| 24 | |
| 25 | stage('Run Infra tests') { |
| 26 | sh "mkdir -p ${artifacts_dir}" |
| 27 | validate.runSanityTests(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS, SANITY_TESTS_SET, artifacts_dir) |
| 28 | } |
| 29 | stage ('Publish results') { |
| 30 | archiveArtifacts artifacts: "${artifacts_dir}/*" |
| 31 | junit "${artifacts_dir}/*.xml" |
| 32 | } |
| 33 | } catch (Throwable e) { |
| 34 | // If there was an error or exception thrown, the build failed |
| 35 | currentBuild.result = "FAILURE" |
| 36 | throw e |
| 37 | } |
| 38 | } |