You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/FUNCTIONAL_TESTING.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,3 @@
1
-
**Note: The current implementation of functional tests is broken and requires updating.**
2
-
3
1
## Functional testing
4
2
5
3
During functional testing the program is tested as a whole. This is much like if the testing were made by a human. Although the user interface parts are not tested the core of the program is tested and how the different program components work together. When functional tests succeed that means that the tested scenarios will most likely work properly when the program is run by real users. The quality of total testing obviously depends on the amount and quality of individual tests.
@@ -28,11 +26,11 @@ Technically NServ is integrated into NZBGet as a sub-module. NServ is automatica
28
26
29
27
## Testing framework
30
28
31
-
Functional tests for NZBGet are written in python language. We are using testing framework [py.test](https://pytest.org) to organize test execution and collect test results. Therefore in order to run functional tests py.test[must be installed](https://docs.pytest.org/en/latest/getting-started.html) on your system.
29
+
Functional tests for NZBGet are written in python language (Python 3). We are using testing framework [pytest](https://pytest.org) to organize test execution and collect test results. Therefore in order to run functional tests pytest[must be installed](https://docs.pytest.org/en/latest/getting-started.html) on your system.
32
30
33
31
## Running tests
34
32
35
-
Functional tests and supporting modules are stored in directory `tests/functional`. To run tests open command prompt in this directory and execute `py.test` as explained below.
33
+
Functional tests and supporting modules are stored in directory `tests/functional`. To run tests open command prompt in this directory and execute `pytest` as explained below.
36
34
37
35
### Configuring tests
38
36
@@ -55,33 +53,37 @@ All settings in the ini-file are optional.
55
53
When executing the tests for the first time the test scripts prepare test files and put them into directory `tests/testdata/nserv.temp`. These files take several gigabytes and may need several minutes to generate. When starting tests for the first time it’s recommended to add parameter `-s` to see additional progress logging during preparation stage:
56
54
57
55
```bash
58
-
py.test -v -s
56
+
pytest -v -s
59
57
```
60
58
61
59
### Executing tests
62
60
63
61
To run all tests use simple command:
64
62
65
63
```bash
66
-
py.test -v
64
+
pytest -v
67
65
```
68
66
69
67
To run tests from one test script only pass the specific file name:
70
68
71
69
```bash
72
-
py.test -v parcheck\parcheck_force_test.py
70
+
pytest -v parcheck/parcheck_force_test.py
73
71
```
74
72
75
73
To execute only one specific test pass the file name and test function name:
For more filter possibilities please see [py.test](https://docs.pytest.org/en/latest/usage.html) documentation.
79
+
For more filter possibilities please see [pytest](https://docs.pytest.org/en/latest/usage.html) documentation.
82
80
83
81
### Test failures
84
82
85
83
Directory used by NZBGet during testing (`tests/testdata/nzbget.temp` by default) is automatically deleted if all tests succeed. If a test fails the directory is kept in order to preserve log-files and queue-files for failure analysis. However during testing NZBGet is started and stopped multiple times. If the failed test wasn’t the last test the preserved NZBGet directory may not contain data of the failed test. In such case it’s better to rerun the specific failed test as the only test (using specific command line).
86
84
87
85
After test completion NZBGet is terminated. To analyze a test failure it can be useful to have NZBGet running, for example to inspect the state in web-interface. Pass extra parameter `--hold` to achieve this:
0 commit comments