blob: ed87cd6ae12a7afdfd54efd4bf404193f3b996c2 [file] [log] [blame]
Oleksii Zhurbab4698592017-10-05 14:01:07 -05001/**
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
15validate = new com.mirantis.mcp.Validate()
16
17def artifacts_dir = 'validation_artifacts/'
Jakub Josefa63f9862018-01-11 17:58:38 +010018timeout(time: 12, unit: 'HOURS') {
19 node() {
20 try{
21 stage('Initialization') {
22 validate.prepareVenv(SANITY_TESTS_REPO, PROXY)
23 }
Oleksii Zhurbab4698592017-10-05 14:01:07 -050024
Jakub Josefa63f9862018-01-11 17:58:38 +010025 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
Oleksii Zhurbab4698592017-10-05 14:01:07 -050037 }
Oleksii Zhurbab4698592017-10-05 14:01:07 -050038 }
39}