You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/project/Testing.rst
+41-1Lines changed: 41 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,61 @@ Testing
3
3
=======
4
4
5
5
``gravity-toolkit`` uses the ``pytest`` framework to run tests and verify outputs.
6
+
Running the test suite requires a `dev installation <../getting_started/Install.html>`_ of the ``gravity-toolkit`` package to include all of the optional dependencies.
7
+
8
+
.. code-block:: bash
9
+
10
+
python -m pip install --editable '.[dev]'
6
11
7
12
Running the Test Suite
8
13
^^^^^^^^^^^^^^^^^^^^^^
9
14
15
+
Using the ``pytest`` command:
16
+
10
17
.. code-block:: bash
11
18
12
19
pytest --directory <path_to_tide_models> test/
13
20
21
+
Using ``pixi``:
22
+
23
+
.. code-block:: bash
24
+
25
+
pixi run test"--directory <path_to_tide_models>"
26
+
14
27
The test suite is run in verbose mode as a default.
15
28
29
+
Coverage Reports
30
+
^^^^^^^^^^^^^^^^
31
+
32
+
Coverage reports can be generated using the ``pytest-cov`` plugin (which is installed with the dev installation).
33
+
34
+
.. code-block:: bash
35
+
36
+
pytest --cov pyTMD --cov-report=term
37
+
38
+
.. code-block:: bash
39
+
40
+
pixi run test"--cov ../gravity-toolkit --cov-report=term"
41
+
42
+
Parallelization
43
+
^^^^^^^^^^^^^^^
44
+
45
+
As a default, the ``pytest`` suite is run in parallel using the ``pytest-xdist`` plugin (which is also installed with the dev installation).
46
+
To run in series and disable parallelization, set the number of processes to 0:
47
+
48
+
.. code-block:: bash
49
+
50
+
pytest -n 0
51
+
52
+
.. code-block:: bash
53
+
54
+
pixi run test"-n 0"
55
+
16
56
Continuous Integration
17
57
^^^^^^^^^^^^^^^^^^^^^^
18
58
We use `GitHub Actions <https://github.com/tsutterley/gravity-toolkit/actions>`_ continuous integration (CI) services to build and test the project on Linux (``ubuntu-latest``), Mac (``macos-latest``) and Windows (``windows-latest``) Operating Systems.
19
59
The configuration files for this service are in the `GitHub workflows <https://github.com/tsutterley/gravity-toolkit/tree/main/.github/workflows>`_ directory.
20
-
The workflows use ``mamba`` and the `environment.yml <https://github.com/tsutterley/gravity-toolkit/blob/main/environment.yml>`_ file to install the required dependencies and build the environment.
60
+
The workflows use ``pixi`` to install the required dependencies and build the custom environment.
0 commit comments