@@ -29,6 +29,7 @@ public class BaseTest {
29
29
private static int maxIterationsPod = 50 ;
30
30
private static int waitTimePod = 5 ;
31
31
private static String leaseId = "" ;
32
+ private static String branchName = "" ;
32
33
33
34
private static Properties appProps ;
34
35
@@ -63,10 +64,17 @@ public static void initialize(String appPropsFile) throws Exception {
63
64
// resultDir = resultRoot + "/acceptance_test_tmp";
64
65
userProjectsDir = resultRoot + "/acceptance_test_tmp/user-projects" ;
65
66
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
+
66
73
logger .info ("RESULT_ROOT =" + resultRoot );
67
74
logger .info ("PV_ROOT =" + pvRoot );
68
75
logger .info ("userProjectsDir =" + userProjectsDir );
69
76
logger .info ("projectRoot =" + projectRoot );
77
+ logger .info ("branchName =" + branchName );
70
78
71
79
logger .info ("Env var RESULT_ROOT " + System .getenv ("RESULT_ROOT" ));
72
80
logger .info ("Env var PV_ROOT " + System .getenv ("PV_ROOT" ));
@@ -79,6 +87,7 @@ public static void initialize(String appPropsFile) throws Exception {
79
87
"Env var IMAGE_PULL_SECRET_OPERATOR " + System .getenv ("IMAGE_PULL_SECRET_OPERATOR" ));
80
88
logger .info (
81
89
"Env var IMAGE_PULL_SECRET_WEBLOGIC " + System .getenv ("IMAGE_PULL_SECRET_WEBLOGIC" ));
90
+ logger .info ("Env var BRANCH_NAME " + System .getenv ("BRANCH_NAME" ));
82
91
83
92
// create resultRoot, PVRoot, etc
84
93
Files .createDirectories (Paths .get (resultRoot ));
@@ -138,6 +147,10 @@ public static String getLeaseId() {
138
147
return leaseId ;
139
148
}
140
149
150
+ public static String getBranchName () {
151
+ return branchName ;
152
+ }
153
+
141
154
protected void logTestBegin (String testName ) throws Exception {
142
155
logger .info ("+++++++++++++++++++++++++++++++++---------------------------------+" );
143
156
logger .info ("BEGIN " + testName );
0 commit comments