Skip to content

Commit 2ed4e27

Browse files
authored
Merge pull request #546 from oracle/feature/custom-sit-config
Custom sit config
2 parents 38be9b4 + 2ed2b74 commit 2ed4e27

File tree

8 files changed

+369
-100
lines changed

8 files changed

+369
-100
lines changed

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

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ public class ITOperator extends BaseTest {
5454
private static Operator operatorForDel1;
5555
private static Operator operatorForDel2;
5656

57+
private static boolean QUICKTEST;
58+
private static boolean SMOKETEST;
59+
60+
// Set QUICKTEST env var to true to run a small subset of tests.
61+
// Set SMOKETEST env var to true to run an even smaller subset
62+
// of tests, plus leave domain1 up and running when the test completes.
63+
static {
64+
QUICKTEST =
65+
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true");
66+
SMOKETEST =
67+
System.getenv("SMOKETEST") != null && System.getenv("SMOKETEST").equalsIgnoreCase("true");
68+
if (SMOKETEST) QUICKTEST = true;
69+
}
70+
5771
/**
5872
* This method gets called only once before any of the test methods are executed. It does the
5973
* initialization of the integration test properties defined in OperatorIT.properties and setting
@@ -103,16 +117,15 @@ public void test1CreateFirstOperatorAndDomain() throws Exception {
103117
logTestBegin("test1CreateFirstOperatorAndDomain");
104118
testCreateOperatorManagingDefaultAndTest1NS();
105119
Domain domain1 = testAllUseCasesForADomain(operator1, domain1YamlFile);
106-
domain1.testWlsLivenessProbe();
107-
domain1.shutdownUsingServerStartPolicy();
120+
if (!SMOKETEST) domain1.testWlsLivenessProbe();
121+
if (!SMOKETEST) domain1.shutdownUsingServerStartPolicy();
108122

109123
logger.info("SUCCESS - test1CreateFirstOperatorAndDomain");
110124
}
111125

112126
@Test
113127
public void test2CreateAnotherDomainInDefaultNS() throws Exception {
114-
Assume.assumeFalse(
115-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
128+
Assume.assumeFalse(QUICKTEST);
116129

117130
logTestBegin("test2CreateAnotherDomainInDefaultNS");
118131
logger.info("Creating Domain domain2 & verifing the domain creation");
@@ -129,8 +142,7 @@ public void test2CreateAnotherDomainInDefaultNS() throws Exception {
129142

130143
@Test
131144
public void test3CreateDomainInTest1NS() throws Exception {
132-
Assume.assumeFalse(
133-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
145+
Assume.assumeFalse(QUICKTEST);
134146

135147
logTestBegin("test3CreateDomainInTest1NS");
136148
logger.info("Creating Domain domain3 & verifing the domain creation");
@@ -146,8 +158,7 @@ public void test3CreateDomainInTest1NS() throws Exception {
146158

147159
@Test
148160
public void test4CreateAnotherOperatorManagingTest2NS() throws Exception {
149-
Assume.assumeFalse(
150-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
161+
Assume.assumeFalse(QUICKTEST);
151162

152163
logTestBegin("test4CreateAnotherOperatorManagingTest2NS");
153164
logger.info("Creating Operator & waiting for the script to complete execution");
@@ -158,8 +169,7 @@ public void test4CreateAnotherOperatorManagingTest2NS() throws Exception {
158169

159170
@Test
160171
public void test5CreateConfiguredDomainInTest2NS() throws Exception {
161-
Assume.assumeFalse(
162-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
172+
Assume.assumeFalse(QUICKTEST);
163173

164174
logTestBegin("test5CreateConfiguredDomainInTest2NS");
165175
logger.info("Creating Domain domain4 & verifing the domain creation");
@@ -198,8 +208,7 @@ public void test5CreateConfiguredDomainInTest2NS() throws Exception {
198208

199209
@Test
200210
public void test6CreateDomainWithStartPolicyAdminOnly() throws Exception {
201-
Assume.assumeFalse(
202-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
211+
Assume.assumeFalse(QUICKTEST);
203212

204213
logTestBegin("test6CreateDomainWithStartPolicyAdminOnly");
205214
logger.info("Checking if operator1 is running, if not creating");
@@ -215,8 +224,7 @@ public void test6CreateDomainWithStartPolicyAdminOnly() throws Exception {
215224

216225
@Test
217226
public void test7CreateDomainPVReclaimPolicyRecycle() throws Exception {
218-
Assume.assumeFalse(
219-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
227+
Assume.assumeFalse(QUICKTEST);
220228

221229
logTestBegin("test7CreateDomainPVReclaimPolicyRecycle");
222230
logger.info("Checking if operator1 is running, if not creating");
@@ -233,8 +241,7 @@ public void test7CreateDomainPVReclaimPolicyRecycle() throws Exception {
233241

234242
@Test
235243
public void test8CreateDomainOnExistingDir() throws Exception {
236-
Assume.assumeFalse(
237-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
244+
Assume.assumeFalse(QUICKTEST);
238245

239246
logTestBegin("test8CreateDomainOnExistingDir");
240247
if (operator1 == null) {
@@ -251,8 +258,8 @@ public void test8CreateDomainOnExistingDir() throws Exception {
251258

252259
// @Test
253260
public void testACreateDomainApacheLB() throws Exception {
254-
Assume.assumeFalse(
255-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
261+
Assume.assumeFalse(QUICKTEST);
262+
256263
logTestBegin("testACreateDomainApacheLB");
257264
logger.info("Creating Domain domain9 & verifing the domain creation");
258265
if (operator1 == null) {
@@ -268,8 +275,8 @@ public void testACreateDomainApacheLB() throws Exception {
268275

269276
@Test
270277
public void testBCreateDomainWithDefaultValuesInSampleInputs() throws Exception {
271-
Assume.assumeFalse(
272-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
278+
Assume.assumeFalse(QUICKTEST);
279+
273280
logTestBegin("testBCreateDomainWithDefaultValuesInSampleInputs");
274281
logger.info("Creating Domain domain10 & verifing the domain creation");
275282
if (operator1 == null) {
@@ -284,8 +291,7 @@ public void testBCreateDomainWithDefaultValuesInSampleInputs() throws Exception
284291

285292
@Test
286293
public void testDeleteOneDomain() throws Exception {
287-
Assume.assumeFalse(
288-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
294+
Assume.assumeFalse(QUICKTEST);
289295
logTestBegin("Deleting one domain.");
290296

291297
if (operatorForDel1 == null) {
@@ -303,8 +309,7 @@ public void testDeleteOneDomain() throws Exception {
303309

304310
@Test
305311
public void testDeleteTwoDomains() throws Exception {
306-
Assume.assumeFalse(
307-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
312+
Assume.assumeFalse(QUICKTEST);
308313
logTestBegin("Deleting two domains.");
309314

310315
if (operatorForDel2 == null) {
@@ -337,9 +342,11 @@ private Domain testAllUseCasesForADomain(Operator operator, String domainYamlFil
337342
logger.info("Creating Domain & verifing the domain creation");
338343
// create domain1
339344
Domain domain = testDomainCreation(domainYamlFile);
340-
testClusterScaling(operator, domain);
341-
testDomainLifecyle(operator, domain);
342-
testOperatorLifecycle(operator, domain);
345+
if (!SMOKETEST) {
346+
testClusterScaling(operator, domain);
347+
testDomainLifecyle(operator, domain);
348+
testOperatorLifecycle(operator, domain);
349+
}
343350
return domain;
344351
}
345352

operator/src/main/java/oracle/kubernetes/operator/helpers/JobHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ List<V1EnvVar> getEnvironmentVariables(TuningParameters tuningParameters) {
7575
addEnvVar(envVarList, "LOG_HOME", getEffectiveLogHome());
7676
addEnvVar(envVarList, "INTROSPECT_HOME", getIntrospectHome());
7777
addEnvVar(envVarList, "SERVER_OUT_IN_POD_LOG", getIncludeServerOutInPodLog());
78+
addEnvVar(envVarList, "ADMIN_SECRET_NAME", getAdminSecretName());
7879

7980
return envVarList;
8081
}

operator/src/main/java/oracle/kubernetes/operator/helpers/JobStepContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private String getDomainResourceName() {
6363

6464
abstract String getJobName();
6565

66-
private String getAdminSecretName() {
66+
String getAdminSecretName() {
6767
return getDomain().getAdminSecret().getName();
6868
}
6969

0 commit comments

Comments
 (0)