Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 2.12 KB

File metadata and controls

66 lines (40 loc) · 2.12 KB

Testing

gravity-toolkit uses the pytest framework to run tests and verify outputs. Running the test suite requires a dev installation of the gravity-toolkit package to include all of the optional dependencies.

python -m pip install --editable '.[dev]'

Running the Test Suite

Using the pytest command:

pytest --directory <path_to_tide_models> test/

Using pixi:

pixi run test "--directory <path_to_tide_models>"

The test suite is run in verbose mode as a default.

Coverage Reports

Coverage reports can be generated using the pytest-cov plugin (which is installed with the dev installation).

pytest --cov pyTMD --cov-report=term
pixi run test "--cov ../gravity-toolkit --cov-report=term"

Parallelization

As a default, the pytest suite is run in parallel using the pytest-xdist plugin (which is also installed with the dev installation). To run in series and disable parallelization, set the number of processes to 0:

pytest -n 0
pixi run test "-n 0"

Continuous Integration

We use GitHub Actions continuous integration (CI) services to build and test the project on Linux (ubuntu-latest), Mac (macos-latest) and Windows (windows-latest) Operating Systems. The configuration files for this service are in the GitHub workflows directory. The workflows use pixi to install the required dependencies and build the custom environment.

The GitHub Actions jobs include:

  • Running flake8 to check the code for style and compilation errors
  • Running the test suite on multiple combinations of OS and Python version
  • Uploading source and wheel distributions to PyPI (on releases)