tests: Improve handling of tests skipped by default

- Create the 'heavy' mark for tests that take long to run.
- Skip the tests marked as 'heavy' by default.
- Enable functional and heavy tests by setting the environment variable
  EXTENDED_TESTING=1.
- Update HACKING.md accordingly.

Signed-off-by: Fioddor Superconcentrado <fioddor@gmail.com>
[sunil: Minor indentation]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Fioddor Superconcentrado authored and Sunil Mohan Adapa committed 2021-10-10 19:22:13 -07:00
1 parent 4b708214e4
commit cb539cf1e8
3 files changed
+49 -14

No files matched your search

+24 -1
View File
@@ -338,7 +338,7 @@ For more information on translations: https://wiki.debian.org/FreedomBox/Transla
### Running Tests
To run all the tests in the container/VM:
To run all the standard unit tests in the container/VM:
```bash
guest$ py.test-3
@@ -369,6 +369,29 @@ guest$ py.test-3 plinth/tests/test_actions.py::TestActions
guest$ py.test-3 plinth/tests/test_actions.py::TestActions::test_is_package_manager_busy
```
Some tests are skipped by default:
* tests that need root privileges,
* functional tests (they need additional preparation to run. See next section),
* tests that take much time to run.
Use `sudo` to run the ones that need root access:
```bash
guest$ sudo py.test-3
```
To force functional tests and tests that take long to run, set the environment
variable EXTENDED_TESTING=1:
```bash
guest$ EXTENDED_TESTING=1 py.test-3
```
To really run all tests, combine sudo with EXTENDED_TESTING:
```bash
guest$ sudo EXTENDED_TESTING=1 py.test-3
```
### Running the Test Coverage Analysis
To run the coverage tool in the container/VM: