Show More
@@ -1,61 +1,58 b'' | |||||
1 |
|
1 | |||
2 | .. _test-unit-and-functional: |
|
2 | .. _test-unit-and-functional: | |
3 |
|
3 | |||
4 | =========================== |
|
4 | =========================== | |
5 | Unit and Functional Tests |
|
5 | Unit and Functional Tests | |
6 | =========================== |
|
6 | =========================== | |
7 |
|
7 | |||
8 |
|
8 | |||
9 |
|
9 | |||
10 | py.test based test suite |
|
10 | py.test based test suite | |
11 | ======================== |
|
11 | ======================== | |
12 |
|
12 | |||
13 |
|
13 | |||
14 | The test suite is in the folder :file:`rhodecode/tests/` and should be run with |
|
14 | The test suite is in the folder :file:`rhodecode/tests/` and should be run with | |
15 | the test runner `py.test` inside of your `nix-shell` environment:: |
|
15 | the test runner `py.test` inside of your `nix-shell` environment:: | |
16 |
|
16 | |||
17 | # In case you need the cythonized version |
|
|||
18 | CYTHONIZE=1 python setup.py develop --prefix=$tmp_path |
|
|||
19 |
|
||||
20 | py.test rhodecode |
|
17 | py.test rhodecode | |
21 |
|
18 | |||
22 |
|
19 | |||
23 |
|
20 | |||
24 | py.test integration |
|
21 | py.test integration | |
25 | ------------------- |
|
22 | ------------------- | |
26 |
|
23 | |||
27 | The integration with the test runner is based on the following three parts: |
|
24 | The integration with the test runner is based on the following three parts: | |
28 |
|
25 | |||
29 | - `pytest_pylons` is a py.test plugin which does the integration with the |
|
26 | - `pytest_pylons` is a py.test plugin which does the integration with the | |
30 | Pylons web framework. It sets up the Pylons environment based on the given ini |
|
27 | Pylons web framework. It sets up the Pylons environment based on the given ini | |
31 | file. |
|
28 | file. | |
32 |
|
29 | |||
33 | Tests which depend on the Pylons environment to be set up must request the |
|
30 | Tests which depend on the Pylons environment to be set up must request the | |
34 | fixture `pylonsapp`. |
|
31 | fixture `pylonsapp`. | |
35 |
|
32 | |||
36 | - :file:`rhodecode/tests/plugin.py` contains the integration of py.test with |
|
33 | - :file:`rhodecode/tests/plugin.py` contains the integration of py.test with | |
37 | RhodeCode Enterprise itself. |
|
34 | RhodeCode Enterprise itself. | |
38 |
|
35 | |||
39 | - :file:`conftest.py` plugins are used to provide a special integration for |
|
36 | - :file:`conftest.py` plugins are used to provide a special integration for | |
40 | certain groups of tests based on the directory location. |
|
37 | certain groups of tests based on the directory location. | |
41 |
|
38 | |||
42 |
|
39 | |||
43 |
|
40 | |||
44 | VCS backend selection |
|
41 | VCS backend selection | |
45 | --------------------- |
|
42 | --------------------- | |
46 |
|
43 | |||
47 | The py.test integration provides a parameter `--backends`. It will skip all |
|
44 | The py.test integration provides a parameter `--backends`. It will skip all | |
48 | tests which are marked for other backends. |
|
45 | tests which are marked for other backends. | |
49 |
|
46 | |||
50 | To run only Subversion tests:: |
|
47 | To run only Subversion tests:: | |
51 |
|
48 | |||
52 | py.test rhodecode --backends=svn |
|
49 | py.test rhodecode --backends=svn | |
53 |
|
50 | |||
54 |
|
51 | |||
55 |
|
52 | |||
56 | Frontend / Styling support |
|
53 | Frontend / Styling support | |
57 | ========================== |
|
54 | ========================== | |
58 |
|
55 | |||
59 | All relevant style components have an example inside of the "Style" section |
|
56 | All relevant style components have an example inside of the "Style" section | |
60 | within the application. Enable the setting `debug_style` to make this section |
|
57 | within the application. Enable the setting `debug_style` to make this section | |
61 | visible in your local instance of the application. |
|
58 | visible in your local instance of the application. |
General Comments 0
You need to be logged in to leave comments.
Login now