Skip to content

Commit

Permalink
Debug multi-az integration test setup on gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-congo committed Dec 13, 2023
1 parent 66e2ae7 commit 1b3d2ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ jobs:
echo "TEMP_AWS_ACCESS_KEY_ID=${creds[0]}" >> $GITHUB_ENV
echo "TEMP_AWS_SECRET_ACCESS_KEY=${creds[1]}" >> $GITHUB_ENV
echo "TEMP_AWS_SESSION_TOKEN=${creds[2]}" >> $GITHUB_ENV
- name: Setup upterm session
uses: lhotari/action-upterm@v1

- name: 'Run Integration Tests'
run: |
./gradlew --no-parallel --no-daemon test-multi-az --info
./gradlew --no-parallel --no-daemon test-pg-multi-az --info
env:
AURORA_CLUSTER_DOMAIN: ${{ secrets.DB_CONN_SUFFIX }}
AURORA_DB_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
Expand All @@ -63,6 +65,7 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ env.TEMP_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.TEMP_AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ env.TEMP_AWS_SESSION_TOKEN }}
FILTER: "test_connect_to_writer__switch_read_only"

- name: 'Archive results'
if: always()
Expand Down
1 change: 1 addition & 0 deletions tests/integration/container/utils/rds_test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def _open_connection(self, instance_info: TestInstanceInfo) -> Any:
password = env.get_database_info().get_password()
db = env.get_database_info().get_default_db_name()

print(f"asdfasdf Connecting using db: {db}")
conn_params = DriverHelper.get_connect_params(
instance_info.get_host(), instance_info.get_port(), user, password, db, test_driver)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,14 @@ private static void createDbCluster(TestEnvironmentConfig env, int numOfInstance
env.rdsUtil.ec2AuthorizeIP(env.runnerIP);

DatabaseEngine engine = env.info.getRequest().getDatabaseEngine();
LOGGER.info("asdfasdf deployment: " + deployment + ", engine: " + engine);
LOGGER.info("asdfasdf Is deployment multi-az: " + DatabaseEngineDeployment.MULTI_AZ.equals(deployment));
LOGGER.info("asdfasdf Is engine pg: " + DatabaseEngine.PG.equals(engine));
if (DatabaseEngineDeployment.MULTI_AZ.equals(deployment) && DatabaseEngine.PG.equals(engine)) {
LOGGER.info("asdfasdf Inside create extension branch");
DriverHelper.registerDriver(engine);

LOGGER.info("asdfasdf Create extension will be executed for DB: " + env.info.getDatabaseInfo().getDefaultDbName());
try (Connection conn = DriverHelper.getDriverConnection(env.info);
Statement stmt = conn.createStatement()) {
stmt.execute("CREATE EXTENSION IF NOT EXISTS rds_tools");
Expand Down

0 comments on commit 1b3d2ef

Please sign in to comment.