diff --git a/.github/workflows/build_test_backend.yml b/.github/workflows/build_test_backend.yml index a013f8adf..8a59ab35a 100644 --- a/.github/workflows/build_test_backend.yml +++ b/.github/workflows/build_test_backend.yml @@ -13,12 +13,19 @@ jobs: run: | cp .env.example .env docker-compose up --no-start api - - name: Seed database and run API + - name: Run API (w/docker debugging) run: | docker-compose up -d api - - name: Run unit tests - run: docker-compose run api pytest + docker ps -a + docker network inspect 311_data_default + nc -zv localhost 5432 + docker-compose logs db + docker-compose logs api - name: Lint API run: docker-compose run api flake8 + - name: Seed the test database + run: docker-compose run -e TESTING=True api alembic upgrade head + - name: Run unit tests + run: docker-compose run api pytest # - name: Run Postman tests # run: chmod +x postman/test.sh && postman/test.sh diff --git a/server/.env.example b/server/.env.example index 058f3e247..d34b63c3e 100644 --- a/server/.env.example +++ b/server/.env.example @@ -21,6 +21,7 @@ DB_USER=311_user DB_PASS=311_pass DB_NAME=311_db_test DB_ECHO=False +SHOW_ENV=False ############################ PREFECT CONFIG ############################## diff --git a/server/api/.coverage b/server/api/.coverage index c0874cf6a..4791838ea 100644 Binary files a/server/api/.coverage and b/server/api/.coverage differ diff --git a/server/api/start_api.sh b/server/api/start_api.sh deleted file mode 100644 index 9cba419bc..000000000 --- a/server/api/start_api.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -euo pipefail - -if [ -v MIGRATE_DB ]; then - alembic upgrade head -fi - -exec python code/run.py diff --git a/server/docker-compose.yml b/server/docker-compose.yml index acf745fa5..c1c66c033 100644 --- a/server/docker-compose.yml +++ b/server/docker-compose.yml @@ -35,8 +35,6 @@ services: - target: ${APP_PORT} published: ${API_HOST_PORT} command: gunicorn lacity_data_api.asgi:app -w 4 -k uvicorn.workers.UvicornWorker --log-level info -b 0.0.0.0:5000 - # volumes: - # - ./api/:/home/api depends_on: - db - redis @@ -50,7 +48,6 @@ services: PREFECT__API_URL: ${APP_PROTOCOL}://${APP_HOST}:${APP_PORT} depends_on: - db - # entrypoint: python flow.py volumes: backend_data: