Skip to content

Commit

Permalink
Remove Iris' TestRunner (#5205)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbdreyer committed Mar 24, 2023
1 parent 73b4a3a commit c061487
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 233 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,31 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
session: ["doctest", "gallery", "linkcheck"]
python-version: ["310"]
session: ["docs-tests", "docs-linkcheck"]
include:
- os: "ubuntu-latest"
python-version: "3.10"
python-version: "310"
session: "tests"
coverage: "--coverage"
posargs: "--gallery-tests"
- os: "ubuntu-latest"
python-version: "3.9"
python-version: "310"
session: "tests"
posargs: "--coverage"
- os: "ubuntu-latest"
python-version: "3.8"
python-version: "39"
session: "tests"
- os: "ubuntu-latest"
python-version: "38"
session: "tests"
- os: "ubuntu-latest"
python-version: "310"
session: "tests"
posargs: "--gallery-tests"


env:
IRIS_TEST_DATA_VERSION: "2.19"
IRIS_TEST_DATA_VERSION: "2.18"
ENV_NAME: "ci-tests"

steps:
Expand All @@ -63,7 +72,7 @@ jobs:
CACHE_WEEKS: 2
run: |
echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/ci/locks/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
- name: "data cache"
uses: ./.github/workflows/composite/iris-data-cache
Expand Down Expand Up @@ -91,10 +100,10 @@ jobs:
- name: "conda environment cache"
uses: ./.github/workflows/composite/conda-env-cache
with:
cache_build: 0
cache_build: 1
cache_period: ${{ env.CACHE_PERIOD }}
env_name: ${{ env.ENV_NAME }}
install_packages: "cartopy nox pip"
install_packages: "cartopy tox<4"

- name: "conda info"
run: |
Expand All @@ -108,8 +117,8 @@ jobs:
cache_period: ${{ env.CACHE_PERIOD }}
env_name: ${{ env.ENV_NAME }}

- name: "nox cache"
uses: ./.github/workflows/composite/nox-cache
- name: "tox cache"
uses: ./.github/workflows/composite/tox-cache
with:
cache_build: 0
env_name: ${{ env.ENV_NAME }}
Expand All @@ -134,11 +143,9 @@ jobs:
cat ${MPL_RC}
- name: "iris ${{ matrix.session }}"
env:
PY_VER: ${{ matrix.python-version }}
run: |
nox --session ${{ matrix.session }} -- --verbose ${{ matrix.coverage }}
tox -e py${{ matrix.python-version }}-${{ matrix.session }} -- ${{ matrix.posargs }}
- name: Upload coverage report
uses: codecov/codecov-action@v3
if: ${{ matrix.coverage }}
if: ${{ matrix.posargs }} == "--coverage"
18 changes: 8 additions & 10 deletions .github/workflows/ci-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["38", "39", "310"]
session: ["wheel"]
env:
ENV_NAME: "ci-wheels"
Expand All @@ -74,7 +74,7 @@ jobs:
CACHE_WEEKS: 2
run: |
echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
echo "LOCK_FILE=requirements/ci/locks/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
- name: "conda package cache"
uses: ./.github/workflows/composite/conda-pkg-cache
Expand All @@ -95,23 +95,21 @@ jobs:
- name: "conda environment cache"
uses: ./.github/workflows/composite/conda-env-cache
with:
cache_build: 0
cache_build: 1
cache_period: ${{ env.CACHE_PERIOD }}
env_name: ${{ env.ENV_NAME }}
install_packages: "nox pip"
install_packages: "tox<4 pip"

- name: "nox cache"
uses: ./.github/workflows/composite/nox-cache
- name: "tox cache"
uses: ./.github/workflows/composite/tox-cache
with:
cache_build: 0
env_name: ${{ env.ENV_NAME }}
lock_file: ${{ env.LOCK_FILE }}

- name: "nox install and test wheel"
env:
PY_VER: ${{ matrix.python-version }}
- name: "tox install and test wheel"
run: |
nox --session ${{ matrix.session }} -- --verbose
tox -e py${{ matrix.python-version }}-${{ matrix.session }}
show-artifacts:
needs: build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: "nox cache"
description: "cache the nox test environments"
name: "tox cache"
description: "cache the tox test environments"

inputs:
cache_build:
description: "nox cache build number"
description: "tox cache build number"
required: false
default: "0"
env_name:
Expand All @@ -18,5 +18,5 @@ runs:
steps:
- uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.nox
key: ${{ runner.os }}-nox-${{ inputs.env_name }}-s${{ matrix.session }}-py${{ matrix.python-version }}-b${{ inputs.cache_build }}-${{ hashFiles(inputs.lock_file) }}
path: ${{ github.workspace }}/.tox
key: ${{ runner.os }}-tox-${{ inputs.env_name }}-s${{ matrix.session }}-py${{ matrix.python-version }}-b${{ inputs.cache_build }}-${{ hashFiles(inputs.lock_file) }}
3 changes: 3 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ This document explains the changes made to Iris for this release
#. `@lbdreyer`_ and `@trexfeathers`_ (reviewer) removed the ``--coding-tests``
option from Iris' test runner. (:pull:`4765`)

#. `@lbdreyer`_ removed the Iris TestRunner. Tests are now run via nox or
pytest. (:pull:`5205`)


.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
Expand Down
3 changes: 1 addition & 2 deletions lib/iris/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ def get_dir_option(section, option, default=None):
)

# Override the data repository if the appropriate environment variable
# has been set. This is used in setup.py in the TestRunner command to
# enable us to simulate the absence of external data.
# has been set.
override = os.environ.get("OVERRIDE_TEST_DATA_REPOSITORY")
if override:
TEST_DATA_DIR = None
Expand Down
9 changes: 0 additions & 9 deletions lib/iris/tests/runner/__init__.py

This file was deleted.

39 changes: 0 additions & 39 deletions lib/iris/tests/runner/__main__.py

This file was deleted.

143 changes: 0 additions & 143 deletions lib/iris/tests/runner/_runner.py

This file was deleted.

0 comments on commit c061487

Please sign in to comment.