From 9e5abb96bc65a23f8f8df5bba568e910f6b41563 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 23 Oct 2025 21:52:41 +0200 Subject: [PATCH 1/3] Document how to run the tests inside the container --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index e116671..647c1b5 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 tool postinstall` like for the other container. + +To run the tests, supposing you already have run `./ynh-dev use-git PKG`, inside the container, you may run: + +```bash +./ynh-dev test PKG +``` + +Say you want to run all the Python tests of Yunohost (not the bash helpers tests though): + +```bash +./ynh-dev test yunohost +``` + +Or specifically the test file `tests/test_appurl.py`: + +```bash +./ynh-dev test yunohost appurl +``` + +Or even exclusively the test function named `test_urlavailable()` inside that test file: +```bash +./ynh-dev test yunohost/appurl:urlavailable +``` + +Note that `./ynh-dev test` will install all the required dependencies (`pip`, `pytest`, `mock`) for you. + ### Advanced: using snapshots You can check `incus snapshot --help` to learn how to manage incus snapshots. From e6954336268afe1a34d2937935fb973af6274bfb Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 27 Oct 2025 08:53:29 +0100 Subject: [PATCH 2/3] Reword some part of the 5th chapter --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 647c1b5..ebbe526 100644 --- a/README.md +++ b/README.md @@ -244,30 +244,31 @@ In packages like `yunohost`, you have automated non-regression tests at your dis > > And run `yunohost tool postinstall` like for the other container. -To run the tests, supposing you already have run `./ynh-dev use-git PKG`, inside the container, you may run: +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 ``` -Say you want to run all the Python tests of Yunohost (not the bash helpers tests though): +For example, to run all Python tests for Yunohost (excluding bash helper tests): ```bash ./ynh-dev test yunohost ``` -Or specifically the test file `tests/test_appurl.py`: +To run tests for a specific file, such as `tests/test_appurl.py`: ```bash ./ynh-dev test yunohost appurl ``` -Or even exclusively the test function named `test_urlavailable()` inside that test file: +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` will install all the required dependencies (`pip`, `pytest`, `mock`) for you. +Note that `./ynh-dev test` automatically installs the necessary dependencies (`pip`, `pytest`, `mock`) for test execution. ### Advanced: using snapshots From b2b562f3a61a9636e98fa3d2889374b43c725a3b Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 2 Jan 2026 13:28:17 +0100 Subject: [PATCH 3/3] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ebbe526..df3687f 100644 --- a/README.md +++ b/README.md @@ -242,7 +242,7 @@ In packages like `yunohost`, you have automated non-regression tests at your dis > ./ynh-dev start bookworm ynh-test > ``` > -> And run `yunohost tool postinstall` like for the other container. +> 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: