Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix two issues running tests locally #4220

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ npm run lint # or 'make check' if you are a Makefile kind of pe

npm test # run test services and tests in Docker

docker-compose -f test/docker-compose.yml config --services # list test services
docker compose -f test/docker-compose.yml config --services # list test services
npm run docker:start # start all test services
npm run docker:start redis # start one or more test services
npm run docker:stop # stop all test services
Expand Down
4 changes: 2 additions & 2 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '2.1'

services:
postgres:
user: postgres
Expand Down Expand Up @@ -51,6 +49,8 @@ services:

mysql:
image: mysql:5.7
# No ARM64 image layer. See https://stackoverflow.com/a/65592942
platform: linux/x86_64
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 1
ports:
Expand Down
4 changes: 2 additions & 2 deletions test/script/docker/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else
CMD='npm test'
fi

NODE_VERSION=${1} docker-compose --no-ansi --log-level ERROR -f ./test/docker-compose.yml -f ./test/docker-compose.ci.yml run \
NODE_VERSION=${1} docker compose --no-ansi --log-level ERROR -f ./test/docker-compose.yml -f ./test/docker-compose.ci.yml run \
-e NODE_VERSION=${NODE_VERSION} \
-e TAV=${TAV_MODULES} \
-e CI=true \
Expand All @@ -33,4 +33,4 @@ NODE_VERSION=${1} docker-compose --no-ansi --log-level ERROR -f ./test/docker-co
npm --version
${CMD}"

NODE_VERSION=${1} docker-compose --no-ansi --log-level ERROR -f ./test/docker-compose.yml -f ./test/docker-compose.ci.yml down -v
NODE_VERSION=${1} docker compose --no-ansi --log-level ERROR -f ./test/docker-compose.yml -f ./test/docker-compose.ci.yml down -v
6 changes: 3 additions & 3 deletions test/script/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ then
else
# No arguments was given. Let's just assume that the user wants to
# spin up all dependencies inside Docker and run the tests locally
services=$(docker-compose -f ./test/docker-compose.yml config --services)
services=$(docker compose -f ./test/docker-compose.yml config --services)
fi

service_arr=( $services )
Expand All @@ -106,11 +106,11 @@ then
elif [[ $healthy -lt $expected_healthy || $containers -lt $expected_containers ]]
then
finish () {
docker-compose -f ./test/docker-compose.yml down
docker compose -f ./test/docker-compose.yml down
}
trap finish EXIT

docker-compose -f ./test/docker-compose.yml up -d $services
docker compose -f ./test/docker-compose.yml up -d $services
wait_for_healthy
fi

Expand Down