From f4f3030fbdd287db974cc06ef5f2c7175551d87a Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 16:57:23 -0400 Subject: [PATCH 01/11] ci: use pytest-spit in ci --- .github/workflows/ci.yml | 70 ---------------------- .github/workflows/test.yml | 120 +++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d4187368..67bca1a43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,76 +114,6 @@ jobs: # if: failure() # run: exit 1 - test: - runs-on: ubuntu-latest - env: - DB_ROOT_PASSWORD: "root-password" - DB_PASSWORD: "user-password" - DB_USER: citest - container: python:3.12.9-alpine3.20 - services: - db: - image: mariadb:10.11.11-jammy - env: - MARIADB_ROOT_PASSWORD: ${{ env.DB_ROOT_PASSWORD }} - # ensure that user has permissions for test DB to be used by pytest - MARIADB_DATABASE: test_opal - MARIADB_USER: ${{ env.DB_USER }} - MARIADB_PASSWORD: ${{ env.DB_PASSWORD }} - - steps: - - name: Install Git - run: | - apk add --no-cache git git-lfs - - uses: actions/checkout@v4.2.2 - with: - persist-credentials: false - lfs: true - - name: Install dependencies - run: | - pip install uv - echo "Installed uv version is $(uv --version)" - # install dependencies for mysqlclient - apk add --no-cache build-base mariadb-dev mariadb-client chromium - uv sync --locked - - name: Prepare environment - # set up env file for DB service - # use sample env file - # create additional DBs for legacy DB tests (OpalDB & QuestionnaireDB) - run: | - cp .env.sample .env - sed -i "s/^DATABASE_USER=.*/DATABASE_USER=$DB_USER/" .env - sed -i "s/^DATABASE_PASSWORD=.*/DATABASE_PASSWORD=$DB_PASSWORD/" .env - sed -i "s/^DATABASE_HOST=.*/DATABASE_HOST=db/" .env - # set up legacy DB connection - # reuse the same database as for the other tests to make it easier - sed -i "s/^LEGACY_DATABASE_HOST=.*/LEGACY_DATABASE_HOST=db/" .env - sed -i "s/^LEGACY_DATABASE_PORT=.*/LEGACY_DATABASE_PORT=3306/" .env - sed -i "s/^LEGACY_DATABASE_USER=.*/LEGACY_DATABASE_USER=$DB_USER/" .env - sed -i "s/^LEGACY_DATABASE_PASSWORD=.*/LEGACY_DATABASE_PASSWORD=$DB_PASSWORD/" .env - # generate secret key - SECRET_KEY=$(python -c "import secrets; print(secrets.token_urlsafe())") - sed -i "s/^SECRET_KEY=.*/SECRET_KEY=$SECRET_KEY/" .env - MYSQL_PWD=$DB_ROOT_PASSWORD mariadb -u root -h db --skip-ssl -e "GRANT ALL PRIVILEGES ON \`test_OpalDB\`.* TO \`$DB_USER\`@\`%\`;" - MYSQL_PWD=$DB_ROOT_PASSWORD mariadb -u root -h db --skip-ssl -e "GRANT ALL PRIVILEGES ON \`test_QuestionnaireDB\`.* TO \`$DB_USER\`@\`%\`;" - - name: Run pytest - run: | - uv run pytest --version - # -m "" runs all tests, even the ones marked as slow - uv run coverage run -m pytest -m "" -v --junitxml=test-report.xml - # see: https://github.com/dorny/test-reporter/issues/244 - # - name: Publish Test Results - # uses: dorny/test-reporter@v1.9.1 - # if: '!cancelled()' - # with: - # name: Tests - # path: ./test-report.xml - # reporter: java-junit - - name: Check coverage - run: | - uv run coverage report - - markdownlint: permissions: contents: read diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..1001b361b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,120 @@ +# SPDX-FileCopyrightText: Copyright (C) 2025 Opal Health Informatics Group at the Research Institute of the McGill University Health Centre +# +# SPDX-License-Identifier: AGPL-3.0-or-later +name: test + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + merge_group: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + seed: + runs-on: ubuntu-latest + steps: + - run: echo "SEED=$(python3 -c 'import random; print(random.Random().getrandbits(32));')" >> "$GITHUB_ENV" + + # usage of pytest-split and matrix strategy based on: + # https://github.com/jerry-git/pytest-split-gh-actions-demo/blob/master/.github/workflows/test.yml + pytest: + runs-on: ubuntu-latest + needs: seed + strategy: + fail-fast: false + matrix: + group: [1, 2, 3, 4] + env: + DB_ROOT_PASSWORD: "root-password" + DB_PASSWORD: "user-password" + DB_USER: citest + container: python:3.12.9-alpine3.20 + services: + db: + image: mariadb:10.11.11-jammy + env: + MARIADB_ROOT_PASSWORD: ${{ env.DB_ROOT_PASSWORD }} + # ensure that user has permissions for test DB to be used by pytest + MARIADB_DATABASE: test_opal + MARIADB_USER: ${{ env.DB_USER }} + MARIADB_PASSWORD: ${{ env.DB_PASSWORD }} + + steps: + - name: Install Git + run: | + apk add --no-cache git git-lfs + - uses: actions/checkout@v4.2.2 + with: + persist-credentials: false + lfs: true + - name: Install dependencies + run: | + pip install uv + echo "Installed uv version is $(uv --version)" + # install dependencies for mysqlclient + apk add --no-cache build-base mariadb-dev mariadb-client chromium + uv sync --locked + - name: Prepare environment + # set up env file for DB service + # use sample env file + # create additional DBs for legacy DB tests (OpalDB & QuestionnaireDB) + run: | + cp .env.sample .env + sed -i "s/^DATABASE_USER=.*/DATABASE_USER=$DB_USER/" .env + sed -i "s/^DATABASE_PASSWORD=.*/DATABASE_PASSWORD=$DB_PASSWORD/" .env + sed -i "s/^DATABASE_HOST=.*/DATABASE_HOST=db/" .env + # set up legacy DB connection + # reuse the same database as for the other tests to make it easier + sed -i "s/^LEGACY_DATABASE_HOST=.*/LEGACY_DATABASE_HOST=db/" .env + sed -i "s/^LEGACY_DATABASE_PORT=.*/LEGACY_DATABASE_PORT=3306/" .env + sed -i "s/^LEGACY_DATABASE_USER=.*/LEGACY_DATABASE_USER=$DB_USER/" .env + sed -i "s/^LEGACY_DATABASE_PASSWORD=.*/LEGACY_DATABASE_PASSWORD=$DB_PASSWORD/" .env + # generate secret key + SECRET_KEY=$(python -c "import secrets; print(secrets.token_urlsafe())") + sed -i "s/^SECRET_KEY=.*/SECRET_KEY=$SECRET_KEY/" .env + MYSQL_PWD=$DB_ROOT_PASSWORD mariadb -u root -h db --skip-ssl -e "GRANT ALL PRIVILEGES ON \`test_OpalDB\`.* TO \`$DB_USER\`@\`%\`;" + MYSQL_PWD=$DB_ROOT_PASSWORD mariadb -u root -h db --skip-ssl -e "GRANT ALL PRIVILEGES ON \`test_QuestionnaireDB\`.* TO \`$DB_USER\`@\`%\`;" + - name: Run pytest + # use pytest-cov to disable coverage fail + # use the same seed for each group + run: | + uv run pytest --version + # -m "" runs all tests, even the ones marked as slow + uv run pytest --cov --cov-fail-under=0 --randomly-seed="$SEED" --splits 4 --group ${{ matrix.group }} -m "" + - name: Upload coverage + uses: actions/upload-artifact@v4.6.2 + with: + name: coverage-group-${{ matrix.group }} + path: .coverage + + coverage: + needs: pytest + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4.2.2 + with: + persist-credentials: false + - uses: astral-sh/setup-uv@v5.4.1 + id: setup-uv + with: + # renovate: datasource=pypi dependency=uv + version: "0.6.12" + - name: Install dependencies + run: uv sync --locked --only-dev + - name: Download coverage reports + uses: actions/download-artifact@v4.2.1 + - name: Check coverage + run: | + ls -la + uv run coverage combine coverage*/.coverage* + uv run coverage report From c0b7b533e8b7f367800d86f62dca822322630d0a Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 16:59:10 -0400 Subject: [PATCH 02/11] add missing dependencies --- pyproject.toml | 2 ++ uv.lock | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b1a6cb2bc..1d3ba52ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,10 +63,12 @@ dev = [ "pandas-stubs==2.2.3.250308", "pre-commit==4.2.0", "pytest==8.3.5", + "pytest-cov==6.1.1", "pytest-django==4.11.1", "pytest-mock==3.14.0", "pytest-randomly==3.16.0", "pytest-socket==0.7.0", + "pytest-split==0.10.0", "pytest-sugar==1.0.0", "ruff==0.11.4", "types-beautifulsoup4==4.12.0.20250204", diff --git a/uv.lock b/uv.lock index 997e86a60..04ee6693a 100644 --- a/uv.lock +++ b/uv.lock @@ -56,10 +56,12 @@ dev = [ { name = "pandas-stubs" }, { name = "pre-commit" }, { name = "pytest" }, + { name = "pytest-cov" }, { name = "pytest-django" }, { name = "pytest-mock" }, { name = "pytest-randomly" }, { name = "pytest-socket" }, + { name = "pytest-split" }, { name = "pytest-sugar" }, { name = "ruff" }, { name = "types-beautifulsoup4" }, @@ -129,10 +131,12 @@ dev = [ { name = "pandas-stubs", specifier = "==2.2.3.250308" }, { name = "pre-commit", specifier = "==4.2.0" }, { name = "pytest", specifier = "==8.3.5" }, + { name = "pytest-cov", specifier = "==6.1.1" }, { name = "pytest-django", specifier = "==4.11.1" }, { name = "pytest-mock", specifier = "==3.14.0" }, { name = "pytest-randomly", specifier = "==3.16.0" }, { name = "pytest-socket", specifier = "==0.7.0" }, + { name = "pytest-split", specifier = "==0.10.0" }, { name = "pytest-sugar", specifier = "==1.0.0" }, { name = "ruff", specifier = "==0.11.4" }, { name = "types-beautifulsoup4", specifier = "==4.12.0.20250204" }, @@ -1549,6 +1553,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/30/3d/64ad57c803f1fa1e963a7946b6e0fea4a70df53c1a7fed304586539c2bac/pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820", size = 343634 }, ] +[[package]] +name = "pytest-cov" +version = "6.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "coverage" }, + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/25/69/5f1e57f6c5a39f81411b550027bf72842c4567ff5fd572bed1edc9e4b5d9/pytest_cov-6.1.1.tar.gz", hash = "sha256:46935f7aaefba760e716c2ebfbe1c216240b9592966e7da99ea8292d4d3e2a0a", size = 66857 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/28/d0/def53b4a790cfb21483016430ed828f64830dd981ebe1089971cd10cab25/pytest_cov-6.1.1-py3-none-any.whl", hash = "sha256:bddf29ed2d0ab6f4df17b4c55b0a657287db8684af9c42ea546b21b1041b3dde", size = 23841 }, +] + [[package]] name = "pytest-django" version = "4.11.1" @@ -1597,6 +1614,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/19/58/5d14cb5cb59409e491ebe816c47bf81423cd03098ea92281336320ae5681/pytest_socket-0.7.0-py3-none-any.whl", hash = "sha256:7e0f4642177d55d317bbd58fc68c6bd9048d6eadb2d46a89307fa9221336ce45", size = 6754 }, ] +[[package]] +name = "pytest-split" +version = "0.10.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/46/d7/e30ba44adf83f15aee3f636daea54efadf735769edc0f0a7d98163f61038/pytest_split-0.10.0.tar.gz", hash = "sha256:adf80ba9fef7be89500d571e705b4f963dfa05038edf35e4925817e6b34ea66f", size = 13903 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/a7/cad88e9c1109a5c2a320d608daa32e5ee008ccbc766310f54b1cd6b3d69c/pytest_split-0.10.0-py3-none-any.whl", hash = "sha256:466096b086a7147bcd423c6e6c2e57fc62af1c5ea2e256b4ed50fc030fc3dddc", size = 11961 }, +] + [[package]] name = "pytest-sugar" version = "1.0.0" From 36e875d661e3cf085aea0922313b7a4b08f7ee5a Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 17:08:26 -0400 Subject: [PATCH 03/11] pass seed between jobs --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1001b361b..2ce64db26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,8 +21,12 @@ permissions: jobs: seed: runs-on: ubuntu-latest + outputs: + seed: ${{ steps.calculate-seed.outputs.seed }} steps: - - run: echo "SEED=$(python3 -c 'import random; print(random.Random().getrandbits(32));')" >> "$GITHUB_ENV" + - name: Create seed + id: calculate-seed + run: echo "seed=$(python3 -c 'import random; print(random.Random().getrandbits(32));')" >> "$GITHUB_OUTPUT" # usage of pytest-split and matrix strategy based on: # https://github.com/jerry-git/pytest-split-gh-actions-demo/blob/master/.github/workflows/test.yml @@ -37,6 +41,7 @@ jobs: DB_ROOT_PASSWORD: "root-password" DB_PASSWORD: "user-password" DB_USER: citest + SEED: ${{ needs.seed.outputs.seed }} container: python:3.12.9-alpine3.20 services: db: From d94a16f0ea0ba23c86cbb24358b09a2d537c5273 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 20:37:26 -0400 Subject: [PATCH 04/11] move coverage settings to dedicated file --- .coveragerc | 36 ++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 5 +++-- setup.cfg | 34 ---------------------------------- 3 files changed, 39 insertions(+), 36 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..4052fab0f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: Copyright (C) 2025 Opal Health Informatics Group at the Research Institute of the McGill University Health Centre +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +[run] +source = opal +omit = + .*, + **/tests/*, + # **/migrations/*, + opal/wsgi.py, + opal/asgi.py, + # omit prod settings + opal/settings_prod.py, + # omit sidebar menu + opal/templates/sidebar_menu.html, + opal/templates/components/menu_group.html, + opal/templates/components/menu_item.html +branch = True +plugins = + django_coverage_plugin + +[report] +fail_under = 100 +precision = 2 +show_missing = True +skip_empty = True +skip_covered = True +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover + # Don't require coverage on TYPE_CHECKING imports + if TYPE_CHECKING: + + # Don't complain if non-runnable code isn't run: + if __name__ == .__main__.: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ce64db26..741734354 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - group: [1, 2, 3, 4] + group: [1, 2, 3, 4, 5, 6] env: DB_ROOT_PASSWORD: "root-password" DB_PASSWORD: "user-password" @@ -95,10 +95,11 @@ jobs: uv run pytest --version # -m "" runs all tests, even the ones marked as slow uv run pytest --cov --cov-fail-under=0 --randomly-seed="$SEED" --splits 4 --group ${{ matrix.group }} -m "" + ls -la - name: Upload coverage uses: actions/upload-artifact@v4.6.2 with: - name: coverage-group-${{ matrix.group }} + name: coverage-${{ matrix.group }} path: .coverage coverage: diff --git a/setup.cfg b/setup.cfg index 5157ed08f..1c59fd834 100644 --- a/setup.cfg +++ b/setup.cfg @@ -44,37 +44,3 @@ warn_unreachable = False [mypy-*.factories] disallow_untyped_calls = False - -[coverage:run] -source = opal -; include = opal/* -omit = - .*, - **/tests/*, - # **/migrations/*, - opal/wsgi.py, - opal/asgi.py, - # omit prod settings - opal/settings_prod.py, - # omit sidebar menu - opal/templates/sidebar_menu.html, - opal/templates/components/menu_group.html, - opal/templates/components/menu_item.html -branch = True -plugins = - django_coverage_plugin - -[coverage:report] -fail_under = 100 -precision = 2 -show_missing = True -skip_empty = True -skip_covered = True -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - # Don't require coverage on TYPE_CHECKING imports - if TYPE_CHECKING: - - # Don't complain if non-runnable code isn't run: - if __name__ == .__main__.: From 60a36ff049789d00cef27f57dd53bd2bdef28a62 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 20:47:21 -0400 Subject: [PATCH 05/11] fix artifact --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 741734354..6a4a0ea54 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - group: [1, 2, 3, 4, 5, 6] + group: [1, 2, 3, 4] env: DB_ROOT_PASSWORD: "root-password" DB_PASSWORD: "user-password" @@ -100,7 +100,8 @@ jobs: uses: actions/upload-artifact@v4.6.2 with: name: coverage-${{ matrix.group }} - path: .coverage + path: ${{ github.workspace }}/.coverage + if-no-files-found: error coverage: needs: pytest From e70cbe07c12c07c3b5a40a27c024ee27d8be0a40 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 20:57:02 -0400 Subject: [PATCH 06/11] include hidden files --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a4a0ea54..016e5e620 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - group: [1, 2, 3, 4] + group: [1, 2, 3, 4, 5, 6] env: DB_ROOT_PASSWORD: "root-password" DB_PASSWORD: "user-password" @@ -94,13 +94,13 @@ jobs: run: | uv run pytest --version # -m "" runs all tests, even the ones marked as slow - uv run pytest --cov --cov-fail-under=0 --randomly-seed="$SEED" --splits 4 --group ${{ matrix.group }} -m "" - ls -la + uv run pytest --cov --cov-fail-under=0 --cov-report= --randomly-seed="$SEED" --splits 6 --group ${{ matrix.group }} -m "" - name: Upload coverage uses: actions/upload-artifact@v4.6.2 with: name: coverage-${{ matrix.group }} - path: ${{ github.workspace }}/.coverage + path: .coverage + include-hidden-files: true if-no-files-found: error coverage: From 55c41f0483573421ef427d818daaa173138d8e34 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 21:13:51 -0400 Subject: [PATCH 07/11] change splitting algorithm --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 016e5e620..412053060 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,7 +94,7 @@ jobs: run: | uv run pytest --version # -m "" runs all tests, even the ones marked as slow - uv run pytest --cov --cov-fail-under=0 --cov-report= --randomly-seed="$SEED" --splits 6 --group ${{ matrix.group }} -m "" + uv run pytest --cov --cov-fail-under=0 --cov-report= --randomly-seed="$SEED" --splitting-algorithm=least_duration --splits 6 --group ${{ matrix.group }} -m "" - name: Upload coverage uses: actions/upload-artifact@v4.6.2 with: From d1da76cff099586016d5ccf02fe30337e6fab6e6 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 21:21:41 -0400 Subject: [PATCH 08/11] test coverage --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 412053060..2ea7408e6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -122,6 +122,9 @@ jobs: uses: actions/download-artifact@v4.2.1 - name: Check coverage run: | - ls -la + pwd + ls -la coverage-* + ls -la opal/ uv run coverage combine coverage*/.coverage* + ls -la uv run coverage report From 47593def78f36aec2efe634c78276fe121d223f9 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 21:29:40 -0400 Subject: [PATCH 09/11] test coverage --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ea7408e6..d903447a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,6 +95,7 @@ jobs: uv run pytest --version # -m "" runs all tests, even the ones marked as slow uv run pytest --cov --cov-fail-under=0 --cov-report= --randomly-seed="$SEED" --splitting-algorithm=least_duration --splits 6 --group ${{ matrix.group }} -m "" + pwd - name: Upload coverage uses: actions/upload-artifact@v4.6.2 with: From 1d60834107ddb1346fa6f947e97784eb5300773a Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 21:38:56 -0400 Subject: [PATCH 10/11] relative file paths --- .coveragerc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.coveragerc b/.coveragerc index 4052fab0f..effdbbcf7 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,6 +4,8 @@ [run] source = opal +# store relative paths to make it easier to combine different coverages +relative_files = True omit = .*, **/tests/*, From b4019e2b64aa4ec5e776b122fdd11b967a7ef71a Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Mon, 7 Apr 2025 21:45:56 -0400 Subject: [PATCH 11/11] reduce groups to 4 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d903447a3..f549fe065 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - group: [1, 2, 3, 4, 5, 6] + group: [1, 2, 3, 4] env: DB_ROOT_PASSWORD: "root-password" DB_PASSWORD: "user-password" @@ -94,7 +94,7 @@ jobs: run: | uv run pytest --version # -m "" runs all tests, even the ones marked as slow - uv run pytest --cov --cov-fail-under=0 --cov-report= --randomly-seed="$SEED" --splitting-algorithm=least_duration --splits 6 --group ${{ matrix.group }} -m "" + uv run pytest --cov --cov-fail-under=0 --cov-report= --randomly-seed="$SEED" --splitting-algorithm=least_duration --splits 4 --group ${{ matrix.group }} -m "" pwd - name: Upload coverage uses: actions/upload-artifact@v4.6.2