Skip to content

Commit

Permalink
Update test docs (#2901)
Browse files Browse the repository at this point in the history
* Update unit tests paragraph with regression data

* Update lfs command

* Fix syntax

* Update regression data step.

* Fix reference

* Update note

* Add a note about migrating to regression data

* Removing integration tests section

* Update repo location line
  • Loading branch information
KasukabeDefenceForce authored Dec 16, 2024
1 parent 22ffd40 commit 87e4ae1
Showing 1 changed file with 16 additions and 49 deletions.
65 changes: 16 additions & 49 deletions docs/contributing/development/running_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,39 +22,38 @@ tests, you can run this with:
> pytest tardis
Running the more advanced unit tests requires TARDIS Reference data that can be
Running the more advanced unit tests requires TARDIS Regression data that can be
downloaded
(`tardis-refdata <https://github.com/tardis-sn/tardis-refdata>`_).
(`tardis-regression-data <https://github.com/tardis-sn/tardis-regression-data>`_).
`Git LFS <https://www.atlassian.com/git/tutorials/git-lfs>`_ is used
to download the large refdata files in the tardis-refdata repository.
to download the large regression data files in the tardis-regression-data repository.

However, it is not required to download the entire repository. Firstly it is
important to identify the refdata files that are needed. Sometimes, it is possible
that a preused fixture that is also being used in the current tests is using some
refdata. So, it is advised to check for such cases beforehand.

After identifying the refdata files to be used in the unit tests, those particular
files can be downloaded using ``git lfs``

.. code-block:: shell
> git lfs pull --include=filename
> git lfs pull
It is important to maintain the same directory structure as the tardis-refdata repo
i.e. the lfs files should be in the same directory tree exactly as in tardis-refdata
repository.
The ``tardis-regression-data`` repository should be located outside of the main ``tardis`` repository, rather than being nested within it.

.. warning::
We have migrated from ``tardis-refdata`` to``tardis-regression-data``.

Finally, the tests can be run using the following command

.. code-block:: shell
> pytest tardis --tardis-refdata=/path/to/tardis-refdata/
> pytest tardis --tardis-regression-data=/path/to/tardis-regression-data/
Or, to run tests for a particular file or directory

.. code-block:: shell
> pytest tardis/path/to/test_file_or_directory --tardis-refdata=/path/to/tardis-refdata/
> pytest tardis/path/to/test_file_or_directory --tardis-regression-data=/path/to/tardis-regression-data/
.. warning::
In some cases you might have to update the regression data. The steps to update the regression data are outlined in the :ref:`update regression-data`.

.. warning::
The `tests workflow <https://github.com/tardis-sn/tardis/blob/master/.github/workflows/tests.yml>`_ runs on
Expand All @@ -74,36 +73,4 @@ You can generate Plasma Reference by the following command:
.. code-block:: shell
> pytest -rs tardis/plasma/tests/test_complete_plasmas.py
--tardis-refdata="/path/to/tardis-refdata/" --generate-reference
Running the Integration Tests
=============================

These tests require reference files against which the results of the various
tardis runs are tested. So you first need to either download the current
reference files (`here <https://github.com/tardis-sn/tardis-refdata>`_)
or generate new ones.

Both of these require a configuration file for the integration tests:

.. literalinclude:: integration.yml
:language: yaml

Inside the atomic data directory there needs to be atomic data for each of
the setups that are provided in the ``test_integration`` folder.
If no references are given, the first step is to generate them.
The ``--less-packets`` option is useful for debugging purposes and will just
use very few packets to generate the references and thus make the process much
faster --- THIS IS ONLY FOR DEBUGGING PURPOSES. The ``-s`` option ensures that
TARDIS prints out the progress:

.. code-block:: shell
> pytest --integration=integration.yml -m integration --generate-reference --less-packets
To run the test after having run the ``--generate-references``, all that is
needed is:

.. code-block:: shell
> pytest --integration=integration.yml -m integration --less-packets --remote-data
--tardis-regression-data="/path/to/tardis-regression-data/" --generate-reference

0 comments on commit 87e4ae1

Please sign in to comment.