Queue Services (emailer and DBC): Add pytest ini with addopts for code cov GHA fix#4134
Queue Services (emailer and DBC): Add pytest ini with addopts for code cov GHA fix#4134loneil wants to merge 1 commit intobcgov:mainfrom
Conversation
Signed-off-by: Lucas <lucasoneil@gmail.com>
|
There was a problem hiding this comment.
Pull request overview
This PR centralises the --cov=src pytest flag into the [tool.pytest.ini_options] section of each service's pyproject.toml, so that coverage is enabled automatically for all pytest invocations (including in GitHub Actions). This is intended to fix a code-coverage issue in the GHA workflow. The business-digital-credentials Makefile test target is updated to remove the now-redundant --cov=src CLI flag.
Changes:
- Added
[tool.pytest.ini_options]withaddopts = "--cov=src"tobusiness-emailer/pyproject.tomlandbusiness-digital-credentials/pyproject.toml. - Updated
business-digital-credentials/Makefiletesttarget to remove the CLI-level--cov=src(and--cov-report=term) flags, now handled byaddopts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
queue_services/business-emailer/pyproject.toml |
Adds [tool.pytest.ini_options] section with addopts = "--cov=src" |
queue_services/business-digital-credentials/pyproject.toml |
Adds [tool.pytest.ini_options] section with addopts = "--cov=src" |
queue_services/business-digital-credentials/Makefile |
Removes the now-redundant --cov=src (and --cov-report=term) flags from the test target |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Emailer is still failing the step because it's below 80% coverage, but the coverage is actually working now, so can shore up unit tests on that later. |



Issue #: N/A
Description of changes:
Noticed while looking at PRs the queue services
were failing a step because code coverage Action wasn't able to get a coverage file. This is because the pytest step in the workflow just runs
so it's up to the individual services to actually supply the
--covarg. Added it for these 2 with pytest ini in pyproject (same as all the others do)Didn't bump version number since it doesn't actually affect distribution artifacts, just pytest.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).