From 5d03317a5a1115fa597c45995fd7e3930f1a8513 Mon Sep 17 00:00:00 2001 From: Siddharth Tiwari Date: Wed, 10 Jan 2024 23:03:10 +0530 Subject: [PATCH] chore: added redis flush --- tests/e2e/01-authenticate.bats | 1 + tests/e2e/03-send.bats | 3 +++ tests/e2e/04-wallet.bats | 1 + tests/e2e/helpers.bash | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/tests/e2e/01-authenticate.bats b/tests/e2e/01-authenticate.bats index 9a8cd28..091b991 100644 --- a/tests/e2e/01-authenticate.bats +++ b/tests/e2e/01-authenticate.bats @@ -7,6 +7,7 @@ setup_file() { } @test "auth: login/logout A and set username" { + redis_cli FLUSHALL > /dev/null 2>&1 || true login_user A galoy_cli_cmd set-username --username ${USER_A_USERNAME} username=$(galoy_cli_cmd me | jq -r '.username') diff --git a/tests/e2e/03-send.bats b/tests/e2e/03-send.bats index a4092f6..11c0313 100644 --- a/tests/e2e/03-send.bats +++ b/tests/e2e/03-send.bats @@ -8,6 +8,7 @@ setup_file() { } @test "send(intraledger, btc): sats deducted from A's wallet and received by B" { + redis_cli FLUSHALL > /dev/null 2>&1 || true fund_user "A" "btc" 0.1 login_user B @@ -31,6 +32,7 @@ setup_file() { } @test "send(intraledger, usd): cents deducted from B's wallet and received by A" { + redis_cli FLUSHALL > /dev/null 2>&1 || true fund_user "B" "usd" 0.1 login_user A @@ -54,6 +56,7 @@ setup_file() { } @test "batch(A, B, C): submit batch from A to B and C" { + redis_cli FLUSHALL > /dev/null 2>&1 || true fund_user "A" "usd" 0.01 login_user B diff --git a/tests/e2e/04-wallet.bats b/tests/e2e/04-wallet.bats index 8edd0ae..bbbe101 100644 --- a/tests/e2e/04-wallet.bats +++ b/tests/e2e/04-wallet.bats @@ -7,6 +7,7 @@ setup_file() { } @test "wallet: update default wallet" { + redis_cli FLUSHALL > /dev/null 2>&1 || true login_user A default_wallet_id=$(get_default_wallet_id) diff --git a/tests/e2e/helpers.bash b/tests/e2e/helpers.bash index 990f33a..23e3db1 100644 --- a/tests/e2e/helpers.bash +++ b/tests/e2e/helpers.bash @@ -104,3 +104,7 @@ fund_user() { logout_user [[ "$retries" != "30" ]] || exit 1 } + +redis_cli() { + docker exec "${COMPOSE_PROJECT_NAME}-redis-1" redis-cli $@ +}