From bae57f2ae85cfe121005af9c0ff50bc48f4aa199 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Fri, 27 Mar 2020 20:32:47 -0700 Subject: [PATCH] spack test: update existing docs for moved unit-test cmd --- lib/spack/docs/contribution_guide.rst | 32 +++++++++++++-------------- lib/spack/docs/developer_guide.rst | 5 +++-- lib/spack/docs/extensions.rst | 5 +++-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/spack/docs/contribution_guide.rst b/lib/spack/docs/contribution_guide.rst index 37cf9091bd4..8df8ad65baf 100644 --- a/lib/spack/docs/contribution_guide.rst +++ b/lib/spack/docs/contribution_guide.rst @@ -74,7 +74,7 @@ locally to speed up the review process. We currently test against Python 2.6, 2.7, and 3.5-3.7 on both macOS and Linux and perform 3 types of tests: -.. _cmd-spack-test: +.. _cmd-spack-unit-test: ^^^^^^^^^^ Unit Tests @@ -96,7 +96,7 @@ To run *all* of the unit tests, use: .. code-block:: console - $ spack test + $ spack unit-test These tests may take several minutes to complete. If you know you are only modifying a single Spack feature, you can run subsets of tests at a @@ -105,13 +105,13 @@ time. For example, this would run all the tests in .. code-block:: console - $ spack test lib/spack/spack/test/architecture.py + $ spack unit-test lib/spack/spack/test/architecture.py And this would run the ``test_platform`` test from that file: .. code-block:: console - $ spack test lib/spack/spack/test/architecture.py::test_platform + $ spack unit-test lib/spack/spack/test/architecture.py::test_platform This allows you to develop iteratively: make a change, test that change, make another change, test that change, etc. We use `pytest @@ -121,29 +121,29 @@ pytest docs `_ for more details on test selection syntax. -``spack test`` has a few special options that can help you understand -what tests are available. To get a list of all available unit test -files, run: +``spack unit-test`` has a few special options that can help you +understand what tests are available. To get a list of all available +unit test files, run: -.. command-output:: spack test --list +.. command-output:: spack unit-test --list :ellipsis: 5 -To see a more detailed list of available unit tests, use ``spack test ---list-long``: +To see a more detailed list of available unit tests, use ``spack +unit-test --list-long``: -.. command-output:: spack test --list-long +.. command-output:: spack unit-test --list-long :ellipsis: 10 And to see the fully qualified names of all tests, use ``--list-names``: -.. command-output:: spack test --list-names +.. command-output:: spack unit-test --list-names :ellipsis: 5 You can combine these with ``pytest`` arguments to restrict which tests you want to know about. For example, to see just the tests in ``architecture.py``: -.. command-output:: spack test --list-long lib/spack/spack/test/architecture.py +.. command-output:: spack unit-test --list-long lib/spack/spack/test/architecture.py You can also combine any of these options with a ``pytest`` keyword search. See the `pytest usage docs @@ -151,7 +151,7 @@ search. See the `pytest usage docs for more details on test selection syntax. For example, to see the names of all tests that have "spec" or "concretize" somewhere in their names: -.. command-output:: spack test --list-names -k "spec and concretize" +.. command-output:: spack unit-test --list-names -k "spec and concretize" By default, ``pytest`` captures the output of all unit tests, and it will print any captured output for failed tests. Sometimes it's helpful to see @@ -161,7 +161,7 @@ argument to ``pytest``: .. code-block:: console - $ spack test -s --list-long lib/spack/spack/test/architecture.py::test_platform + $ spack unit-test -s --list-long lib/spack/spack/test/architecture.py::test_platform Unit tests are crucial to making sure bugs aren't introduced into Spack. If you are modifying core Spack libraries or adding new @@ -176,7 +176,7 @@ how to write tests! You may notice the ``share/spack/qa/run-unit-tests`` script in the repository. This script is designed for CI. It runs the unit tests and reports coverage statistics back to Codecov. If you want to - run the unit tests yourself, we suggest you use ``spack test``. + run the unit tests yourself, we suggest you use ``spack unit-test``. ^^^^^^^^^^^^ Flake8 Tests diff --git a/lib/spack/docs/developer_guide.rst b/lib/spack/docs/developer_guide.rst index 1341a196b46..e3253a92005 100644 --- a/lib/spack/docs/developer_guide.rst +++ b/lib/spack/docs/developer_guide.rst @@ -364,10 +364,11 @@ Developer commands ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ -``spack test`` +``spack unit-test`` ^^^^^^^^^^^^^^ -See the :ref:`contributor guide section ` on ``spack test``. +See the :ref:`contributor guide section ` on +``spack unit-test``. .. _cmd-spack-python: diff --git a/lib/spack/docs/extensions.rst b/lib/spack/docs/extensions.rst index c71a6511edc..15c59c76ef4 100644 --- a/lib/spack/docs/extensions.rst +++ b/lib/spack/docs/extensions.rst @@ -87,11 +87,12 @@ will be available from the command line: --implicit select specs that are not installed or were installed implicitly --output OUTPUT where to dump the result -The corresponding unit tests can be run giving the appropriate options to ``spack test``: +The corresponding unit tests can be run giving the appropriate options +to ``spack unit-test``: .. code-block:: console - $ spack test --extension=scripting + $ spack unit-test --extension=scripting ============================================================== test session starts =============================================================== platform linux2 -- Python 2.7.15rc1, pytest-3.2.5, py-1.4.34, pluggy-0.4.0