Skip to content

Commit af30a1a

Browse files
authored
Added nightly builds with full system tests to Jenkins (#182)
1 parent 80b05e3 commit af30a1a

File tree

3 files changed

+59
-6
lines changed

3 files changed

+59
-6
lines changed

Jenkinsfile

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ pipeline {
88
jdk 'jdk11'
99
}
1010

11+
triggers {
12+
// timer trigger for "nightly build" on master branch
13+
cron( env.BRANCH_NAME.equals('master') ? 'H H(0-3) * * 1-5' : '')
14+
}
15+
1116
environment {
1217
STAGING_DIR = "/scratch/artifacts/imagetool"
1318
}
@@ -28,6 +33,11 @@ pipeline {
2833
}
2934
}
3035
stage ('Test') {
36+
when {
37+
not {
38+
changelog '\\[skip-ci\\]'
39+
}
40+
}
3141
steps {
3242
sh 'mvn test'
3343
}
@@ -37,13 +47,36 @@ pipeline {
3747
}
3848
}
3949
}
40-
stage ('SystemTest') {
50+
stage ('SystemTest Gate') {
4151
when {
42-
changeRequest()
52+
allOf {
53+
changeRequest target: 'master'
54+
not {
55+
changelog '\\[skip-ci\\]'
56+
}
57+
}
58+
}
59+
steps {
60+
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'otn-cred', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
61+
sh 'mvn verify -Dtest.staging.dir=${STAGING_DIR} -Dtest.groups=gate'
62+
}
63+
}
64+
post {
65+
always {
66+
junit 'tests/target/failsafe-reports/*.xml'
67+
}
68+
}
69+
}
70+
stage ('SystemTest Full') {
71+
when {
72+
anyOf {
73+
triggeredBy 'TimerTrigger'
74+
tag "release-*"
75+
}
4376
}
4477
steps {
4578
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'otn-cred', passwordVariable: 'ORACLE_SUPPORT_PASSWORD', usernameVariable: 'ORACLE_SUPPORT_USERNAME']]) {
46-
sh 'mvn verify -Dtest.staging.dir=${STAGING_DIR}'
79+
sh 'mvn verify -Dtest.staging.dir=${STAGING_DIR} -Dtest.groups=gate,nightly'
4780
}
4881
}
4982
post {

pom.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3535
<maven.compiler.source>1.8</maven.compiler.source>
3636
<maven.compiler.target>1.8</maven.compiler.target>
37-
<test.groups>unit</test.groups>
37+
<test.groups>gate</test.groups>
3838
<aggregate.report.dir>tests/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
3939
</properties>
4040

@@ -124,6 +124,9 @@
124124
<groupId>org.apache.maven.plugins</groupId>
125125
<artifactId>maven-failsafe-plugin</artifactId>
126126
<version>2.22.2</version>
127+
<configuration>
128+
<groups>${test.groups}</groups>
129+
</configuration>
127130
</plugin>
128131
<plugin>
129132
<groupId>org.codehaus.mojo</groupId>
@@ -216,8 +219,8 @@
216219
<artifactId>maven-surefire-plugin</artifactId>
217220
<version>2.22.2</version>
218221
<configuration>
219-
<groups>${test.groups}</groups>
220-
<excludedGroups>slow,failing</excludedGroups>
222+
<groups>unit</groups>
223+
<excludedGroups>failing</excludedGroups>
221224
<environmentVariables>
222225
<TEST_ENV_PASSWORD>pass3</TEST_ENV_PASSWORD>
223226
</environmentVariables>

tests/src/test/java/com/oracle/weblogic/imagetool/tests/ITImagetool.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.junit.jupiter.api.BeforeAll;
1515
import org.junit.jupiter.api.MethodOrderer;
1616
import org.junit.jupiter.api.Order;
17+
import org.junit.jupiter.api.Tag;
1718
import org.junit.jupiter.api.Test;
1819
import org.junit.jupiter.api.TestMethodOrder;
1920

@@ -85,6 +86,7 @@ static void staticUnprepare() throws Exception {
8586
*/
8687
@Test
8788
@Order(1)
89+
@Tag("gate")
8890
void cacheListItems() throws Exception {
8991
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
9092
logTestBegin(testMethodName);
@@ -105,6 +107,7 @@ void cacheListItems() throws Exception {
105107
*/
106108
@Test
107109
@Order(2)
110+
@Tag("gate")
108111
void cacheAddInstallerJDK() throws Exception {
109112
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
110113
logTestBegin(testMethodName);
@@ -127,6 +130,7 @@ void cacheAddInstallerJDK() throws Exception {
127130
*/
128131
@Test
129132
@Order(3)
133+
@Tag("gate")
130134
void cacheAddInstallerWls() throws Exception {
131135
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
132136
logTestBegin(testMethodName);
@@ -149,6 +153,7 @@ void cacheAddInstallerWls() throws Exception {
149153
*/
150154
@Test
151155
@Order(4)
156+
@Tag("nightly")
152157
void createWlsImg() throws Exception {
153158
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
154159
logTestBegin(testMethodName);
@@ -172,6 +177,7 @@ void createWlsImg() throws Exception {
172177
*/
173178
@Test
174179
@Order(5)
180+
@Tag("gate")
175181
void cacheAddPatch() throws Exception {
176182
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
177183
logTestBegin(testMethodName);
@@ -195,6 +201,7 @@ void cacheAddPatch() throws Exception {
195201
*/
196202
@Test
197203
@Order(6)
204+
@Tag("gate")
198205
void cacheAddTestEntry() throws Exception {
199206
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
200207
logTestBegin(testMethodName);
@@ -217,6 +224,7 @@ void cacheAddTestEntry() throws Exception {
217224
*/
218225
@Test
219226
@Order(7)
227+
@Tag("gate")
220228
void cacheDeleteTestEntry() throws Exception {
221229
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
222230
logTestBegin(testMethodName);
@@ -240,6 +248,7 @@ void cacheDeleteTestEntry() throws Exception {
240248
*/
241249
@Test
242250
@Order(8)
251+
@Tag("gate")
243252
void createWLSImgUseCache() throws Exception {
244253
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
245254
logTestBegin(testMethodName);
@@ -271,6 +280,7 @@ void createWLSImgUseCache() throws Exception {
271280
*/
272281
@Test
273282
@Order(9)
283+
@Tag("gate")
274284
void updateWLSImg() throws Exception {
275285
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
276286
logTestBegin(testMethodName);
@@ -296,6 +306,7 @@ void updateWLSImg() throws Exception {
296306
*/
297307
@Test
298308
@Order(10)
309+
@Tag("gate")
299310
void createWlsImgUsingWdt() throws Exception {
300311

301312
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
@@ -360,6 +371,7 @@ void createWlsImgUsingWdt() throws Exception {
360371
*/
361372
@Test
362373
@Order(11)
374+
@Tag("nightly")
363375
void createFmwImgFullInternetAccess() throws Exception {
364376
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
365377
logTestBegin(testMethodName);
@@ -395,6 +407,7 @@ void createFmwImgFullInternetAccess() throws Exception {
395407
*/
396408
@Test
397409
@Order(12)
410+
@Tag("nightly")
398411
void createFmwImgNonDefault() throws Exception {
399412
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
400413
logTestBegin(testMethodName);
@@ -434,6 +447,7 @@ void createFmwImgNonDefault() throws Exception {
434447
*/
435448
@Test
436449
@Order(13)
450+
@Tag("nightly")
437451
void testDCreateJRFDomainImgUsingWDT() throws Exception {
438452
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
439453
logTestBegin(testMethodName);
@@ -499,6 +513,7 @@ void testDCreateJRFDomainImgUsingWDT() throws Exception {
499513
*/
500514
@Test
501515
@Order(14)
516+
@Tag("nightly")
502517
void createRestricedJrfDomainImgUsingWdt() throws Exception {
503518
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
504519
logTestBegin(testMethodName);
@@ -551,6 +566,7 @@ void createRestricedJrfDomainImgUsingWdt() throws Exception {
551566
*/
552567
@Test
553568
@Order(15)
569+
@Tag("nightly")
554570
void createWlsImgUsingMultiModels() throws Exception {
555571
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
556572
logTestBegin(testMethodName);
@@ -609,6 +625,7 @@ void createWlsImgUsingMultiModels() throws Exception {
609625
*/
610626
@Test
611627
@Order(16)
628+
@Tag("nightly")
612629
void createWLSImgWithAdditionalBuildCommands() throws Exception {
613630
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
614631
logTestBegin(testMethodName);

0 commit comments

Comments
 (0)