From bbbb9e7e07755c670baa033006882749d868f312 Mon Sep 17 00:00:00 2001 From: Aron Buzogany Date: Fri, 23 Feb 2024 10:50:02 +0100 Subject: [PATCH] created test script --- backend/run_tests.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 backend/run_tests.sh diff --git a/backend/run_tests.sh b/backend/run_tests.sh new file mode 100644 index 00000000..a35d5cb2 --- /dev/null +++ b/backend/run_tests.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Run Docker Compose to build and start the services, and capture the exit code from the test runner service +docker-compose -f tests.yaml up --build --exit-code-from test-runner + +# Store the exit code in a variable +exit_code=$? + +# After the tests are finished, stop and remove the containers +docker-compose -f tests.yaml down + +# Check the exit code to determine whether the tests passed or failed +if [ $exit_code -eq 0 ]; then + echo "Tests passed!" +else + echo "Tests failed!" +fi + +# Exit with the same exit code as the test runner service +exit $exit_code