blob: 1f8a09bd4e7d1cfef22157e06f6b85cf3a99a43c [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"
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030025
26node("python") {
27 try {
28
chnyda625f4b42017-10-11 14:10:31 +020029 stage('Setup virtualenv for Pepper') {
Dmitrii Kabanovf31c8962017-10-12 21:00:30 -070030 python.setupPepperVirtualenv(pepperEnv, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030031 }
32
33 //
34 // Test
35 //
36
37 stage('Run OpenStack Tempest tests') {
chnyda625f4b42017-10-11 14:10:31 +020038 test.runTempestTests(pepperEnv, IMAGE_LINK, TEST_TARGET, TEST_TEMPEST_PATTERN, "/home/rally/rally_reports/",
Ievgeniia Zadorozhna0d09cf42017-10-31 16:30:38 +030039 "/home/rally/keystonercv3", SET, CONCURRENCY, "mcp.conf", "mcp_skip.list", "/root/keystonercv3",
40 "/root/rally_reports", DO_CLEANUP_RESOURCES)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030041 }
42 stage('Copy test reports') {
chnyda625f4b42017-10-11 14:10:31 +020043 test.copyTempestResults(pepperEnv, TEST_TARGET)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030044 }
45 stage('Archiving test artifacts') {
chnyda625f4b42017-10-11 14:10:31 +020046 test.archiveRallyArtifacts(pepperEnv, TEST_TARGET)
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030047 }
48 } catch (Throwable e) {
49 currentBuild.result = 'FAILURE'
50 throw e
51 } finally {
Ievgeniia Zadorozhna0d09cf42017-10-31 16:30:38 +030052 if (CLEANUP_REPORTS.toBoolean()) {
53 stage('Cleanup reports') {
chnyda625f4b42017-10-11 14:10:31 +020054 test.removeReports(pepperEnv, TEST_TARGET, "rally_reports", 'rally_reports.tar')
Ievgeniia Zadorozhna14c20f32017-08-31 13:35:57 +030055 }
56 }
57 }
58}