Skip to content

Commit

Permalink
Fix failing e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-dp committed Nov 7, 2024
1 parent b820617 commit d6c576b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions integration-tests/tests/_macros.luxinc
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -99,13 +95,21 @@
[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

!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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/tests/rolling-deploy.lux
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d6c576b

Please sign in to comment.