1
0
Fork 0
easy-appointments/tests/run_tests.sh

32 lines
990 B
Bash
Executable File

#!/bin/bash
# Create temp directory if it doesn't exist
mkdir -p ./temp
# Run tests and capture output
echo "Running tests..."
echo "Test started at $(date)" > ./temp/test_output.log
# Example test commands
echo "Testing Docker build..." >> ./temp/test_output.log
docker compose -f docker-compose.test.yml build >> ./temp/test_output.log 2>&1
echo "Testing container startup..." >> ./temp/test_output.log
docker compose -f docker-compose.test.yml up -d >> ./temp/test_output.log 2>&1
# Wait for container to be ready
sleep 5
# Check container status
echo "Container status:" >> ./temp/test_output.log
docker compose -f docker-compose.test.yml ps >> ./temp/test_output.log 2>&1
# Clean up
echo "Cleaning up..." >> ./temp/test_output.log
docker compose -f docker-compose.test.yml down >> ./temp/test_output.log 2>&1
echo "Tests completed at $(date)" >> ./temp/test_output.log
# Display results
echo "Test results have been saved to ./temp/test_output.log"
cat ./temp/test_output.log