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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
coverage-report-*.md
*.cover
*.py.cover
.hypothesis/
Expand Down
21 changes: 20 additions & 1 deletion docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,26 @@ recent version of Python (as defined in `pyproject.toml` under `project.requires
- `hatch run test:test` - Run unit tests with coverage
- `hatch run test:test tests/test_bootstrapper.py` - Run specific test files
- `hatch run test:test -k "test_metadata"` - Run tests with custom args
- `hatch run test:coverage-report` - Generate coverage report
- `hatch run test:coverage-erase` - Clean old coverage data
- `hatch run test:coverage-report` - Combine and generate markdown coverage report (saved to `coverage-report-<timestamp>.md`)

• **Coverage Report:**

To generate a coverage report that includes both unit and e2e tests:

```bash
hatch run test:coverage-erase # Clean old coverage data
hatch run test:test # Run unit tests (collects coverage)
./e2e/run_all.sh # Run all e2e tests (collects coverage)
hatch run test:coverage-report # Combine and generate markdown report
```

The report is printed to the terminal and saved to a timestamped file
(`coverage-report-YYYYMMDD-HHMMSS.md`). For unit-test-only coverage,
skip the `run_all.sh` step. To run a single e2e suite instead of all,
replace `run_all.sh` with one of: `ci_bootstrap_suite.sh`,
`ci_bootstrap_parallel_suite.sh`, `ci_build_suite.sh`, `ci_config_suite.sh`,
`ci_specialized_suite.sh`, `ci_workflow_suite.sh`.

• **Linting & Code Quality:**

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ features = ["test"]

[tool.hatch.envs.test.scripts]
test = "python -m coverage run -m pytest --log-level DEBUG -vv {args:tests}"
coverage-report = ["coverage combine", "coverage report --format=markdown"]
coverage-erase = "coverage erase"
coverage-combine = "coverage combine"
coverage-report = ["coverage combine", "coverage report --format=markdown | tee coverage-report-$(date +%Y%m%d-%H%M%S).md"]

[tool.hatch.envs.lint]
description = "Run linters."
Expand Down
Loading