Skip to content

Commit

Permalink
Minor update to docs to reflect nox usage.
Browse files Browse the repository at this point in the history
Refs #55804
  • Loading branch information
s0undt3ch authored and dwoz committed Jun 9, 2020
1 parent a848ea1 commit e910798
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
40 changes: 23 additions & 17 deletions doc/topics/development/tests/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ run these tests. Nox is used to manage all of the test python dependencies.
When you run the test runner with nox, you will be installing the same
python dependencies that we use to run our test suite on PRs and branch tests.
`Kitchen Salt`_ is used to spin up our virtual machines based off of golden
images. These virtual machines use the `salt-jenkins` sls states to configure
images. These virtual machines use the `salt-jenkins`_ sls states to configure
any system dependencies.

To learn the basics of how Salt's test suite works, be sure to check
Expand All @@ -25,16 +25,11 @@ and spins up the different nox sessions. You can look at the ``noxfile.py``
in the salt repo to view all of the current nox configurations. In that file
you will notice various nox sessions. When creating each of these sessions,
nox will create a virtualenv with the specified interpreter. Once the virtualenv
is created it will also install all of the required python dependencies required for
that session and run the tests.
is created it will also install all of the required python dependencies
required for that session and run the tests.

.. warning::
Please note that you need to ensure to install `nox-py2` and not `nox` regardles of
installing Python 2 or Python 3 as these two libraries are incompatibile. Salt needs
to use `nox-py2` to ensure Python 2 support.

For example if you want to run all of the tests using the zeromq transport on python3
you would need to specify the zeromq transport and python3.
For example if you want to run all of the tests using the zeromq transport on
python3 you would need to specify the zeromq transport and python3.

.. code-block:: bash
Expand All @@ -60,9 +55,10 @@ repo or you can manually install the dependency yourself.

System Dependencies
===================
The system dependencies are installed from the `salt-jenkins`_ repo. The ``git.minimal``
states are what is run to determine what dependencies to install on which platform.
We run these states only when we want to update our current VM images with new
The system dependencies are installed from the `salt-jenkins`_ repo. The
``golden-images-provision`` state is what is run to determine what dependencies
to install on which platform.
We run this state only when we want to update our current VM images with new
dependencies.

Kitchen Salt
Expand All @@ -80,8 +76,14 @@ similar to the jenkins environment we use to run branch and PR tests.
Test Directory Structure
========================

Salt's test suite is located in the ``tests`` directory in the root of
Salt's codebase. The test suite is divided into two main groups:
Salt's test suite is located in the ``tests/`` directory in the root of
Salt's codebase.

With the migration to PyTest, Salt has created a separate directory for tests
that are written taking advantage of the full pottential of PyTest. These are
located under ``tests/pytests``.

As for the old test suite, it is divided into two main groups:

* :ref:`Integration Tests <integration-tests>`
* :ref:`Unit Tests <unit-tests>`
Expand All @@ -95,6 +97,10 @@ The files that are housed in the ``modules`` directory of either the unit
or the integration testing factions contain respective integration or unit
test files for Salt execution modules.

The PyTest only tests under ``tests/pytests`` should, more or less, follow the
same grouping as the old test suite.


Integration Tests
-----------------

Expand Down Expand Up @@ -143,11 +149,11 @@ Running The Tests
=================

There is only one requirement to install, to quickly get started
running salt's test suite: ``nox-py2``.
running salt's test suite: ``nox``.

.. code-block:: bash
pip install nox-py2
pip install nox
Once this requirement is installed, you can use the ``nox`` binary to run
all of the tests included in Salt's test suite:
Expand Down
12 changes: 5 additions & 7 deletions doc/topics/tutorials/writing_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ where the majority of Salt's test cases are housed.
Getting Set Up For Tests
========================

First of all you will need to ensure you install ``nox-py2``. This version of nox,
allows the tests to run on both python2 and python3. Ensure you install ``nox-py2``
and not ``nox`` as this will prevent you from running all the tests.
First of all you will need to ensure you install ``nox``.

.. code-block:: bash
pip install nox-py2
pip install nox
Test Directory Structure
Expand Down Expand Up @@ -429,9 +427,9 @@ Add a system dependency to the test run

If you need to add a system dependency for the test run, this will need to be added in
the `salt jenkins`_ repo. This repo uses salt states to install system dependencies.
You need to update the ``git/minimal.sls`` file with your dependency to ensure
it is installed. Once your PR is merged the core team will need to promote the new images
with your new dependency installed.
You need to update the ``state-tree/golden-images-provision.sls`` file with
your dependency to ensure it is installed. Once your PR is merged the core team
will need to promote the new images with your new dependency installed.


Checking for Log Messages
Expand Down

0 comments on commit e910798

Please sign in to comment.