blob: 6edb276fc0a62a9e840c36b47bb84d9e6c45c85e [file] [log] [blame]
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +03001/**
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 Zadorozhna0d09cf42017-10-31 16:30:38 +030012 * 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 Zadorozhna14c20f32017-08-31 13:35:57 +030015 * DO_CLEANUP_RESOURCES If "true": runs clean-up script for removing Rally and Tempest resources
16 */
17
18
19common = new com.mirantis.mk.Common()
20salt = new com.mirantis.mk.Salt()
21test = new com.mirantis.mk.Test()
chnyda625f4b42017-10-11 14:10:31 +020022def python = new com.mirantis.mk.Python()
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030023
chnyda625f4b42017-10-11 14:10:31 +020024def pepperEnv = "pepperEnv"
Jakub Josefa63f9862018-01-11 17:58:38 +010025timeout(time: 12, unit: 'HOURS') {
26 node("python") {
27 try {
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030028
Jakub Josefa63f9862018-01-11 17:58:38 +010029 stage('Setup virtualenv for Pepper') {
30 python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
31 }
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030032
Jakub Josefa63f9862018-01-11 17:58:38 +010033 //
34 // Test
35 //
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030036
Jakub Josefa63f9862018-01-11 17:58:38 +010037 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 Zadorozhna14c20f32017-08-31 13:35:57 +030056 }
57 }
58 }
59}