File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
system-test/src/test/java/oracle/weblogic/deploy/integration Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 12
12
import java .nio .file .Paths ;
13
13
import java .util .ArrayList ;
14
14
import java .util .List ;
15
+ import java .util .Random ;
15
16
16
17
import oracle .weblogic .deploy .integration .annotations .TestingLogger ;
17
18
import oracle .weblogic .deploy .integration .utils .CommandResult ;
@@ -44,7 +45,21 @@ public class BaseTest {
44
45
protected static String domainParentDir = "" ;
45
46
protected static final String ORACLE_DB_IMG = "phx.ocir.io/weblogick8s/database/enterprise" ;
46
47
protected static final String ORACLE_DB_IMG_TAG = "12.2.0.1-slim" ;
47
- private static final String DB_CONTAINER_NAME = "InfraDB" ;
48
+ private static final String DB_CONTAINER_NAME = generateDatabaseContainerName ();
49
+
50
+ private static String generateDatabaseContainerName () {
51
+ String branchName = System .getenv ("BRANCH_NAME" );
52
+
53
+ if (branchName == null || branchName .isEmpty ()) {
54
+ // This should only occur for non-Jenkins runs (developer laptop builds)
55
+ branchName = "LOCAL" ;
56
+ } else {
57
+ // characters not allowed in container names are replaced with an underscore
58
+ branchName = branchName .replaceAll ("[^a-zA-Z0-9_.-]" , "_" );
59
+ }
60
+ int randomNum = new Random ().nextInt (1000 );
61
+ return String .format ("WDT-IT-%s-%s" , branchName , randomNum );
62
+ }
48
63
49
64
protected static void initialize () {
50
65
You can’t perform that action at this time.
0 commit comments