stages:
  - test

backend-tests:
  stage: test
  image: python:3.5-alpine

  services:
    - postgres:latest

  variables:
    # For the postgres image
    POSTGRES_DB: arkindex_dev
    POSTGRES_USER: devuser
    POSTGRES_PASSWORD: devdata

    # For the backend
    DB_HOST: postgres
    DB_PORT: 5432

  before_script:
    - apk --update add postgresql-dev libjpeg-turbo-dev gcc musl-dev

  script:
    - python setup.py test
    - pip install .[test]
    - flake8