Oleksii Zhurba | d50b6fa | 2018-06-13 11:13:07 -0500 | [diff] [blame] | 1 | /** |
| 2 | * |
| 3 | * Launch pytest frameworks in Jenkins |
| 4 | * |
| 5 | * Expected parameters: |
| 6 | * SALT_MASTER_URL URL of Salt master |
| 7 | * SALT_MASTER_CREDENTIALS Credentials to the Salt API |
| 8 | * |
| 9 | * TESTS_SET Leave empty for full run or choose a file (test) |
| 10 | * TESTS_REPO Repo to clone |
| 11 | * TESTS_SETTINGS Additional environment varibales to apply |
| 12 | * PROXY Proxy to use for cloning repo or for pip |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | validate = new com.mirantis.mcp.Validate() |
| 17 | |
| 18 | node() { |
| 19 | try{ |
| 20 | stage('Initialization') { |
| 21 | validate.prepareVenv(TESTS_REPO, PROXY) |
| 22 | } |
| 23 | |
| 24 | stage('Run Tests') { |
| 25 | validate.runTests(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS, TESTS_SET, '', TESTS_SETTINGS) |
| 26 | } |
| 27 | stage ('Publish results') { |
| 28 | archiveArtifacts artifacts: "*" |
| 29 | junit "*.xml" |
| 30 | plot csvFileName: 'plot-8634d2fe-dc48-4713-99f9-b69a381483aa.csv', |
| 31 | group: 'SPT', |
| 32 | style: 'line', |
| 33 | title: 'SPT Glance results', |
| 34 | xmlSeries: [[ |
| 35 | file: "report.xml", |
| 36 | nodeType: 'NODESET', |
| 37 | url: '', |
| 38 | xpath: '/testsuite/testcase[@name="test_speed_glance"]/properties/property']] |
| 39 | plot csvFileName: 'plot-8634d2fe-dc48-4713-99f9-b69a381483bb.csv', |
| 40 | group: 'SPT', |
| 41 | style: 'line', |
| 42 | title: 'SPT HW2HW results', |
| 43 | xmlSeries: [[ |
| 44 | file: "report.xml", |
| 45 | nodeType: 'NODESET', |
| 46 | url: '', |
Oleksii Zhurba | c5cd93a | 2018-08-03 16:14:50 -0500 | [diff] [blame] | 47 | xpath: '/testsuite/testcase[@classname="cvp_spt.tests.test_hw2hw"]/properties/property']] |
Oleksii Zhurba | d50b6fa | 2018-06-13 11:13:07 -0500 | [diff] [blame] | 48 | plot csvFileName: 'plot-8634d2fe-dc48-4713-99f9-b69a381483bc.csv', |
| 49 | group: 'SPT', |
| 50 | style: 'line', |
| 51 | title: 'SPT VM2VM results', |
| 52 | xmlSeries: [[ |
| 53 | file: "report.xml", |
| 54 | nodeType: 'NODESET', |
| 55 | url: '', |
Oleksii Zhurba | c5cd93a | 2018-08-03 16:14:50 -0500 | [diff] [blame] | 56 | xpath: '/testsuite/testcase[@classname="cvp_spt.tests.test_vm2vm"]/properties/property']] |
Oleksii Zhurba | d50b6fa | 2018-06-13 11:13:07 -0500 | [diff] [blame] | 57 | } |
| 58 | } catch (Throwable e) { |
| 59 | // If there was an error or exception thrown, the build failed |
| 60 | currentBuild.result = "FAILURE" |
| 61 | throw e |
| 62 | } |
| 63 | } |