mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-10-05 15:08:25 +00:00
Merge pytest results and screenshot generator coverage
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ src/seedsigner.egg-info/
|
||||
.vscode
|
||||
src/seedsigner/models/settings_definition.json
|
||||
.idea
|
||||
.coverage
|
||||
.coverage*
|
||||
seedsigner-screenshots
|
||||
|
||||
*.po
|
||||
|
||||
@@ -55,6 +55,7 @@ skip_empty = true
|
||||
|
||||
[tool.coverage.run]
|
||||
branch = true
|
||||
parallel = true
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
|
||||
+22
-4
@@ -45,18 +45,36 @@ Annoying complications:
|
||||
* Better idea: use a proper logger in the test file and use one of the above options to display logs
|
||||
|
||||
|
||||
### Test Coverage
|
||||
## Screenshot generator
|
||||
The screenshot generator is meant to mostly be a utility and not really part of the test suite. However,
|
||||
it is actually implemented to be run by `pytest`.
|
||||
|
||||
see: [Screenshot generator README](screenshot_generator/README.md)
|
||||
|
||||
|
||||
## Test Coverage
|
||||
Run tests and generate test coverage
|
||||
```
|
||||
```bash
|
||||
coverage run -m pytest
|
||||
```
|
||||
|
||||
Show the resulting test coverage details:
|
||||
The screenshots have to be run separately, but they can also add to overall coverage:
|
||||
|
||||
```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:
|
||||
```
|
||||
```bash
|
||||
coverage html
|
||||
```
|
||||
|
||||
@@ -11,7 +11,8 @@ pytest tests/screenshot_generator/generator.py
|
||||
|
||||
You can also run a `coverage` report to see exactly what the screenshots are and are not hitting:
|
||||
```bash
|
||||
coverage run -m pytest tests/screenshot_generator/generator.py --locale es && coverage report
|
||||
coverage erase
|
||||
coverage run -m pytest tests/screenshot_generator/generator.py --locale es && coverage combine && coverage report
|
||||
|
||||
# Generate the interactive html report
|
||||
coverage html
|
||||
|
||||
Reference in New Issue
Block a user