From 5f83b4861ee45055250e00e1b9c7f39afecebf8c Mon Sep 17 00:00:00 2001 From: bbhtt Date: Wed, 6 Nov 2024 09:02:44 +0530 Subject: [PATCH] README: add guide to tests --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 650b513f..9a1c292f 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -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: @@ -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 ```