Skip to content

Test

Test #12

Workflow file for this run

name: Test
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker-compose run --rm web python wait_for_postgres.py
- run: docker-compose run --rm web python manage.py collectstatic --no-input
- name: Run tests
run: docker-compose run --rm -e DJANGO_Q_SYNC=true web pytest /app/tests
- name: Run instance monitoring
run: docker-compose run --rm web df -h
- run: docker-compose up -d selenium
- name: Run selenium tests
run: docker-compose run --rm -e DJANGO_Q_SYNC=true web python3 manage.py test test_selenium
- name: Run instance monitoring
run: docker-compose run --rm web df -h
# Dev environment smoke test
- name: Migrate schema
run: docker-compose run --rm web python manage.py migrate
- name: Loading a shapefile
run: docker-compose run --rm web python manage.py loadshp /scripts/shapefiles/country.shp code=code,parent_cod=parent_code,name=name,area=area "demo hierarchy" country demo_version --allow-root --create-hierarchy | grep "Loading shape 1 succeeded"
- name: Load demo data fixture
run: docker-compose run --rm web python manage.py loaddata demodata.json
- name: Start server
run: docker-compose up -d
- name: Check that the server has a profile
run: wget --retry-connrefused --waitretry=1 --read-timeout=10 --timeout=10 --tries=10 -O- "http://localhost:8000/api/v1/profiles/1/" | grep "Demo"