Ievgeniia Zadorozhna | 14c20f3 | 2017-08-31 13:35:57 +0300 | [diff] [blame] | 1 | /** |
| 2 | * |
| 3 | * Service test pipeline |
| 4 | * |
| 5 | * Expected parameters: |
| 6 | * SALT_MASTER_URL URL of Salt master |
| 7 | * SALT_MASTER_CREDENTIALS Credentials to the Salt API |
| 8 | * Test settings: |
| 9 | * IMAGE_LINK Link to docker image with Rally and Tempest |
| 10 | * TEST_TEMPEST_PATTERN If not false, run tests matched to pattern only |
| 11 | * TEST_TARGET Salt target for tempest node |
Ievgeniia Zadorozhna | 0d09cf4 | 2017-10-31 16:30:38 +0300 | [diff] [blame] | 12 | * CLEANUP_REPORTS Cleanup reports from rally,tempest container, remove all containers started the IMAGE_LINK |
| 13 | * SET Predefined set for tempest tests |
| 14 | * CONCURRENCY How many processes to use to run Tempest tests |
Ievgeniia Zadorozhna | 14c20f3 | 2017-08-31 13:35:57 +0300 | [diff] [blame] | 15 | * DO_CLEANUP_RESOURCES If "true": runs clean-up script for removing Rally and Tempest resources |
| 16 | */ |
| 17 | |
| 18 | |
| 19 | common = new com.mirantis.mk.Common() |
| 20 | salt = new com.mirantis.mk.Salt() |
| 21 | test = new com.mirantis.mk.Test() |
chnyda | 625f4b4 | 2017-10-11 14:10:31 +0200 | [diff] [blame] | 22 | def python = new com.mirantis.mk.Python() |
Ievgeniia Zadorozhna | 14c20f3 | 2017-08-31 13:35:57 +0300 | [diff] [blame] | 23 | |
chnyda | 625f4b4 | 2017-10-11 14:10:31 +0200 | [diff] [blame] | 24 | def pepperEnv = "pepperEnv" |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame^] | 25 | timeout(time: 12, unit: 'HOURS') { |
| 26 | node("python") { |
| 27 | try { |
Ievgeniia Zadorozhna | 14c20f3 | 2017-08-31 13:35:57 +0300 | [diff] [blame] | 28 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame^] | 29 | stage('Setup virtualenv for Pepper') { |
| 30 | python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS) |
| 31 | } |
Ievgeniia Zadorozhna | 14c20f3 | 2017-08-31 13:35:57 +0300 | [diff] [blame] | 32 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame^] | 33 | // |
| 34 | // Test |
| 35 | // |
Ievgeniia Zadorozhna | 14c20f3 | 2017-08-31 13:35:57 +0300 | [diff] [blame] | 36 | |
Jakub Josef | a63f986 | 2018-01-11 17:58:38 +0100 | [diff] [blame^] | 37 | stage('Run OpenStack Tempest tests') { |
| 38 | test.runTempestTests(pepperEnv, IMAGE_LINK, TEST_TARGET, TEST_TEMPEST_PATTERN, "/home/rally/rally_reports/", |
| 39 | "/home/rally/keystonercv3", SET, CONCURRENCY, "mcp.conf", "mcp_skip.list", "/root/keystonercv3", |
| 40 | "/root/rally_reports", DO_CLEANUP_RESOURCES) |
| 41 | } |
| 42 | stage('Copy test reports') { |
| 43 | test.copyTempestResults(pepperEnv, TEST_TARGET) |
| 44 | } |
| 45 | stage('Archiving test artifacts') { |
| 46 | test.archiveRallyArtifacts(pepperEnv, TEST_TARGET) |
| 47 | } |
| 48 | } catch (Throwable e) { |
| 49 | currentBuild.result = 'FAILURE' |
| 50 | throw e |
| 51 | } finally { |
| 52 | if (CLEANUP_REPORTS.toBoolean()) { |
| 53 | stage('Cleanup reports') { |
| 54 | test.removeReports(pepperEnv, TEST_TARGET, "rally_reports", 'rally_reports.tar') |
| 55 | } |
Ievgeniia Zadorozhna | 14c20f3 | 2017-08-31 13:35:57 +0300 | [diff] [blame] | 56 | } |
| 57 | } |
| 58 | } |
| 59 | } |