blob: 9e34ceae1315e8cb7f175e467343b12a1435b3de [file] [log] [blame]
azvyagintsev4eb89ea2018-08-07 17:48:19 +02001package com.mirantis.mk
azvyagintsev5c0313d2018-08-13 17:13:35 +03002
azvyagintsev4eb89ea2018-08-07 17:48:19 +02003def common = new com.mirantis.mk.Common()
4def saltModelTesting = new com.mirantis.mk.SaltModelTesting()
5
6/**
7 * Test CC model wrapper
8 * EXTRA_VARIABLES_YAML: yaml based string, to be directly passed into testCCModel
azvyagintsev5c0313d2018-08-13 17:13:35 +03009 * SLAVE_NODE:
azvyagintsev4eb89ea2018-08-07 17:48:19 +020010 */
11
azvyagintsev5c0313d2018-08-13 17:13:35 +030012slaveNode = env.SLAVE_NODE ?: 'python&&docker'
13
azvyagintsev4eb89ea2018-08-07 17:48:19 +020014timeout(time: 1, unit: 'HOURS') {
azvyagintsev5c0313d2018-08-13 17:13:35 +030015 node(slaveNode) {
16 try {
17 extraVars = readYaml text: EXTRA_VARIABLES_YAML
18 currentBuild.description = extraVars.modelFile
19 saltModelTesting.testCCModel(extraVars)
azvyagintsev4eb89ea2018-08-07 17:48:19 +020020 } catch (Throwable e) {
azvyagintsev5c0313d2018-08-13 17:13:35 +030021 // If there was an error or exception thrown, the build failed
22 currentBuild.result = "FAILURE"
23 currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message
24 throw e
azvyagintsev4eb89ea2018-08-07 17:48:19 +020025 }
azvyagintsev5c0313d2018-08-13 17:13:35 +030026 }
27}