Skip to content

Commit 53f759f

Browse files
author
Tom Barnes
committed
Initial version of introspector custom sit-cfg handling.
1 parent 0c5f6ed commit 53f759f

File tree

7 files changed

+297
-85
lines changed

7 files changed

+297
-85
lines changed

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

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ public class ITOperator extends BaseTest {
4545
private static Operator operator1, operator2;
4646
private static Domain domain1;
4747

48+
private static boolean QUICKTEST;
49+
private static boolean SMOKETEST;
50+
51+
// Set QUICKTEST env var to true to run a small subset of tests.
52+
// Set SMOKETEST env var to true to run an even smaller subset
53+
// of tests, plus leave domain1 up and running when the test completes.
54+
static {
55+
QUICKTEST =
56+
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true");
57+
SMOKETEST =
58+
System.getenv("SMOKETEST") != null && System.getenv("SMOKETEST").equalsIgnoreCase("true");
59+
if (SMOKETEST) QUICKTEST = true;
60+
}
61+
4862
/**
4963
* This method gets called only once before any of the test methods are executed. It does the
5064
* initialization of the integration test properties defined in OperatorIT.properties and setting
@@ -94,16 +108,15 @@ public void test1CreateFirstOperatorAndDomain() throws Exception {
94108
logTestBegin("test1CreateFirstOperatorAndDomain");
95109
testCreateOperatorManagingDefaultAndTest1NS();
96110
domain1 = testAllUseCasesForADomain(operator1, domain1YamlFile);
97-
domain1.testWlsLivenessProbe();
98-
domain1.destroy();
111+
if (!SMOKETEST) domain1.testWlsLivenessProbe();
112+
if (!SMOKETEST) domain1.destroy();
99113

100114
logger.info("SUCCESS - test1CreateFirstOperatorAndDomain");
101115
}
102116

103117
@Test
104118
public void test2CreateAnotherDomainInDefaultNS() throws Exception {
105-
Assume.assumeFalse(
106-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
119+
Assume.assumeFalse(QUICKTEST);
107120

108121
logTestBegin("test2CreateAnotherDomainInDefaultNS");
109122
logger.info("Creating Domain domain2 & verifing the domain creation");
@@ -120,8 +133,7 @@ public void test2CreateAnotherDomainInDefaultNS() throws Exception {
120133

121134
@Test
122135
public void test3CreateDomainInTest1NS() throws Exception {
123-
Assume.assumeFalse(
124-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
136+
Assume.assumeFalse(QUICKTEST);
125137

126138
logTestBegin("test3CreateDomainInTest1NS");
127139
logger.info("Creating Domain domain3 & verifing the domain creation");
@@ -137,8 +149,7 @@ public void test3CreateDomainInTest1NS() throws Exception {
137149

138150
@Test
139151
public void test4CreateAnotherOperatorManagingTest2NS() throws Exception {
140-
Assume.assumeFalse(
141-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
152+
Assume.assumeFalse(QUICKTEST);
142153

143154
logTestBegin("test4CreateAnotherOperatorManagingTest2NS");
144155
logger.info("Creating Operator & waiting for the script to complete execution");
@@ -149,8 +160,7 @@ public void test4CreateAnotherOperatorManagingTest2NS() throws Exception {
149160

150161
@Test
151162
public void test5CreateConfiguredDomainInTest2NS() throws Exception {
152-
Assume.assumeFalse(
153-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
163+
Assume.assumeFalse(QUICKTEST);
154164

155165
logTestBegin("test5CreateConfiguredDomainInTest2NS");
156166
logger.info("Creating Domain domain4 & verifing the domain creation");
@@ -192,8 +202,7 @@ public void test5CreateConfiguredDomainInTest2NS() throws Exception {
192202

193203
@Test
194204
public void test6CreateDomainWithStartPolicyAdminOnly() throws Exception {
195-
Assume.assumeFalse(
196-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
205+
Assume.assumeFalse(QUICKTEST);
197206

198207
logTestBegin("test6CreateDomainWithStartPolicyAdminOnly");
199208
logger.info("Checking if operator1 is running, if not creating");
@@ -209,8 +218,7 @@ public void test6CreateDomainWithStartPolicyAdminOnly() throws Exception {
209218

210219
@Test
211220
public void test7CreateDomainPVReclaimPolicyRecycle() throws Exception {
212-
Assume.assumeFalse(
213-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
221+
Assume.assumeFalse(QUICKTEST);
214222

215223
logTestBegin("test7CreateDomainPVReclaimPolicyRecycle");
216224
logger.info("Checking if operator1 is running, if not creating");
@@ -227,8 +235,7 @@ public void test7CreateDomainPVReclaimPolicyRecycle() throws Exception {
227235

228236
@Test
229237
public void test9CreateDomainOnExistingDir() throws Exception {
230-
Assume.assumeFalse(
231-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
238+
Assume.assumeFalse(QUICKTEST);
232239

233240
logTestBegin("test9CreateDomainOnExistingDir");
234241
if (operator1 == null) {
@@ -246,8 +253,8 @@ public void test9CreateDomainOnExistingDir() throws Exception {
246253

247254
// @Test
248255
public void testACreateDomainApacheLB() throws Exception {
249-
Assume.assumeFalse(
250-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
256+
Assume.assumeFalse(QUICKTEST);
257+
251258
logTestBegin("testACreateDomainApacheLB");
252259
logger.info("Creating Domain domain7 & verifing the domain creation");
253260
if (operator1 == null) {
@@ -263,8 +270,8 @@ public void testACreateDomainApacheLB() throws Exception {
263270

264271
@Test
265272
public void testBCreateDomainWithDefaultValuesInSampleInputs() throws Exception {
266-
Assume.assumeFalse(
267-
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true"));
273+
Assume.assumeFalse(QUICKTEST);
274+
268275
logTestBegin("testBCreateDomainWithDefaultValuesInSampleInputs");
269276
logger.info("Creating Domain domain8 & verifing the domain creation");
270277
if (operator1 == null) {
@@ -288,9 +295,11 @@ private Domain testAllUseCasesForADomain(Operator operator, String domainYamlFil
288295
logger.info("Creating Domain & verifing the domain creation");
289296
// create domain1
290297
Domain domain = testDomainCreation(domainYamlFile);
291-
testClusterScaling(operator, domain);
292-
testDomainLifecyle(operator, domain);
293-
testOperatorLifecycle(operator, domain);
298+
if (!SMOKETEST) {
299+
testClusterScaling(operator, domain);
300+
testDomainLifecyle(operator, domain);
301+
testOperatorLifecycle(operator, domain);
302+
}
294303
return domain;
295304
}
296305

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)