blob: 7adca5a96981020279f120b6553a9925ca1992f1 [file] [log] [blame]
Oleksii Zhurbab4698592017-10-05 14:01:07 -05001/**
2 *
Oleksii Zhurba24231242017-11-10 16:05:02 -06003 * Launch sanity verification of the cloud
Oleksii Zhurbab4698592017-10-05 14:01:07 -05004 *
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 Zhurba24231242017-11-10 16:05:02 -060011 * SANITY_TESTS_SETTINGS Additional envrionment variables for cvp-sanity-checks
Oleksii Zhurbab4698592017-10-05 14:01:07 -050012 * PROXY Proxy to use for cloning repo or for pip
13 *
14 */
15
16validate = new com.mirantis.mcp.Validate()
17
18def artifacts_dir = 'validation_artifacts/'
Jakub Josefa63f9862018-01-11 17:58:38 +010019timeout(time: 12, unit: 'HOURS') {
20 node() {
21 try{
22 stage('Initialization') {
23 validate.prepareVenv(SANITY_TESTS_REPO, PROXY)
24 }
Oleksii Zhurbab4698592017-10-05 14:01:07 -050025
Jakub Josefa63f9862018-01-11 17:58:38 +010026 stage('Run Infra tests') {
27 sh "mkdir -p ${artifacts_dir}"
Oleksii Zhurba24231242017-11-10 16:05:02 -060028 validate.runSanityTests(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS, SANITY_TESTS_SET, artifacts_dir, SANITY_TESTS_SETTINGS)
Jakub Josefa63f9862018-01-11 17:58:38 +010029 }
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 Zhurbab4698592017-10-05 14:01:07 -050038 }
Oleksii Zhurbab4698592017-10-05 14:01:07 -050039 }
40}