Skip to content

Commit ce12bb0

Browse files
committed
e2e tests: have Nuts containers wait for DB container healthy
1 parent 952f821 commit ce12bb0

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

e2e-tests/oauth-flow/rfc021/do-test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ db_dc="docker compose -f docker-compose.yml -f ${1}.yml"
1111
echo "------------------------------------"
1212
echo "Cleaning up running Docker containers and volumes, and key material..."
1313
echo "------------------------------------"
14-
$db_dc down
14+
# --remove-orphans to ensure that DB containers of previous runs (on e.g. Postgres) are removed when testing with SQLite.
15+
# Nothing breaks otherwise, but it prevents annoying warnings in the log.
16+
$db_dc down --remove-orphans
1517
$db_dc rm -f -v
1618

1719
echo "------------------------------------"

e2e-tests/oauth-flow/rfc021/mysql.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
services:
22
nodeA-backend:
33
depends_on:
4-
- db
4+
db:
5+
condition: service_healthy
56
environment:
67
NUTS_STORAGE_SQL_CONNECTION: mysql://root:root@db:3306/node_a?charset=utf8mb4&parseTime=True&loc=Local
78
nodeB-backend:
89
depends_on:
9-
- db
10+
db:
11+
condition: service_healthy
1012
environment:
1113
NUTS_STORAGE_SQL_CONNECTION: mysql://root:root@db:3306/node_b?charset=utf8mb4&parseTime=True&loc=Local
1214
db:

e2e-tests/oauth-flow/rfc021/postgres.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
services:
22
nodeA-backend:
33
depends_on:
4-
- db
4+
db:
5+
condition: service_healthy
56
environment:
67
NUTS_STORAGE_SQL_CONNECTION: postgres://postgres:postgres@db:5432/node_a?sslmode=disable
78
nodeB-backend:
89
depends_on:
9-
- db
10+
db:
11+
condition: service_healthy
1012
environment:
1113
NUTS_STORAGE_SQL_CONNECTION: postgres://postgres:postgres@db:5432/node_b?sslmode=disable
1214
db:

e2e-tests/oauth-flow/rfc021/sqlserver.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
services:
22
nodeA-backend:
33
depends_on:
4-
- db
4+
db:
5+
condition: service_healthy
56
environment:
67
NUTS_STORAGE_SQL_CONNECTION: sqlserver://sa:MyStrong(!)Password@db:1433/node_a?sslmode=disable
78
nodeB-backend:
89
depends_on:
9-
- db
10+
db:
11+
condition: service_healthy
1012
environment:
1113
NUTS_STORAGE_SQL_CONNECTION: sqlserver://sa:MyStrong(!)Password@db:1433/node_b?sslmode=disable
1214
db:

0 commit comments

Comments
 (0)