Skip to content

Commit

Permalink
Merge pull request #250 from uktrade/LTD-4955-add-teststo-run-against…
Browse files Browse the repository at this point in the history
…-postgres13

LTD-4955 Add test jobs to run against postgres13
  • Loading branch information
kevincarrogan authored Jun 14, 2024
2 parents c18a1c9 + 4a30d84 commit b8bc4b2
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,66 @@ jobs:
- run:
name: Upload code coverage
command: ./codecov

tests_postgres13:
docker:
- image: cimg/python:3.8.17
- image: circleci/redis:3.2-alpine
- image: circleci/postgres:13
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
- image: mailhog/mailhog

environment:
DEBUG: True
PIPENV_VENV_IN_PROJECT: 'enabled'

working_directory: ~/lite-hmrc

steps:
- checkout
- run:
name: Git Submodule Checkout
command: |
git submodule sync
git submodule update --init
- run:
name: Set Environment File
command: cp local.env .env

# Download and cache dependencies
# ensure this step occurs *before* installing dependencies
- restore_cache:
key: dependencies-{{ .Branch }}-{{ checksum "Pipfile.lock" }}

- run:
name: Install Dependencies
command: pipenv sync --dev

- run:
name: Install code coverage
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
- save_cache:
paths:
- ./venv
key: dependencies-{{ .Branch }}-{{ checksum "Pipfile.lock" }}

- run:
name: Check migrations are made
command: pipenv run ./manage.py makemigrations --check

- run:
name: Run tests on Postgres 13
command: pipenv run pytest --cov=. --cov-report xml --cov-config=.coveragerc
- store_test_results:
path: test-results
- run:
name: Upload code coverage
command: ./codecov

linting:
docker:
Expand Down Expand Up @@ -101,4 +161,5 @@ workflows:
test:
jobs:
- tests
- tests_postgres13
- linting

0 comments on commit b8bc4b2

Please sign in to comment.