Skip to content

Commit ac3b983

Browse files
committed
syncing BaseTest.java to develop branch
1 parent 5368808 commit ac3b983

File tree

1 file changed

+28
-28
lines changed
  • integration-tests/src/test/java/oracle/kubernetes/operator

1 file changed

+28
-28
lines changed

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
22
// Licensed under the Universal Permissive License v 1.0 as shown at
33
// http://oss.oracle.com/licenses/upl.
4+
45
package oracle.kubernetes.operator;
56

67
import java.nio.file.Files;
@@ -24,11 +25,11 @@
2425
* extend this class.
2526
*/
2627
public class BaseTest {
27-
2828
public static final Logger logger = Logger.getLogger("OperatorIT", "OperatorIT");
2929
public static final String TESTWEBAPP = "testwebapp";
3030

3131
// property file used to customize operator properties for operator inputs yaml
32+
3233
public static final String OPERATOR1_YAML = "operator1.yaml";
3334
public static final String OPERATOR2_YAML = "operator2.yaml";
3435
public static final String OPERATORBC_YAML = "operator_bc.yaml";
@@ -73,9 +74,7 @@ public class BaseTest {
7374
System.getenv("QUICKTEST") != null && System.getenv("QUICKTEST").equalsIgnoreCase("true");
7475
SMOKETEST =
7576
System.getenv("SMOKETEST") != null && System.getenv("SMOKETEST").equalsIgnoreCase("true");
76-
if (SMOKETEST) {
77-
QUICKTEST = true;
78-
}
77+
if (SMOKETEST) QUICKTEST = true;
7978
if (System.getenv("JENKINS") != null) {
8079
JENKINS = new Boolean(System.getenv("JENKINS")).booleanValue();
8180
}
@@ -139,30 +138,6 @@ public static void initialize(String appPropsFile) throws Exception {
139138
+ clnResult.stderr());
140139
}
141140

142-
// create resultRoot, PVRoot, etc
143-
Files.createDirectories(Paths.get(resultRoot));
144-
Files.createDirectories(Paths.get(resultDir));
145-
Files.createDirectories(Paths.get(userProjectsDir));
146-
147-
// create file handler
148-
FileHandler fh = new FileHandler(resultDir + "/java_test_suite.out", true);
149-
SimpleFormatter formatter = new SimpleFormatter();
150-
fh.setFormatter(formatter);
151-
logger.addHandler(fh);
152-
logger.log(
153-
Level.INFO, "Adding file handler, logging to file at {0}/java_test_suite.out", resultDir);
154-
155-
// for manual/local run, create file handler, create PVROOT
156-
if (System.getenv("WERCKER") == null && System.getenv("JENKINS") == null) {
157-
logger.log(Level.INFO, "Creating PVROOT {0}", pvRoot);
158-
Files.createDirectories(Paths.get(pvRoot));
159-
ExecResult result = ExecCommand.exec("chmod 777 " + pvRoot);
160-
if (result.exitValue() != 0) {
161-
throw new RuntimeException(
162-
"FAILURE: Couldn't change permissions for PVROOT " + result.stderr());
163-
}
164-
}
165-
166141
if (System.getenv("JENKINS") != null) {
167142
logger.info("Creating " + resultRoot + "/acceptance_test_tmp");
168143
TestUtils.exec(
@@ -184,6 +159,29 @@ public static void initialize(String appPropsFile) throws Exception {
184159
+ "/acceptance_test_pv\"");
185160
}
186161

162+
// create resultRoot, PVRoot, etc
163+
Files.createDirectories(Paths.get(resultRoot));
164+
Files.createDirectories(Paths.get(resultDir));
165+
Files.createDirectories(Paths.get(userProjectsDir));
166+
167+
// create file handler
168+
FileHandler fh = new FileHandler(resultDir + "/java_test_suite.out");
169+
SimpleFormatter formatter = new SimpleFormatter();
170+
fh.setFormatter(formatter);
171+
logger.addHandler(fh);
172+
logger.info("Adding file handler, logging to file at " + resultDir + "/java_test_suite.out");
173+
174+
// for manual/local run, create file handler, create PVROOT
175+
if (System.getenv("WERCKER") == null && System.getenv("JENKINS") == null) {
176+
logger.info("Creating PVROOT " + pvRoot);
177+
Files.createDirectories(Paths.get(pvRoot));
178+
ExecResult result = ExecCommand.exec("chmod 777 " + pvRoot);
179+
if (result.exitValue() != 0) {
180+
throw new RuntimeException(
181+
"FAILURE: Couldn't change permissions for PVROOT " + result.stderr());
182+
}
183+
}
184+
187185
logger.info("appProps = " + appProps);
188186
logger.info("maxIterationPod = " + appProps.getProperty("maxIterationsPod"));
189187
logger.info(
@@ -270,9 +268,11 @@ public void testAdminT3Channel(Domain domain) throws Exception {
270268
* at weblogic.cluster.UnicastSender.send(UnicastSender.java:21)
271269
* Truncated. see log file for complete stacktrace
272270
*/
271+
273272
if (domainMap.containsKey("domainHomeImageBase")) {
274273
if (domainMap.get("initialManagedServerReplicas") != null
275274
&& ((Integer) domainMap.get("initialManagedServerReplicas")).intValue() >= 1) {
275+
276276
result =
277277
ExecCommand.exec(
278278
"kubectl logs "

0 commit comments

Comments
 (0)