diff --git a/README.md b/README.md index e116671..df3687f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Please report issues on the following repository: [!TIP] +> You might be interested in creating a separate incus container to run your tests than for the one you use for packages +> +> In such case, you may initiate or attach the container with a specific name, like: +> +> ```bash +> ./ynh-dev start bookworm ynh-test +> ``` +> +> And run `yunohost tools postinstall` like for the other container. + +To run the tests, assuming you have already run `./ynh-dev use-git PKG` within the container, you can use the following command: + +```bash +./ynh-dev test PKG +``` + +For example, to run all Python tests for Yunohost (excluding bash helper tests): + +```bash +./ynh-dev test yunohost +``` + +To run tests for a specific file, such as `tests/test_appurl.py`: + +```bash +./ynh-dev test yunohost appurl +``` + +Or, to run a specific test function, like `test_urlaavailable()` within the `tests/test_appurl.py` file: + +```bash +./ynh-dev test yunohost/appurl:urlavailable +``` + +Note that `./ynh-dev test` automatically installs the necessary dependencies (`pip`, `pytest`, `mock`) for test execution. + ### Advanced: using snapshots You can check `incus snapshot --help` to learn how to manage incus snapshots.