Skip to content

Commit 0437130

Browse files
author
Sankar Periyathambi Neelakandan
committed
make it run in full test and shared cluster
1 parent c4a45f1 commit 0437130

File tree

2 files changed

+38
-58
lines changed

2 files changed

+38
-58
lines changed

integration-tests/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<properties>
3030
<src-integration-test>${project.basedir}/src/test/java</src-integration-test>
3131
<resource-integration-test>${project.basedir}/src/test/resources</resource-integration-test>
32+
<maven.compiler.source>1.8</maven.compiler.source>
33+
<maven.compiler.target>1.8</maven.compiler.target>
3234
</properties>
3335

3436
<dependencies>
@@ -44,8 +46,9 @@
4446
<dependency>
4547
<groupId>junit</groupId>
4648
<artifactId>junit</artifactId>
47-
<version>${junit-version}</version>
49+
<version>4.11</version>
4850
<scope>test</scope>
51+
<type>jar</type>
4952
</dependency>
5053
<dependency>
5154
<groupId>org.glassfish.jersey.core</groupId>

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

Lines changed: 34 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -73,31 +73,29 @@ public class ITMonitoringExporter extends BaseTest {
7373
*/
7474
@BeforeClass
7575
public static void staticPrepare() throws Exception {
76-
if (!BaseTest.SHARED_CLUSTER) {
77-
if (!QUICKTEST) {
78-
initialize(APP_PROPS_FILE);
79-
logger.info("Checking if operator and domain are running, if not creating");
80-
if (operator == null) {
81-
Map<String, Object> operatorMap = TestUtils.createOperatorMap(number, true);
82-
operator = new Operator(operatorMap, Operator.RESTCertType.SELF_SIGNED);
83-
Assert.assertNotNull(operator);
84-
operator.callHelmInstall();
85-
}
86-
if (domain == null) {
87-
domain = createVerifyDomain(number, operator);
88-
Assert.assertNotNull(domain);
89-
}
90-
myhost = domain.getHostNameForCurl();
91-
exporterUrl = "http://" + myhost + ":" + domain.getLoadBalancerWebPort() + "/wls-exporter/";
92-
metricsUrl = exporterUrl + "metrics";
93-
monitoringExporterDir = BaseTest.getResultDir() + "/monitoring";
94-
resourceExporterDir =
95-
BaseTest.getProjectRoot() + "/integration-tests/src/test/resources/exporter";
96-
configPath = resourceExporterDir;
97-
upgradeTraefikHostName();
98-
deployRunMonitoringExporter(domain, operator);
99-
buildDeployWebServiceApp(domain, TESTWSAPP, TESTWSSERVICE);
76+
if (!QUICKTEST) {
77+
initialize(APP_PROPS_FILE);
78+
logger.info("Checking if operator and domain are running, if not creating");
79+
if (operator == null) {
80+
Map<String, Object> operatorMap = TestUtils.createOperatorMap(number, true);
81+
operator = new Operator(operatorMap, Operator.RESTCertType.SELF_SIGNED);
82+
Assert.assertNotNull(operator);
83+
operator.callHelmInstall();
84+
}
85+
if (domain == null) {
86+
domain = createVerifyDomain(number, operator);
87+
Assert.assertNotNull(domain);
10088
}
89+
myhost = domain.getHostNameForCurl();
90+
exporterUrl = "http://" + myhost + ":" + domain.getLoadBalancerWebPort() + "/wls-exporter/";
91+
metricsUrl = exporterUrl + "metrics";
92+
monitoringExporterDir = BaseTest.getResultDir() + "/monitoring";
93+
resourceExporterDir =
94+
BaseTest.getProjectRoot() + "/integration-tests/src/test/resources/exporter";
95+
configPath = resourceExporterDir;
96+
upgradeTraefikHostName();
97+
deployRunMonitoringExporter(domain, operator);
98+
buildDeployWebServiceApp(domain, TESTWSAPP, TESTWSSERVICE);
10199
}
102100
}
103101

@@ -108,21 +106,19 @@ public static void staticPrepare() throws Exception {
108106
*/
109107
@AfterClass
110108
public static void staticUnPrepare() throws Exception {
111-
if (!BaseTest.SHARED_CLUSTER) {
112-
if (!QUICKTEST) {
113-
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
114-
logger.info("BEGIN");
115-
logger.info("Run once, release cluster lease");
116-
if (domain != null) {
117-
domain.destroy();
118-
}
119-
if (operator != null) {
120-
operator.destroy();
121-
}
122-
deletePrometheusGrafana();
123-
tearDown(new Object() {}.getClass().getEnclosingClass().getSimpleName());
124-
logger.info("SUCCESS");
109+
if (!QUICKTEST) {
110+
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
111+
logger.info("BEGIN");
112+
logger.info("Run once, release cluster lease");
113+
if (domain != null) {
114+
domain.destroy();
115+
}
116+
if (operator != null) {
117+
operator.destroy();
125118
}
119+
deletePrometheusGrafana();
120+
tearDown(new Object() {}.getClass().getEnclosingClass().getSimpleName());
121+
logger.info("SUCCESS");
126122
}
127123
}
128124

@@ -133,7 +129,6 @@ public static void staticUnPrepare() throws Exception {
133129
*/
134130
@Test
135131
public void test01_CheckMetricsViaPrometheus() throws Exception {
136-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
137132
Assume.assumeFalse(QUICKTEST);
138133
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
139134
logTestBegin(testMethodName);
@@ -150,7 +145,6 @@ public void test01_CheckMetricsViaPrometheus() throws Exception {
150145
*/
151146
@Test
152147
public void test02_ReplaceConfiguration() throws Exception {
153-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
154148
Assume.assumeFalse(QUICKTEST);
155149
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
156150
logTestBegin(testMethodName);
@@ -199,7 +193,6 @@ public void test02_ReplaceConfiguration() throws Exception {
199193
*/
200194
@Test
201195
public void test03_AppendConfiguration() throws Exception {
202-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
203196
Assume.assumeFalse(QUICKTEST);
204197
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
205198
logTestBegin(testMethodName);
@@ -235,7 +228,6 @@ public void test03_AppendConfiguration() throws Exception {
235228
*/
236229
@Test
237230
public void test04_ReplaceOneAttributeValueAsArrayConfiguration() throws Exception {
238-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
239231
Assume.assumeFalse(QUICKTEST);
240232
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
241233
logTestBegin(testMethodName);
@@ -260,7 +252,6 @@ public void test04_ReplaceOneAttributeValueAsArrayConfiguration() throws Excepti
260252
@Test
261253
public void test05_AppendArrayWithOneExistedAndOneDifferentAttributeValueAsArrayConfiguration()
262254
throws Exception {
263-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
264255
Assume.assumeFalse(QUICKTEST);
265256
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
266257
logTestBegin(testMethodName);
@@ -282,7 +273,6 @@ public void test05_AppendArrayWithOneExistedAndOneDifferentAttributeValueAsArray
282273
*/
283274
@Test
284275
public void test06_ReplaceWithEmptyConfiguration() throws Exception {
285-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
286276
Assume.assumeFalse(QUICKTEST);
287277
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
288278
logTestBegin(testMethodName);
@@ -301,7 +291,6 @@ public void test06_ReplaceWithEmptyConfiguration() throws Exception {
301291
*/
302292
@Test
303293
public void test07_AppendWithEmptyConfiguration() throws Exception {
304-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
305294
Assume.assumeFalse(QUICKTEST);
306295
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
307296
logTestBegin(testMethodName);
@@ -323,7 +312,6 @@ public void test07_AppendWithEmptyConfiguration() throws Exception {
323312
*/
324313
@Test
325314
public void test08_1AppendWithNotYmlConfiguration() throws Exception {
326-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
327315
Assume.assumeFalse(QUICKTEST);
328316
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
329317
logTestBegin(testMethodName);
@@ -342,7 +330,6 @@ public void test08_1AppendWithNotYmlConfiguration() throws Exception {
342330
*/
343331
@Test
344332
public void test08_2ReplaceWithNotYmlConfiguration() throws Exception {
345-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
346333
Assume.assumeFalse(QUICKTEST);
347334
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
348335
logTestBegin(testMethodName);
@@ -359,7 +346,6 @@ public void test08_2ReplaceWithNotYmlConfiguration() throws Exception {
359346
* @throws Exception
360347
*/
361348
public void test09_AppendWithCorruptedYmlConfiguration() throws Exception {
362-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
363349
Assume.assumeFalse(QUICKTEST);
364350
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
365351
logTestBegin(testMethodName);
@@ -380,7 +366,6 @@ public void test09_AppendWithCorruptedYmlConfiguration() throws Exception {
380366
*/
381367
@Test
382368
public void test10_ReplaceWithCorruptedYmlConfiguration() throws Exception {
383-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
384369
Assume.assumeFalse(QUICKTEST);
385370
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
386371
logTestBegin(testMethodName);
@@ -401,7 +386,6 @@ public void test10_ReplaceWithCorruptedYmlConfiguration() throws Exception {
401386
*/
402387
@Test
403388
public void test11_ReplaceWithDublicatedValuesConfiguration() throws Exception {
404-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
405389
Assume.assumeFalse(QUICKTEST);
406390
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
407391
logTestBegin(testMethodName);
@@ -422,7 +406,6 @@ public void test11_ReplaceWithDublicatedValuesConfiguration() throws Exception {
422406
*/
423407
@Test
424408
public void test12_AppendWithDublicatedValuesConfiguration() throws Exception {
425-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
426409
Assume.assumeFalse(QUICKTEST);
427410
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
428411
logTestBegin(testMethodName);
@@ -444,7 +427,6 @@ public void test12_AppendWithDublicatedValuesConfiguration() throws Exception {
444427
*/
445428
@Test
446429
public void test13_ReplaceMetricsNameSnakeCaseFalseConfiguration() throws Exception {
447-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
448430
Assume.assumeFalse(QUICKTEST);
449431
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
450432
logTestBegin(testMethodName);
@@ -471,7 +453,6 @@ public void test13_ReplaceMetricsNameSnakeCaseFalseConfiguration() throws Except
471453
// verify that change configuration fails without authentication
472454
@Test
473455
public void test14_ChangeConfigNoCredentials() throws Exception {
474-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
475456
Assume.assumeFalse(QUICKTEST);
476457
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
477458
logTestBegin(testMethodName);
@@ -497,7 +478,6 @@ public void test14_ChangeConfigNoCredentials() throws Exception {
497478
*/
498479
@Test
499480
public void test15_ChangeConfigInvalidUser() throws Exception {
500-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
501481
Assume.assumeFalse(QUICKTEST);
502482
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
503483
logTestBegin(testMethodName);
@@ -519,7 +499,6 @@ public void test15_ChangeConfigInvalidUser() throws Exception {
519499
*/
520500
@Test
521501
public void test16_ChangeConfigInvalidPass() throws Exception {
522-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
523502
Assume.assumeFalse(QUICKTEST);
524503
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
525504
logTestBegin(testMethodName);
@@ -539,7 +518,6 @@ public void test16_ChangeConfigInvalidPass() throws Exception {
539518
*/
540519
@Test
541520
public void test17_ChangeConfigEmptyUser() throws Exception {
542-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
543521
Assume.assumeFalse(QUICKTEST);
544522
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
545523
logTestBegin(testMethodName);
@@ -561,7 +539,6 @@ public void test17_ChangeConfigEmptyUser() throws Exception {
561539
*/
562540
@Test
563541
public void test18_ChangeConfigEmptyPass() throws Exception {
564-
Assume.assumeFalse(BaseTest.SHARED_CLUSTER);
565542
Assume.assumeFalse(QUICKTEST);
566543
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
567544
logTestBegin(testMethodName);

0 commit comments

Comments
 (0)