diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 4fd220a3d8..0000000000 --- a/.coveragerc +++ /dev/null @@ -1,20 +0,0 @@ -[run] - -omit = - **/src/archivematicaCommon/lib/externals/* - **/migrations/* - **/south_migrations/* - **/management/commands/* - **/settings/* - **/tests/* - **/wsgi.py - **/manage.py - -source = - **/src/archivematicaCommon/lib/ - **/src/dashboard/src/ - **/src/MCPClient/lib/ - **/src/MCPClient/lib/clientScripts/ - **/src/MCPServer/lib/ - -branch = True diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 997335aa75..829cf25559 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,7 +90,7 @@ jobs: make -C hack/ test-${{ matrix.rule }} env: TOXARGS: -vv - PYTEST_ADDOPTS: -vv --cov /src/src/ --cov-config=/src/.coveragerc --cov-report xml:/src/coverage.xml + PYTEST_ADDOPTS: -vv --cov --cov-config=/src/pyproject.toml --cov-report xml:/src/coverage.xml PYTHON_VERSION: ${{ matrix.python-version }} - name: "Upload coverage report" if: matrix.rule != 'storage-service' && matrix.rule != 'migrations' && github.repository == 'artefactual/archivematica' diff --git a/pyproject.toml b/pyproject.toml index d2e418aee0..ea2f1907fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,26 @@ addopts = "--reuse-db -p no:cacheprovider" DJANGO_SETTINGS_MODULE="settings.test" norecursedirs = ".svn _build tmp* node_modules bower_components share .tox" +[tool.coverage.run] +omit = [ + "**/src/archivematicaCommon/lib/externals/*", + "**/migrations/*", + "**/south_migrations/*", + "**/management/commands/*", + "**/settings/*", + "**/tests/*", + "**/wsgi.py", + "**/manage.py", +] +include = [ + "**/src/archivematicaCommon/lib/*", + "**/src/dashboard/src/*", + "**/src/MCPClient/lib/*", + "**/src/MCPClient/lib/clientScripts/*", + "**/src/MCPServer/lib/*", +] +branch = true + [tool.ruff.lint] # Rule reference: https://docs.astral.sh/ruff/rules/ select = [ diff --git a/requirements-dev.in b/requirements-dev.in index 30b25fd83d..76c381b58a 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -1,6 +1,6 @@ -r requirements.txt -coverage +coverage[toml] git+https://github.com/artefactual-labs/mockldap@v0.3.1#egg=mockldap pip-tools pytest