Skip to content

Commit d44885a

Browse files
committed
fix quicktest
1 parent 43657e7 commit d44885a

File tree

2 files changed

+72
-59
lines changed

2 files changed

+72
-59
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/ITServerDiscovery.java

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -81,40 +81,41 @@ public class ITServerDiscovery extends BaseTest {
8181
*/
8282
@BeforeClass
8383
public static void staticPrepare() throws Exception {
84-
Assume.assumeFalse(QUICKTEST);
85-
// initialize test properties and create the directories
86-
initialize(appPropsFile);
87-
88-
// create operator1
89-
if (operator == null) {
90-
logger.info("Creating Operator & waiting for the script to complete execution");
91-
operator = TestUtils.createOperator(operatorYmlFile);
84+
if (!QUICKTEST) {
85+
// initialize test properties and create the directories
86+
initialize(appPropsFile);
87+
88+
// create operator1
89+
if (operator == null) {
90+
logger.info("Creating Operator & waiting for the script to complete execution");
91+
operator = TestUtils.createOperator(operatorYmlFile);
92+
}
93+
94+
// create domain
95+
if (domain == null) {
96+
logger.info("Creating WLS Domain & waiting for the script to complete execution");
97+
domain = TestUtils.createDomain(domainonpvwlstFile);
98+
domain.verifyDomainCreated();
99+
}
100+
101+
domainYaml =
102+
BaseTest.getUserProjectsDir()
103+
+ "/weblogic-domains/"
104+
+ domain.getDomainUid()
105+
+ "/domain.yaml";
106+
107+
// create test domain yaml file
108+
testDomainYamlFile = BaseTest.getResultDir() + "/" + testYamlFileName;
109+
110+
Path sourceFile = Paths.get(domainYaml);
111+
Path targetFile = Paths.get(testDomainYamlFile);
112+
113+
Files.copy(sourceFile, targetFile, StandardCopyOption.REPLACE_EXISTING);
114+
115+
String content = new String(Files.readAllBytes(targetFile), StandardCharsets.UTF_8);
116+
content = content.replaceAll("replicas: 2", "replicas: 3");
117+
Files.write(targetFile, content.getBytes(StandardCharsets.UTF_8));
92118
}
93-
94-
// create domain
95-
if (domain == null) {
96-
logger.info("Creating WLS Domain & waiting for the script to complete execution");
97-
domain = TestUtils.createDomain(domainonpvwlstFile);
98-
domain.verifyDomainCreated();
99-
}
100-
101-
domainYaml =
102-
BaseTest.getUserProjectsDir()
103-
+ "/weblogic-domains/"
104-
+ domain.getDomainUid()
105-
+ "/domain.yaml";
106-
107-
// create test domain yaml file
108-
testDomainYamlFile = BaseTest.getResultDir() + "/" + testYamlFileName;
109-
110-
Path sourceFile = Paths.get(domainYaml);
111-
Path targetFile = Paths.get(testDomainYamlFile);
112-
113-
Files.copy(sourceFile, targetFile, StandardCopyOption.REPLACE_EXISTING);
114-
115-
String content = new String(Files.readAllBytes(targetFile), StandardCharsets.UTF_8);
116-
content = content.replaceAll("replicas: 2", "replicas: 3");
117-
Files.write(targetFile, content.getBytes(StandardCharsets.UTF_8));
118119
}
119120

120121
/**
@@ -124,14 +125,15 @@ public static void staticPrepare() throws Exception {
124125
*/
125126
@AfterClass
126127
public static void staticUnPrepare() throws Exception {
127-
Assume.assumeFalse(QUICKTEST);
128-
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
129-
logger.info("BEGIN");
130-
logger.info("Run once, release cluster lease");
128+
if (!QUICKTEST) {
129+
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
130+
logger.info("BEGIN");
131+
logger.info("Run once, release cluster lease");
131132

132-
tearDown();
133+
tearDown();
133134

134-
logger.info("SUCCESS");
135+
logger.info("SUCCESS");
136+
}
135137
}
136138

137139
/**
@@ -141,6 +143,7 @@ public static void staticUnPrepare() throws Exception {
141143
*/
142144
@Test
143145
public void testOPConnToNewMS() throws Exception {
146+
Assume.assumeFalse(QUICKTEST);
144147
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
145148
logTestBegin(testMethodName);
146149

@@ -166,6 +169,7 @@ public void testOPConnToNewMS() throws Exception {
166169
*/
167170
@Test
168171
public void testOPReconnToNewMS() throws Exception {
172+
Assume.assumeFalse(QUICKTEST);
169173
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
170174
logTestBegin(testMethodName);
171175

@@ -198,6 +202,7 @@ public void testOPReconnToNewMS() throws Exception {
198202
*/
199203
@Test
200204
public void testOPReconnToRunningMSAndScaleDown() throws Exception {
205+
Assume.assumeFalse(QUICKTEST);
201206
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
202207
logTestBegin(testMethodName);
203208

@@ -227,6 +232,7 @@ public void testOPReconnToRunningMSAndScaleDown() throws Exception {
227232
*/
228233
@Test
229234
public void testOPReconnToRunningMSAndScaleUp() throws Exception {
235+
Assume.assumeFalse(QUICKTEST);
230236
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
231237
logTestBegin(testMethodName);
232238

@@ -252,6 +258,7 @@ public void testOPReconnToRunningMSAndScaleUp() throws Exception {
252258
*/
253259
@Test
254260
public void testOPReconnToRunningMSWApp() throws Exception {
261+
Assume.assumeFalse(QUICKTEST);
255262
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
256263
logTestBegin(testMethodName);
257264

@@ -291,6 +298,7 @@ public void testOPReconnToRunningMSWApp() throws Exception {
291298
*/
292299
@Test
293300
public void testOPAdminReconnToDomain() throws Exception {
301+
Assume.assumeFalse(QUICKTEST);
294302
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
295303
logTestBegin(testMethodName);
296304

@@ -333,6 +341,7 @@ public void testOPAdminReconnToDomain() throws Exception {
333341
*/
334342
@Test
335343
public void testOPMSReconnToDomain() throws Exception {
344+
Assume.assumeFalse(QUICKTEST);
336345
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
337346
logTestBegin(testMethodName);
338347

@@ -375,6 +384,7 @@ public void testOPMSReconnToDomain() throws Exception {
375384
*/
376385
@Test
377386
public void testOPRestartDeadMS() throws Exception {
387+
Assume.assumeFalse(QUICKTEST);
378388
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
379389
logTestBegin(testMethodName);
380390

integration-tests/src/test/java/oracle/kubernetes/operator/ITUsabilityOperatorHelmChart.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ public class ITUsabilityOperatorHelmChart extends BaseTest {
3838
*/
3939
@BeforeClass
4040
public static void staticPrepare() throws Exception {
41-
Assume.assumeFalse(QUICKTEST);
42-
// initialize test properties and create the directories
43-
initialize(APP_PROPS_FILE);
41+
if (!QUICKTEST) {
42+
// initialize test properties and create the directories
43+
initialize(APP_PROPS_FILE);
44+
}
4445
}
4546

4647
/**
@@ -50,14 +51,15 @@ public static void staticPrepare() throws Exception {
5051
*/
5152
@AfterClass
5253
public static void staticUnPrepare() throws Exception {
53-
Assume.assumeFalse(QUICKTEST);
54-
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
55-
logger.info("BEGIN");
56-
logger.info("Run once, release cluster lease");
54+
if (!QUICKTEST) {
55+
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
56+
logger.info("BEGIN");
57+
logger.info("Run once, release cluster lease");
5758

58-
tearDown();
59+
tearDown();
5960

60-
logger.info("SUCCESS");
61+
logger.info("SUCCESS");
62+
}
6163
}
6264

6365
/**
@@ -67,6 +69,7 @@ public static void staticUnPrepare() throws Exception {
6769
*/
6870
@Test
6971
public void testOperatorCreateDeleteCreate() throws Exception {
72+
Assume.assumeFalse(QUICKTEST);
7073
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
7174
logTestBegin(testMethodName);
7275
Operator firstoperator = null;
@@ -119,7 +122,7 @@ public void testOperatorCreateDeleteCreate() throws Exception {
119122
*/
120123
@Test
121124
public void testCreateSecondOperatorUsingSameOperatorNSNegativeInstall() throws Exception {
122-
125+
Assume.assumeFalse(QUICKTEST);
123126
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
124127
logTestBegin(testMethodName);
125128
Operator firstoperator = null;
@@ -176,7 +179,7 @@ public void testCreateSecondOperatorUsingSameOperatorNSNegativeInstall() throws
176179
*/
177180
@Test
178181
public void testNotPreCreatedOpNSCreateOperatorNegativeInstall() throws Exception {
179-
182+
Assume.assumeFalse(QUICKTEST);
180183
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
181184
logTestBegin(testMethodName);
182185
Operator operator = null;
@@ -212,7 +215,7 @@ public void testNotPreCreatedOpNSCreateOperatorNegativeInstall() throws Exceptio
212215
*/
213216
@Test
214217
public void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() throws Exception {
215-
218+
Assume.assumeFalse(QUICKTEST);
216219
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
217220
logTestBegin(testMethodName);
218221
Operator operator = null;
@@ -269,7 +272,7 @@ public void testNotPreexistedOpServiceAccountCreateOperatorNegativeInstall() thr
269272
*/
270273
@Test
271274
public void testSecondOpSharingSameTargetDomainsNSNegativeInstall() throws Exception {
272-
275+
Assume.assumeFalse(QUICKTEST);
273276
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
274277
logTestBegin(testMethodName);
275278
Operator secondoperator = null;
@@ -329,7 +332,7 @@ public void testSecondOpSharingSameTargetDomainsNSNegativeInstall() throws Excep
329332
*/
330333
@Test
331334
public void testTargetNSIsNotPreexistedNegativeInstall() throws Exception {
332-
335+
Assume.assumeFalse(QUICKTEST);
333336
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
334337
logTestBegin(testMethodName);
335338
Operator operator = null;
@@ -379,7 +382,7 @@ public void testTargetNSIsNotPreexistedNegativeInstall() throws Exception {
379382
*/
380383
@Test
381384
public void testSecondOpSharingSameExternalRestPortNegativeInstall() throws Exception {
382-
385+
Assume.assumeFalse(QUICKTEST);
383386
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
384387
logTestBegin(testMethodName);
385388
Operator operator1 = null;
@@ -439,7 +442,7 @@ public void testSecondOpSharingSameExternalRestPortNegativeInstall() throws Exce
439442
*/
440443
@Test
441444
public void testCreateWithUpperCaseTargetDomainNegativeInstall() throws Exception {
442-
445+
Assume.assumeFalse(QUICKTEST);
443446
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
444447
logTestBegin(testMethodName);
445448
Operator operator = null;
@@ -485,7 +488,7 @@ public void testCreateWithUpperCaseTargetDomainNegativeInstall() throws Exceptio
485488
*/
486489
@Test
487490
public void testCreateChartWithInvalidAttributesNegativeInstall() throws Exception {
488-
491+
Assume.assumeFalse(QUICKTEST);
489492
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
490493
logTestBegin(testMethodName);
491494
Operator operator = null;
@@ -536,7 +539,7 @@ public void testCreateChartWithInvalidAttributesNegativeInstall() throws Excepti
536539
*/
537540
@Test
538541
public void testCreateWithEmptyTargetDomainInstall() throws Exception {
539-
542+
Assume.assumeFalse(QUICKTEST);
540543
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
541544
logTestBegin(testMethodName);
542545
Operator operator = null;
@@ -558,7 +561,7 @@ public void testCreateWithEmptyTargetDomainInstall() throws Exception {
558561
}
559562

560563
private void upgradeOperator(Operator operator, String upgradeSet) throws Exception {
561-
564+
Assume.assumeFalse(QUICKTEST);
562565
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
563566
logTestBegin(testMethodName);
564567
operator.callHelmUpgrade(upgradeSet);
@@ -572,7 +575,7 @@ private void upgradeOperator(Operator operator, String upgradeSet) throws Except
572575
*/
573576
@Test
574577
public void testCreateWithDefaultTargetDomainInstall() throws Exception {
575-
578+
Assume.assumeFalse(QUICKTEST);
576579
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
577580
logTestBegin(testMethodName);
578581
Operator operator = null;

0 commit comments

Comments
 (0)