File tree 2 files changed +17
-9
lines changed
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def call(body) {
63
63
64
64
stage(' Integration Testing' ) {
65
65
mavenIntegrationTest {
66
- integrationTestCmd = config. integrationTestCmd
66
+ cmd = config. integrationTestCmd
67
67
environment = ' Test'
68
68
failIfNoTests = false
69
69
itestPattern = ' *IT'
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/groovy
2
+
2
3
import io.fabric8.Utils
3
4
4
5
def call (body ) {
5
- def utils = new Utils ()
6
6
7
- if (utils . isDisabledITests()) {
7
+ if (new Utils () . isDisabledITests()) {
8
8
echo " WARNING: Integration tests DISABLED for these pipelines!"
9
9
return
10
10
}
@@ -15,10 +15,18 @@ def call(body) {
15
15
body. delegate = config
16
16
body()
17
17
18
+ def cmd = config. cmd ?: defaultTestCommand(config)
19
+ sh cmd
20
+ junitResults(body);
21
+ }
22
+
23
+ def defaultTestCommand (config ) {
24
+ def utils = new Utils ()
25
+
18
26
def envName = config. environment
19
27
def kubeNS = " -Dfabric8.environment=${ envName} "
20
28
21
- if (envName && ! config . integrationTestCmd ) {
29
+ if (envName) {
22
30
try {
23
31
def ns = utils. environmentNamespace(envName)
24
32
if (ns) {
@@ -27,12 +35,12 @@ def call(body) {
27
35
}
28
36
} catch (e) {
29
37
echo " ERROR: failed to find the environment namespace for ${ envName} due to ${ e} "
30
- e. printStackTrace()
31
38
}
32
39
}
33
40
34
- def testCmd = config. integrationTestCmd ?: " mvn org.apache.maven.plugins:maven-failsafe-plugin:integration-test -P openshift-it ${ kubeNS} -Dit.test=${ config.itestPattern} -DfailIfNoTests=${ config.failIfNoTests} org.apache.maven.plugins:maven-failsafe-plugin:verify"
35
- sh testCmd
36
- junitResults(body);
37
-
41
+ return " mvn \
42
+ org.apache.maven.plugins:maven-failsafe-plugin:integration-test \
43
+ org.apache.maven.plugins:maven-failsafe-plugin:verify \
44
+ -P openshift-it ${ kubeNS} \
45
+ -Dit.test=${ config.itestPattern} -DfailIfNoTests=${ config.failIfNoTests} "
38
46
}
You can’t perform that action at this time.
0 commit comments