Skip to content

Queue Services (emailer and DBC): Add pytest ini with addopts for code cov GHA fix#4134

Open
loneil wants to merge 1 commit intobcgov:mainfrom
loneil:chore/fixCodeCovAction
Open

Queue Services (emailer and DBC): Add pytest ini with addopts for code cov GHA fix#4134
loneil wants to merge 1 commit intobcgov:mainfrom
loneil:chore/fixCodeCovAction

Conversation

@loneil
Copy link
Collaborator

@loneil loneil commented Mar 4, 2026

Issue #: N/A

Description of changes:
Noticed while looking at PRs the queue services

  • business-digital-credentials
  • business-emailer

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

ARGS="--cov-report=term --cov-report=xml"
CMD="poetry run pytest"    # (or uv/plain pytest based on tool detection)

so it's up to the individual services to actually supply the --cov arg. 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).

Signed-off-by: Lucas <lucasoneil@gmail.com>
Copilot AI review requested due to automatic review settings March 4, 2026 00:49
@loneil loneil self-assigned this Mar 4, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] with addopts = "--cov=src" to business-emailer/pyproject.toml and business-digital-credentials/pyproject.toml.
  • Updated business-digital-credentials/Makefile test target to remove the CLI-level --cov=src (and --cov-report=term) flags, now handled by addopts.

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.

@loneil
Copy link
Collaborator Author

loneil commented Mar 4, 2026

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.

@loneil loneil changed the title Add pytest ini with addopts for code cov GHA fix Queue Services (emailer and DBC): Add pytest ini with addopts for code cov GHA fix Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants