Adds coverage convenience script

This commit is contained in:
kdmukai
2024-11-06 09:49:36 -06:00
parent ae96508ac3
commit 03274aa918
3 changed files with 27 additions and 2 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ omit = [
"*/tests/*",
"*/pyzbar/*",
]
skip_covered = true
skip_covered = false
skip_empty = true
[tool.coverage.run]
+10 -1
View File
@@ -2,6 +2,7 @@
The tests are designed to be run on non-Raspi hardware.
## Setup
On your testing machine you'll have to install:
```bash
# general dependencies
@@ -16,6 +17,14 @@ Then make the `seedsigner` python module visible/importable to the tests by inst
pip3 install -e .
```
## Running all tests, calculating overall test coverage
tldr: just run the convenience script from the project root:
```bash
./tests/run_full_coverage.sh
```
## Running tests manually
Run the whole test suite:
```
pytest
@@ -52,7 +61,7 @@ it is actually implemented to be run by `pytest`.
see: [Screenshot generator README](screenshot_generator/README.md)
## Test Coverage
## Generate coverage manually
Run tests and generate test coverage
```bash
coverage run -m pytest
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
# Run the full test suite
coverage run -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
# Combine the above coverage results; also cleans up any prior .coverage.* results files
coverage combine
# Show the cli report
coverage report
# Generate the interactive html report
coverage html