Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/python-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
node_version: ["20.14", "22"]
steps:
- uses: actions/checkout@v5
with:
# Fetch full history so diff-cover can compute a merge base with origin/main
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
Expand Down Expand Up @@ -61,7 +64,14 @@ jobs:
run: black . --check --verbose
- name: Run Python tests
if: runner.os != 'Windows'
run: pytest -s -vv --cov --cov-fail-under=89
run: pytest -s -vv --cov --cov-report=xml --cov-fail-under=89
Copy link
Preview

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

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

The minimum coverage requirement is inconsistent. The pytest command still uses --cov-fail-under=89 while the diff-cover step enforces 90% coverage. This could cause confusion and inconsistent behavior.

Suggested change
run: pytest -s -vv --cov --cov-report=xml --cov-fail-under=89
run: pytest -s -vv --cov --cov-report=xml --cov-fail-under=90

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The main branch doesnt yet have 90% coverage. It will in the upcoming multimodal PR. The two numbers can be different since one measures the total coverage and the other measures the coverage just of changed lines.

- name: Check diff coverage
if: runner.os != 'Windows'
run: |
BASE_REF="${{ github.base_ref }}"
if [ -z "$BASE_REF" ]; then BASE_REF="main"; fi
git fetch origin "$BASE_REF:refs/remotes/origin/$BASE_REF"
diff-cover coverage.xml --compare-branch="origin/$BASE_REF" --fail-under=90
- name: Run E2E tests with Playwright
id: e2e
if: runner.os != 'Windows'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
coverage_report.html

# Translations
*.mo
Expand Down
29 changes: 23 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ contact [[email protected]](mailto:[email protected]) with any additio
- [Running unit tests](#running-unit-tests)
- [Running E2E tests](#running-e2e-tests)
- [Code style](#code-style)
- [Adding new azd environment variables](#adding-new-azd-environment-variables)
- [Adding new UI strings](#adding-new-ui-strings)
- [Adding new features](#adding-new-features)
- [Adding new azd environment variables](#adding-new-azd-environment-variables)
- [Adding new UI strings](#adding-new-ui-strings)

## Submitting a Pull Request (PR)

Expand Down Expand Up @@ -62,10 +63,18 @@ Run the tests:
python -m pytest
```

Check the coverage report to make sure your changes are covered.
If test snapshots need updating (and the changes are expected), you can update them by running:

```shell
python -m pytest --cov
python -m pytest --snapshot-update
```

Once tests are passing, generate a coverage report to make sure your changes are covered:

```shell
pytest --cov --cov-report=xml && \
diff-cover coverage.xml --format html:coverage_report.html && \
open coverage_report.html
```

## Running E2E tests
Expand Down Expand Up @@ -118,7 +127,15 @@ python -m black <path-to-file>

If you followed the steps above to install the pre-commit hooks, then you can just wait for those hooks to run `ruff` and `black` for you.

## Adding new azd environment variables
## Adding new features

We recommend using GitHub Copilot Agent mode when adding new features,
as this project includes [.github/copilot-instructions.md](.github/copilot-instructions.md) file
that instructs Copilot on how to generate code for common code changes.

If you are not using Copilot Agent mode, consult both that file and suggestions below.

### Adding new azd environment variables

When adding new azd environment variables, please remember to update:

Expand All @@ -128,7 +145,7 @@ When adding new azd environment variables, please remember to update:
1. [ADO pipeline](.azdo/pipelines/azure-dev.yml).
1. [Github workflows](.github/workflows/azure-dev.yml)

## Adding new UI strings
### Adding new UI strings

When adding new UI strings, please remember to update all translations.
For any translations that you generate with an AI tool,
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ pytest-snapshot
pre-commit
pip-tools
mypy==1.14.1
diff_cover
axe-playwright-python
Loading