Skip to content

Commit 54d7e3b

Browse files
committed
Remove Iris' TestRunner (SciTools#5205)
1 parent 73b4a3a commit 54d7e3b

File tree

9 files changed

+44
-250
lines changed

9 files changed

+44
-250
lines changed

.github/workflows/ci-tests.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,31 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
os: ["ubuntu-latest"]
38-
python-version: ["3.10"]
39-
session: ["doctest", "gallery", "linkcheck"]
38+
python-version: ["310"]
39+
session: ["docs-tests", "docs-linkcheck"]
4040
include:
4141
- os: "ubuntu-latest"
42-
python-version: "3.10"
42+
python-version: "310"
4343
session: "tests"
44-
coverage: "--coverage"
44+
posargs: "--gallery-tests"
4545
- os: "ubuntu-latest"
46-
python-version: "3.9"
46+
python-version: "310"
4747
session: "tests"
48+
posargs: "--coverage"
4849
- os: "ubuntu-latest"
49-
python-version: "3.8"
50+
python-version: "39"
5051
session: "tests"
52+
- os: "ubuntu-latest"
53+
python-version: "38"
54+
session: "tests"
55+
- os: "ubuntu-latest"
56+
python-version: "310"
57+
session: "tests"
58+
posargs: "--gallery-tests"
59+
5160

5261
env:
53-
IRIS_TEST_DATA_VERSION: "2.19"
62+
IRIS_TEST_DATA_VERSION: "2.18"
5463
ENV_NAME: "ci-tests"
5564

5665
steps:
@@ -63,7 +72,7 @@ jobs:
6372
CACHE_WEEKS: 2
6473
run: |
6574
echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV}
66-
echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
75+
echo "LOCK_FILE=requirements/ci/locks/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
6776
6877
- name: "data cache"
6978
uses: ./.github/workflows/composite/iris-data-cache
@@ -91,10 +100,10 @@ jobs:
91100
- name: "conda environment cache"
92101
uses: ./.github/workflows/composite/conda-env-cache
93102
with:
94-
cache_build: 0
103+
cache_build: 1
95104
cache_period: ${{ env.CACHE_PERIOD }}
96105
env_name: ${{ env.ENV_NAME }}
97-
install_packages: "cartopy nox pip"
106+
install_packages: "cartopy tox<4"
98107

99108
- name: "conda info"
100109
run: |
@@ -108,8 +117,8 @@ jobs:
108117
cache_period: ${{ env.CACHE_PERIOD }}
109118
env_name: ${{ env.ENV_NAME }}
110119

111-
- name: "nox cache"
112-
uses: ./.github/workflows/composite/nox-cache
120+
- name: "tox cache"
121+
uses: ./.github/workflows/composite/tox-cache
113122
with:
114123
cache_build: 0
115124
env_name: ${{ env.ENV_NAME }}
@@ -134,11 +143,9 @@ jobs:
134143
cat ${MPL_RC}
135144
136145
- name: "iris ${{ matrix.session }}"
137-
env:
138-
PY_VER: ${{ matrix.python-version }}
139146
run: |
140-
nox --session ${{ matrix.session }} -- --verbose ${{ matrix.coverage }}
147+
tox -e py${{ matrix.python-version }}-${{ matrix.session }} -- ${{ matrix.posargs }}
141148
142149
- name: Upload coverage report
143150
uses: codecov/codecov-action@v3
144-
if: ${{ matrix.coverage }}
151+
if: ${{ matrix.posargs }} == "--coverage"

.github/workflows/ci-wheels.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
strategy:
5555
fail-fast: false
5656
matrix:
57-
python-version: ["3.8", "3.9", "3.10"]
57+
python-version: ["38", "39", "310"]
5858
session: ["wheel"]
5959
env:
6060
ENV_NAME: "ci-wheels"
@@ -74,7 +74,7 @@ jobs:
7474
CACHE_WEEKS: 2
7575
run: |
7676
echo "CACHE_PERIOD=$(date +%Y).$(expr $(date +%U) / ${CACHE_WEEKS})" >> ${GITHUB_ENV}
77-
echo "LOCK_FILE=requirements/ci/nox.lock/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
77+
echo "LOCK_FILE=requirements/ci/locks/py$(echo ${{ matrix.python-version }} | tr -d '.')-linux-64.lock" >> ${GITHUB_ENV}
7878
7979
- name: "conda package cache"
8080
uses: ./.github/workflows/composite/conda-pkg-cache
@@ -95,23 +95,21 @@ jobs:
9595
- name: "conda environment cache"
9696
uses: ./.github/workflows/composite/conda-env-cache
9797
with:
98-
cache_build: 0
98+
cache_build: 1
9999
cache_period: ${{ env.CACHE_PERIOD }}
100100
env_name: ${{ env.ENV_NAME }}
101-
install_packages: "nox pip"
101+
install_packages: "tox<4 pip"
102102

103-
- name: "nox cache"
104-
uses: ./.github/workflows/composite/nox-cache
103+
- name: "tox cache"
104+
uses: ./.github/workflows/composite/tox-cache
105105
with:
106106
cache_build: 0
107107
env_name: ${{ env.ENV_NAME }}
108108
lock_file: ${{ env.LOCK_FILE }}
109109

110-
- name: "nox install and test wheel"
111-
env:
112-
PY_VER: ${{ matrix.python-version }}
110+
- name: "tox install and test wheel"
113111
run: |
114-
nox --session ${{ matrix.session }} -- --verbose
112+
tox -e py${{ matrix.python-version }}-${{ matrix.session }}
115113
116114
show-artifacts:
117115
needs: build

.github/workflows/composite/nox-cache/action.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/src/whatsnew/latest.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ This document explains the changes made to Iris for this release
137137
#. `@lbdreyer`_ and `@trexfeathers`_ (reviewer) removed the ``--coding-tests``
138138
option from Iris' test runner. (:pull:`4765`)
139139

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

141144
.. comment
142145
Whatsnew author names (@github name) in alphabetical order. Note that,

lib/iris/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ def get_dir_option(section, option, default=None):
171171
)
172172

173173
# Override the data repository if the appropriate environment variable
174-
# has been set. This is used in setup.py in the TestRunner command to
175-
# enable us to simulate the absence of external data.
174+
# has been set.
176175
override = os.environ.get("OVERRIDE_TEST_DATA_REPOSITORY")
177176
if override:
178177
TEST_DATA_DIR = None

lib/iris/tests/runner/__init__.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

lib/iris/tests/runner/__main__.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

lib/iris/tests/runner/_runner.py

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)