run_integration_tests.sh 594 Bytes
Newer Older
1 2
#!/usr/bin/env bash

3 4
if [ -z ${CI_PIPELINE_ID} ]; then
    docker build -f Dockerfile.test -t zoe_test_image .
5

6
    docker network create zoe_test
7

8 9 10 11
    docker run -d --network zoe_test --name postgres -p 5432:5432 -e POSTGRES_DB=zoe -e POSTGRES_USER=zoeuser -e POSTGRES_PASSWORD=zoepass postgres:9.3
    docker pull nginx:alpine
    sleep 4  # give postgres the time to start
    docker run -it --network zoe_test --name zoe zoe_test_image pytest integration_tests/
12

13 14 15 16 17
    docker rm -f zoe postgres
    docker network rm zoe_test
else  # running in CI
    pytest --tb=short integration_tests/
fi