Skip to content

[DRAFT] Basic Local Integration Test Setup™ #33

[DRAFT] Basic Local Integration Test Setup™

[DRAFT] Basic Local Integration Test Setup™ #33

Workflow file for this run

name: Integration
on: [pull_request]
jobs:
integration-test-ephemeral:
runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres:latest
# # `POSTGRES_HOST` is `postgres`
# env:
# POSTGRES_DB: nycmesh-dev
# POSTGRES_USER: nycmesh
# POSTGRES_PASSWORD: helloThisIsATest
# POSTGRES_PORT: 5432
# ports:
# # maps tcp port 5432 on service container to the host
# - 5432:5432
# # set health checks to wait until postgres has started
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
steps:
- uses: actions/checkout@v3
- name: "We live in the stone age"
run: |
sed -i '/start_period: 3s/d' docker-compose.yaml
sed -i '/ports:/d' docker-compose.yaml
sed -i '/- "8080:8080"/d' docker-compose.yaml
sed -i 's/^gunicorn meshdb:app$/sleep 3 \&\& gunicorn meshdb:app/' docker-compose.yaml
- uses: isbang/[email protected]
with:
compose-file: "./docker-compose.yml"
down-flags: "--volumes"
services: |
postgres
meshdb
env:
MESHDB_DB_NAME: nymesh-dev
MESHDB_DB_USER: nycmesh
MESHDB_DB_HOST: localhost
MESHDB_DB_PASSWORD: helloThisIsATest
- name: "Install Dependencies"
run: |
pip install -r requirements.txt
pip install -r tests/requirements.txt
- name: "Run Integration Tests"
run: |
PYTHONPATH=. pytest .
env:
MESHDB_DB_NAME: nymesh-dev
MESHDB_DB_USER: nycmesh
MESHDB_DB_HOST: localhost
MESHDB_DB_PASSWORD: helloThisIsATest