Skip to content

Commit b4b2194

Browse files
committed
branch_name var changes
1 parent b909df9 commit b4b2194

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class BaseTest {
2929
private static int maxIterationsPod = 50;
3030
private static int waitTimePod = 5;
3131
private static String leaseId = "";
32+
private static String branchName = "";
3233

3334
private static Properties appProps;
3435

@@ -63,10 +64,17 @@ public static void initialize(String appPropsFile) throws Exception {
6364
// resultDir = resultRoot + "/acceptance_test_tmp";
6465
userProjectsDir = resultRoot + "/acceptance_test_tmp/user-projects";
6566
projectRoot = System.getProperty("user.dir") + "/..";
67+
if (System.getenv("BRANCH_NAME") != null) {
68+
branchName = System.getenv("BRANCH_NAME");
69+
} else {
70+
branchName = TestUtils.getGitBranchName().replaceAll("/", "_");
71+
}
72+
6673
logger.info("RESULT_ROOT =" + resultRoot);
6774
logger.info("PV_ROOT =" + pvRoot);
6875
logger.info("userProjectsDir =" + userProjectsDir);
6976
logger.info("projectRoot =" + projectRoot);
77+
logger.info("branchName =" + branchName);
7078

7179
logger.info("Env var RESULT_ROOT " + System.getenv("RESULT_ROOT"));
7280
logger.info("Env var PV_ROOT " + System.getenv("PV_ROOT"));
@@ -79,6 +87,7 @@ public static void initialize(String appPropsFile) throws Exception {
7987
"Env var IMAGE_PULL_SECRET_OPERATOR " + System.getenv("IMAGE_PULL_SECRET_OPERATOR"));
8088
logger.info(
8189
"Env var IMAGE_PULL_SECRET_WEBLOGIC " + System.getenv("IMAGE_PULL_SECRET_WEBLOGIC"));
90+
logger.info("Env var BRANCH_NAME " + System.getenv("BRANCH_NAME"));
8291

8392
// create resultRoot, PVRoot, etc
8493
Files.createDirectories(Paths.get(resultRoot));
@@ -138,6 +147,10 @@ public static String getLeaseId() {
138147
return leaseId;
139148
}
140149

150+
public static String getBranchName() {
151+
return branchName;
152+
}
153+
141154
protected void logTestBegin(String testName) throws Exception {
142155
logger.info("+++++++++++++++++++++++++++++++++---------------------------------+");
143156
logger.info("BEGIN " + testName);

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Operator.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,7 @@ private void initialize() throws Exception {
277277
operatorProps.put("externalRestHttpsPort", externalRestHttpsPort);
278278
}
279279
}
280-
logger.info("IMAGE_NAME_OPERATOR=" + System.getenv("IMAGE_NAME_OPERATOR"));
281-
logger.info("IMAGE_TAG_OPERATOR=" + System.getenv("IMAGE_TAG_OPERATOR"));
282-
logger.info("Git branch " + TestUtils.getGitBranchName());
280+
283281
// customize the inputs yaml file to use our pre-built docker image
284282
if (System.getenv("IMAGE_NAME_OPERATOR") != null
285283
&& System.getenv("IMAGE_TAG_OPERATOR") != null) {
@@ -291,7 +289,7 @@ private void initialize() throws Exception {
291289
"weblogicOperatorImage",
292290
"wlsldi-v2.docker.oraclecorp.com/weblogic-operator"
293291
+ ":test_"
294-
+ TestUtils.getGitBranchName().replaceAll("/", "_"));
292+
+ BaseTest.getBranchName());
295293
}
296294

297295
if (System.getenv("IMAGE_PULL_POLICY_OPERATOR") != null) {

src/integration-tests/bash/run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2902,7 +2902,8 @@ function test_suite {
29022902
# entry point
29032903

29042904
if [ "$JENKINS" = "true" ]; then
2905-
echo "`git branch`"
2905+
echo "git branch `git branch`"
2906+
echo "BRANCH_NAME ${BRANCH_NAME}"
29062907
mvn test-compile integration-test -P java-integration-tests
29072908
exit "$?"
29082909
fi

0 commit comments

Comments
 (0)