From d6c576bb7051cd06f482e4e782d172e47ac4b9c1 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Wed, 6 Nov 2024 13:44:22 +0100 Subject: [PATCH] Fix failing e2e tests --- integration-tests/tests/_macros.luxinc | 14 +++++++++----- .../resuming-replication-at-consistent-point.lux | 2 +- integration-tests/tests/rolling-deploy.lux | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/integration-tests/tests/_macros.luxinc b/integration-tests/tests/_macros.luxinc index b026b8a1ae..84cdc32dd8 100644 --- a/integration-tests/tests/_macros.luxinc +++ b/integration-tests/tests/_macros.luxinc @@ -43,12 +43,8 @@ [endmacro] [macro resume_pg] - [shell pg_lifecycle] - !docker start $pg_container_name - ?$PS1 - [shell pg] - !docker attach $pg_container_name + !docker start --attach $pg_container_name ??database system is ready to accept connections [endmacro] @@ -99,6 +95,10 @@ [invoke setup_electric_shell "electric" "3000" $env] [endmacro] +[macro setup_electric_with_env_and_tenant env] + [invoke setup_electric_with_env "ELECTRIC_DATABASE_ID=integration_test_tenant DATABASE_URL=$database_url $env"] +[endmacro] + [macro setup_electric_shell shell_name port env] [shell $shell_name] -$fail_pattern @@ -106,6 +106,10 @@ !ELECTRIC_PORT=$port $env ../scripts/electric_dev.sh [endmacro] +[macro setup_electric_shell_with_tenant shell_name port] + [invoke setup_electric_shell $shell_name $port "ELECTRIC_DATABASE_ID=integration_test_tenant DATABASE_URL=$database_url"] +[endmacro] + [macro add_tenant tenant_id electric_port] [shell $tenant_id] !curl -X POST http://localhost:$electric_port/v1/admin/database \ diff --git a/integration-tests/tests/resuming-replication-at-consistent-point.lux b/integration-tests/tests/resuming-replication-at-consistent-point.lux index 74271ca278..26c29fc920 100644 --- a/integration-tests/tests/resuming-replication-at-consistent-point.lux +++ b/integration-tests/tests/resuming-replication-at-consistent-point.lux @@ -22,7 +22,7 @@ ??INSERT 0 2 ## Start the sync service with the CrashingFileStorage storage backend. -[invoke setup_electric_with_env "ELECTRIC_STORAGE=crashing_file CRASHING_FILE_ELECTRIC_STORAGE__NUM_CALLS_UNTIL_CRASH=2"] +[invoke setup_electric_with_env_and_tenant "ELECTRIC_STORAGE=crashing_file CRASHING_FILE_ELECTRIC_STORAGE__NUM_CALLS_UNTIL_CRASH=2"] [shell electric] ??[info] Starting replication from postgres diff --git a/integration-tests/tests/rolling-deploy.lux b/integration-tests/tests/rolling-deploy.lux index 66af55ab69..5fb309dc55 100644 --- a/integration-tests/tests/rolling-deploy.lux +++ b/integration-tests/tests/rolling-deploy.lux @@ -10,7 +10,7 @@ [invoke setup_pg "" ""] ## Start the first sync service. -[invoke setup_electric_shell "electric_1" "3000" ""] +[invoke setup_electric_shell_with_tenant "electric_1" "3000"] [shell electric_1] ??[info] Acquiring lock from postgres with name electric_slot_integration @@ -23,7 +23,7 @@ ??{"status":"active"} ## Start the second sync service. -[invoke setup_electric_shell "electric_2" "3001" ""] +[invoke setup_electric_shell_with_tenant "electric_2" "3001"] ## Assert that the lock is not acquired and replication does not start ## in the second electric