Skip to content

Commit

Permalink
README: add guide to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bbhtt committed Nov 6, 2024
1 parent be4a31c commit 5f83b48
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ After making changes to any dependencies run
`poetry lock --no-update` to regenerate the lockfile and
`poetry install --sync` to synchronise the virtual environment.

When adding new checks, please do not increase the minimum requirements
set in `{builddir, repo}/min_success_metadata`.

The virtual enviroment can be listed with `poetry env list` and removed
with `poetry env remove flatpak-builder-lint-xxxxxxxx-py3.xx`.

Expand Down Expand Up @@ -157,6 +160,8 @@ poetry run pre-commit run --all-files
poetry run pre-commit uninstall
```

### Tests

[Pytest](https://docs.pytest.org/en/stable/getting-started.html) is used
to run tests:

Expand All @@ -176,6 +181,17 @@ git repository using
NO_CLEAN_UP=1 ./tests/flatmanager.sh
```

To write tests for manifest checks, recreate a minimal Flatpak builder
manifest with the cases to check against and put it in `tests/manifests`.
Then add the test using it (or modify the existing tests) in
`tests/test_manifest.py`.

Similarly to add a test for builddir check, recreate the `metadata` file
and the build directory contents that Flatpak builder creates. Then
put it in `tests/builddir` and add the test in `tests/test_builddir.py`.
Please avoid adding large files or binary files that aren't readable
(compressed appstream catalogue data is fine).

## Usage

```
Expand Down

0 comments on commit 5f83b48

Please sign in to comment.