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 6, 2024
1 parent 214af58 commit faa9fd5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 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,11 +95,19 @@
[invoke setup_electric_shell "electric" "3000" $env]
[endmacro]

[macro setup_electric_with_env_and_tenant env]
[invoke setup_electric_with_env "DATABASE_ID=integration_test_tenant DATABASE_URL=$database_url $env"]
[endmacro]

[macro setup_electric_shell shell_name port env]
[shell $shell_name]
-$fail_pattern

!PORT=$port $env ../scripts/electric_dev.sh
!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 "DATABASE_ID=integration_test_tenant DATABASE_URL=$database_url"]
[endmacro]

[macro add_tenant tenant_id electric_port]
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 faa9fd5

Please sign in to comment.