Skip to content

Commit

Permalink
chore: Fix integration test storage isolation (#1823)
Browse files Browse the repository at this point in the history
Fixes #1820

We specify the storage directory as being within the integration test
folder, and after every test the storage is deleted.

As expected, now only `crash-recovery` fails which boots up with the
persistent state after simulating the crash
  • Loading branch information
msfstef authored Oct 9, 2024
1 parent 8ad40e7 commit d6773f4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ caching/nginx_cache
file.jsonl
integration-tests/lux_logs/
integration-tests/lux/
integration-tests/_storage
json_files
node_modules
shape-data.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ set -e

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

cd "$SCRIPT_DIR"/../packages/sync-service
iex -S mix
rm -rf "$SCRIPT_DIR/../_storage"
8 changes: 8 additions & 0 deletions integration-tests/scripts/electric_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)

cd "$SCRIPT_DIR"/../../packages/sync-service
STORAGE_DIR="$SCRIPT_DIR/../_storage" iex -S mix
6 changes: 4 additions & 2 deletions integration-tests/tests/macros.luxinc
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@
[shell $shell_name]
-$fail_pattern

!DATABASE_URL=$database_url PORT=$port ../electric_dev.sh
!DATABASE_URL=$database_url PORT=$port ../scripts/electric_dev.sh
[endmacro]

[macro teardown]
-$fail_pattern

!docker rm -f -v $pg_container_name
?$PS1
!../scripts/clean_up.sh
?$PS1
[endmacro]

0 comments on commit d6773f4

Please sign in to comment.