#3850 Update Unit-tests instructions in the documentation
Merged 5 years ago by pingou. Opened 5 years ago by jingjing.
jingjing/pagure unit-test-doc  into  master

file modified
+5 -34
@@ -281,24 +281,13 @@ 

  

  * Run it::

  

-      ./runtests.sh

+      python runtests.py run

  

+ You can also use:: 

  

- ``runtests.sh``, located at the top of the sources, helps to run the

- unit-tests of the project with coverage information using `python-nose

- <https://nose.readthedocs.org/>`_.

- 

- 

- .. note:: You can specify additional arguments to the nose command used

-           in this script by just passing arguments to the script.

- 

-           For example you can specify the ``-x`` / ``--stop`` argument:

-           `Stop running tests after the first error or failure` by just doing

- 

-           ::

- 

-             ./runtests.sh --stop

+      python runtests.py  --help 

  

+ to see other options supported.

  

  Each unit-tests files (located under ``tests/``) can be called

  by alone, allowing easier debugging of the tests. For example:
@@ -307,24 +296,6 @@ 

  

    python tests/test_pagure_lib.py

  

- or using:

- 

- ::

- 

-   ./runtests.sh tests/test_pagure_lib.py

- 

- If you with to run a single test, you can use the following structure:

- 

- ::

- 

-   ./runtests.sh <file>:ClassName.method

- 

- For example:

- 

- ::

- 

-   ./runtests.sh tests/test_pagure_lib.py:PagureLibtests_search_user.test_search_user_username

- 

  

  .. note:: In order to have coverage information you might have to install

            ``python-coverage``
@@ -345,7 +316,7 @@ 

      $ ./dev/run-tests-docker.py

  

  This command will build a fedora based container and execute the test suite. You can also

- limit the tests to unit-test files or single tests similar to the ``./runtests.sh`` 

+ limit the tests to unit-test files or single tests similar to the ``python runtests.py`` 

  options described above.

  

  

@pingou Please kindly help to review:-)

I'd say to see rather than to get. Also, I'm not sure we should list them, we indicate how to find them and listing them it taking the risk to quickly get outdated as more actions/options are added.
What do you think?

rebased onto 66174b5

5 years ago

@pingou
Thanks for your review, that makes sense. I have updated the PR.

Looks good to me, thanks! :)
I'll do the rebase and merge manually to save you the troubles (I try to keep pagure's history linear so I only do fast-forward merges)

Commit d6ad128 fixes this pull-request

Pull-Request has been merged by pingou

5 years ago