Updated coverage docs, script

This commit is contained in:
kdmukai
2024-11-06 14:00:36 -06:00
parent 8eb886db67
commit 3e068b0f4f
3 changed files with 12 additions and 16 deletions
-2
View File
@@ -47,8 +47,6 @@ exclude_lines = [
omit = [
"*/__init__.py",
"*/tests/*",
"*/hardware/*",
"*/pyzbar/*",
]
skip_covered = false
skip_empty = true
+3 -9
View File
@@ -67,23 +67,17 @@ Run tests and generate test coverage
coverage run -m pytest
```
The screenshots have to be run separately, but they can also add to overall coverage:
The screenshots can generate their own separate coverage report:
```bash
coverage run -m pytest tests/screenshot_generator/generator.py --locale es
```
Each run creates its own `.coverage.*` results file. Merge them into one result with:
```bash
coverage combine
```
Show the resulting test coverage details:
```bash
coverage report
```
Generate the html overview:
Generate the interactive html report:
```bash
coverage html
```
```
+9 -5
View File
@@ -1,15 +1,19 @@
#!/bin/bash
# Run the full test suite
coverage run -m pytest
# Clean up any prior coverage results
coverage erase
# Run the full test suite; `--parallel` writes coverage results to a separate file
# (otherwise it'll be overwritten in the next step)
coverage run --parallel -m pytest
# Generate screenshots (only need to run for one locale to assess coverage)
coverage run -m pytest tests/screenshot_generator/generator.py --locale es
coverage run --parallel -m pytest tests/screenshot_generator/generator.py --locale es
# Combine the above coverage results; also cleans up any prior .coverage.* results files
# Combine the above coverage results
coverage combine
# Show the cli report
# Show the report in the terminal
coverage report
# Generate the interactive html report