You are viewing the latest unreleased documentation 3.9.0.dev37. You can switch to a stable version.

Continuous Integration (CI) Testing#

Note

Iris is currently supported and tested against Python 3.10, 3.11 and 3.9 running on Linux. We do not currently actively test on other platforms such as Windows or macOS.

The Iris GitHub repository is configured to run checks against all its branches automatically whenever a pull-request is created, updated or merged. The checks performed are:

GitHub Actions#

Iris unit and integration tests are an essential mechanism to ensure that the Iris code base is working as expected. Running the Tests may be performed manually by a developer locally. However Iris is configured to use GitHub Actions (GHA) for automated Continuous Integration (CI) testing.

The Iris GHA YAML configuration files in the .github/workflows directory defines the CI tasks to be performed. For further details refer to the GitHub Actions documentation. The tasks performed during CI include:

  • running the system, integration and unit tests for Iris

  • ensuring the documentation gallery builds successfully

  • performing all doc-tests within the code base

  • checking all URL references within the code base and documentation are valid

The above GHA tasks are run automatically against all Iris branches on GitHub whenever a pull-request is submitted, updated or merged. See the Iris GitHub Actions dashboard for details of recent past and active CI jobs.

GitHub Actions Test Environment#

The CI test environments for our GHA is determined from the requirement files in requirements/pyXX.yml. These are conda environment files list the top-level package dependencies for running and testing Iris.

For reproducible test results, these environments are resolved for all their dependencies and stored as conda lock files in the requirements/locks directory. The test environments will not resolve the dependencies each time, instead they will use the lock files to reproduce the exact same environment each time.

If you have updated the requirement YAML files with new dependencies, you will need to generate new lock files. To do this, run the command:

python tools/update_lockfiles.py -o requirements/locks requirements/py*.yml

or simply:

make lockfiles

and add the changed lockfiles to your pull request.

New lockfiles are generated automatically each week to ensure that Iris continues to be tested against the latest available version of its dependencies. Each week the yaml files in requirements are resolved by a GitHub Action. If the resolved environment has changed, a pull request is created with the new lock files. The CI test suite will run on this pull request. If the tests fail, a developer will need to create a new branch based off the auto-update-lockfiles branch and add the required fixes to this new branch. If the fixes are made to the auto-update-lockfiles branch these will be overwritten the next time the Github Action is run.

GitHub Checklist#

An example snapshot from a successful GitHub pull-request shows all tests passing:

../_images/ci_checks.png

If any CI tasks fail, then the pull-request is unlikely to be merged to the Iris target branch by a core developer.

CLA Assistant#

A bot which checks that the GitHub authors of the pull-request have signed the SciTools Contributor’s License Agreement (CLA).

pre-commit CI#

A CI service for the pre-commit framework that checks and auto fixes all pull-requests given the Iris GitHub repository .pre-commit-config.yaml.

See the pre-commit.ci dashboard for details of recent past and active Iris jobs.

Note

The codespell pre-commit hook checks the spelling of the whole codebase and documentation. This hook is configured in the [tool.codespell] section of the pyproject.toml file.

Append to the ignore-words-list option any valid words that are considered not a typo and should not be corrected by codespell.

ruff#

As of Iris 3.8 ruff has been adopted to ensure our codebase is using best practice. ruff is configured in the Iris GitHub repository using .pre-commit-config.yaml.

You can install and run ruff in your development iris-dev conda environment via:

conda activate iris-dev
pip install ruff
cd iris
ruff .

Note

The ruff pre-commit hook checks for compliance of the whole codebase. This hook is configured in the [tool.ruff] section of the pyproject.toml file.

Edit the .ruff.toml file to include any temporary rules to be ignored. Edit the pyproject.toml to include any permanent rules to be ignored. We aim to be fully ruff compliant as possible.

For more information on how to use ruff please see the ruff documentation.