From e89f234ff5bca2518abe648c5fe2170e6fe5c14d Mon Sep 17 00:00:00 2001 From: Joshua Knight Date: Mon, 8 Jul 2024 09:13:57 +0100 Subject: [PATCH] Adding make unittest --- .github/workflows/run-test-suite.yml | 12 +++--------- Makefile | 6 +++++- src/requirements.txt | 1 + 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-test-suite.yml b/.github/workflows/run-test-suite.yml index 0ad4f24..9287cb1 100644 --- a/.github/workflows/run-test-suite.yml +++ b/.github/workflows/run-test-suite.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.10', '3.11', '3.12'] + python-version: ['3.12'] env: AZURE_VAULT_ID: ${{ secrets.TEST_AZURE_VAULT_ID }} @@ -40,15 +40,9 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - if [ -f src/requirements.txt ]; then pip install -r src/requirements.txt; fi - - name: Run tests - working-directory: src/ - run: | - pytest tests/ -vv -s --junit-xml=test-results.xml + working-directory: / + run: make unittest - name: Surface failing tests if: always() diff --git a/Makefile b/Makefile index 5bc7dfd..0f085c7 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,10 @@ mkdocs-build: run: ./buildscripts/run_docker.sh +unittest: + $(MAKE) build-local + $(MAKE) run-tests + run-tests: ./buildscripts/run_tests.sh @@ -56,4 +60,4 @@ inference-build: ./buildscripts/build_inference_service.sh inference-run: - ./buildscripts/run_inference_service.sh \ No newline at end of file + ./buildscripts/run_inference_service.sh diff --git a/src/requirements.txt b/src/requirements.txt index b242aca..4b5dc32 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -12,3 +12,4 @@ prometheus_fastapi_instrumentator pydantic-core pytest markdown +coverage