From 8524eb220b2246c41ff71861aa165853b1ad945f Mon Sep 17 00:00:00 2001 From: Hector Cao <122458375+hector-cao@users.noreply.github.com> Date: Wed, 23 Oct 2024 21:55:39 +0200 Subject: [PATCH] tests : improve readme to add instructions to list tests (#250) --- tests/README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/README.md b/tests/README.md index dbb0b4f..018d73b 100644 --- a/tests/README.md +++ b/tests/README.md @@ -18,7 +18,7 @@ $ sudo apt install python3 - The guest image must enable ssh server with password-based authentication for `root` user. The root user password must be `123456` -### Run tests with pytest +### Run tests with tox/pytest Go to the `tests` folder. @@ -66,6 +66,27 @@ Please note that the performance tests can take a long time (order of magnitude $ sudo -E tox -e test_all ``` +To list tests without running: + +``` +sudo -E tox -e collect_tests -- EXPRESSION +``` + +`EXPRESSION` is the expression provided to the argument `-k` of `pytest`. +For more details on its format, you can refer to `pytest` help page. + +For example: + +``` +sudo -E tox -e collect_tests -- 'test_guest or test_stress' +``` + +To run tests matching an expression: + +``` +sudo -E tox -e test_specify -- EXPRESSION +``` + ### Run tests with checkbox: Go to the `tests` folder.