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 1212import java .nio .file .Paths ;
1313import java .util .ArrayList ;
1414import java .util .List ;
15+ import java .util .Random ;
1516
1617import oracle .weblogic .deploy .integration .annotations .TestingLogger ;
1718import oracle .weblogic .deploy .integration .utils .CommandResult ;
@@ -44,7 +45,21 @@ public class BaseTest {
4445 protected static String domainParentDir = "" ;
4546 protected static final String ORACLE_DB_IMG = "phx.ocir.io/weblogick8s/database/enterprise" ;
4647 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+ }
4863
4964 protected static void initialize () {
5065
You can’t perform that action at this time.
0 commit comments