From d300bdf67081360b9d8ac253fdf3d43309912e18 Mon Sep 17 00:00:00 2001 From: "mark.j0hnst0n" Date: Tue, 11 Jun 2024 21:43:45 +0100 Subject: [PATCH 1/2] Add test jobs to run against postgres13 --- .circleci/config.yml | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e9878ec0..e1975ff6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,6 +60,66 @@ jobs: - run: name: Upload code coverage command: ./codecov + + tests_pg13: + 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: @@ -101,4 +161,5 @@ workflows: test: jobs: - tests + - tests_pg13 - linting From 4a30d8411c941b8fb64dfb84724674f579037b72 Mon Sep 17 00:00:00 2001 From: Kevin Carrogan Date: Fri, 14 Jun 2024 12:02:25 +0100 Subject: [PATCH 2/2] Rename tests --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e1975ff6..c70ee481 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,7 +61,7 @@ jobs: name: Upload code coverage command: ./codecov - tests_pg13: + tests_postgres13: docker: - image: cimg/python:3.8.17 - image: circleci/redis:3.2-alpine @@ -161,5 +161,5 @@ workflows: test: jobs: - tests - - tests_pg13 + - tests_postgres13 - linting