azvyagintsev | 4eb89ea | 2018-08-07 17:48:19 +0200 | [diff] [blame] | 1 | package com.mirantis.mk |
azvyagintsev | 5c0313d | 2018-08-13 17:13:35 +0300 | [diff] [blame^] | 2 | |
azvyagintsev | 4eb89ea | 2018-08-07 17:48:19 +0200 | [diff] [blame] | 3 | def common = new com.mirantis.mk.Common() |
| 4 | def 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 |
azvyagintsev | 5c0313d | 2018-08-13 17:13:35 +0300 | [diff] [blame^] | 9 | * SLAVE_NODE: |
azvyagintsev | 4eb89ea | 2018-08-07 17:48:19 +0200 | [diff] [blame] | 10 | */ |
| 11 | |
azvyagintsev | 5c0313d | 2018-08-13 17:13:35 +0300 | [diff] [blame^] | 12 | slaveNode = env.SLAVE_NODE ?: 'python&&docker' |
| 13 | |
azvyagintsev | 4eb89ea | 2018-08-07 17:48:19 +0200 | [diff] [blame] | 14 | timeout(time: 1, unit: 'HOURS') { |
azvyagintsev | 5c0313d | 2018-08-13 17:13:35 +0300 | [diff] [blame^] | 15 | node(slaveNode) { |
| 16 | try { |
| 17 | extraVars = readYaml text: EXTRA_VARIABLES_YAML |
| 18 | currentBuild.description = extraVars.modelFile |
| 19 | saltModelTesting.testCCModel(extraVars) |
azvyagintsev | 4eb89ea | 2018-08-07 17:48:19 +0200 | [diff] [blame] | 20 | } catch (Throwable e) { |
azvyagintsev | 5c0313d | 2018-08-13 17:13:35 +0300 | [diff] [blame^] | 21 | // 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 |
azvyagintsev | 4eb89ea | 2018-08-07 17:48:19 +0200 | [diff] [blame] | 25 | } |
azvyagintsev | 5c0313d | 2018-08-13 17:13:35 +0300 | [diff] [blame^] | 26 | } |
| 27 | } |