Skip to content

Commit

Permalink
refactor: remove dependency on RDS_CLUSTER_DOMAIN (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc-bq authored Jan 17, 2025
1 parent 8116c3b commit dc49d89
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion .github/workflows/aurora_performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
run: |
./gradlew --no-parallel --no-daemon test-aurora-${{ matrix.db }}-performance --info
env:
RDS_CLUSTER_DOMAIN: ${{ secrets.DB_CONN_SUFFIX }}
RDS_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ jobs:
run: |
./gradlew --no-parallel --no-daemon test-aurora-${{ matrix.dbEngine }} --info
env:
RDS_CLUSTER_DOMAIN: ${{ secrets.DB_CONN_SUFFIX }}
RDS_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/integration_tests_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ jobs:
run: |
./gradlew --no-parallel --no-daemon test-aurora-${{ matrix.dbEngine }} --info
env:
RDS_CLUSTER_DOMAIN: ${{ secrets.DB_CONN_SUFFIX }}
RDS_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/multi_az_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ jobs:
run: |
./gradlew --no-parallel --no-daemon test-${{ matrix.dbEngine }} --info
env:
RDS_CLUSTER_DOMAIN: ${{ secrets.DB_CONN_SUFFIX }}
RDS_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/run-autoscaling-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
run: |
./gradlew --no-parallel --no-daemon test-autoscaling-${{ matrix.dbEngine }} --info
env:
RDS_CLUSTER_DOMAIN: ${{ secrets.DB_CONN_SUFFIX }}
RDS_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@ private static void createDbCluster(TestEnvironmentConfig env, int numOfInstance
env.rdsMySqlDbEngineVersion = System.getenv("RDS_MYSQL_DB_ENGINE_VERSION"); // "latest", "default"
env.rdsPgDbEngineVersion = System.getenv("RDS_PG_DB_ENGINE_VERSION");

if (StringUtils.isNullOrEmpty(env.auroraClusterDomain)) {
throw new RuntimeException("Environment variable RDS_CLUSTER_DOMAIN is required.");
}

env.auroraUtil =
new AuroraTestUtility(
env.info.getRegion(),
Expand All @@ -257,6 +253,9 @@ private static void createDbCluster(TestEnvironmentConfig env, int numOfInstance
ArrayList<TestInstanceInfo> instances = new ArrayList<>();

if (env.reuseAuroraDbCluster) {
if (StringUtils.isNullOrEmpty(env.auroraClusterDomain)) {
throw new RuntimeException("Environment variable RDS_CLUSTER_DOMAIN is required when testing against an existing Aurora DB cluster.");
}
if (!env.auroraUtil.doesClusterExist(env.auroraClusterName)) {
throw new RuntimeException(
"It's requested to reuse existing DB cluster but it doesn't exist: "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public String createAuroraCluster() throws InterruptedException {
builder.filters(
Filter.builder().name("db-cluster-id").values(dbIdentifier).build()));
final String endpoint = dbInstancesResult.dbInstances().get(0).endpoint().address();
final String clusterDomainPrefix = endpoint.substring(endpoint.indexOf('.') + 1);
final String clusterDomainSuffix = endpoint.substring(endpoint.indexOf('.') + 1);

for (DBInstance instance : dbInstancesResult.dbInstances()) {
this.instances.add(
Expand All @@ -262,7 +262,7 @@ public String createAuroraCluster() throws InterruptedException {
instance.endpoint().port()));
}

return clusterDomainPrefix;
return clusterDomainSuffix;
}

/**
Expand Down Expand Up @@ -320,7 +320,7 @@ public String createMultiAzCluster() throws InterruptedException {
builder.filters(
Filter.builder().name("db-cluster-id").values(dbIdentifier).build()));
final String endpoint = dbInstancesResult.dbInstances().get(0).endpoint().address();
final String clusterDomainPrefix = endpoint.substring(endpoint.indexOf('.') + 1);
final String clusterDomainSuffix = endpoint.substring(endpoint.indexOf('.') + 1);

for (DBInstance instance : dbInstancesResult.dbInstances()) {
this.instances.add(
Expand All @@ -330,7 +330,7 @@ public String createMultiAzCluster() throws InterruptedException {
instance.endpoint().port()));
}

return clusterDomainPrefix;
return clusterDomainSuffix;
}

/**
Expand Down

0 comments on commit dc49d89

Please sign in to comment.