-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathintegration-test.sh
More file actions
executable file
·43 lines (33 loc) · 1.1 KB
/
integration-test.sh
File metadata and controls
executable file
·43 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -eu
SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR/../.."
# Stop previous containers
echo "Stopping previous Docker containers..."
docker compose -f docker/docker-compose.yaml down
# Build the Docker images
echo "Building Docker images..."
docker compose -f docker/docker-compose.yaml build
# Start the Docker containers
echo "Starting Docker containers..."
docker compose -f docker/docker-compose.yaml up -d
# Waiting for the service to be ready
echo "Waiting for containers to be ready..."
printf 'GET http://localhost:8888/\nHTTP 404' | hurl --retry 60 > /dev/null;
# Waiting 10 more seconds to ensure everything is up
echo "Waiting for additional 10 seconds..."
sleep 10
# Run the tests
echo "Running integration tests..."
# Enable failing for this command
set +e
hurl --test scripts/ci/e2e-test.hurl -v
set -e
# Cleanup after tests
if [ $? -ne 0 ]; then
echo "Integration tests failed ❌ - see above for details."
docker compose -f docker/docker-compose.yaml down -v
exit 1
fi
echo "Integration tests completed successfully ✅"
docker compose -f docker/docker-compose.yaml down -v