Skip to content

Commit

Permalink
Run tests with newer pythons (#1161)
Browse files Browse the repository at this point in the history
- update tox configs (tox v4 replaced `whitelist_externals` with `allowlist_externals`)
- install dependencies for client tests with all pythons, not just 3.8
- run client and API tests with python 3.8 to 3.12 (except 3.12 for api,
  because that requires some updated dependencies)
  • Loading branch information
jcristau authored Dec 20, 2023
1 parent e64d648 commit d5b08b3
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
13 changes: 10 additions & 3 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ tasks:
in:
# [ <PROJECT NAME>, <PYTHON VERSION>, <SETUP COMMAND>, <DOCKERHUB REPO>]
- ['tooltool_client', '38', '${client_setup_3}', '']
- ['tooltool_api', '37', '${api_setup}', 'mozilla/releng-tooltool']
- ['tooltool_client', '39', '${client_setup_3}', '']
- ['tooltool_client', '310', '${client_setup_3}', '']
- ['tooltool_client', '311', '${client_setup_3}', '']
- ['tooltool_client', '312', '${client_setup_3}', '']
- ['tooltool_api', '38', '${api_setup}', 'mozilla/releng-tooltool']
- ['tooltool_api', '39', '${api_setup}', '']
- ['tooltool_api', '310', '${api_setup}', '']
- ['tooltool_api', '311', '${api_setup}', '']
# -------------------------------------------------------------------------

HEAD_REV:
Expand Down Expand Up @@ -105,7 +112,7 @@ tasks:
features:
taskclusterProxy: true
maxRunTime: 3600
image: 'python:${python_version[0]}.${python_version[1]}'
image: 'python:${python_version[0]}.${python_version[1:]}'
env:
CI_HEAD_REV: '${HEAD_REV}'
CI_BRANCH_NAME:
Expand Down Expand Up @@ -147,7 +154,7 @@ tasks:
else: '${i+1}'
in:
'${number_prefix}${test_task_number}. ${project_name}-py${python_version}: Run tox [on ${BRANCH_NAME}]'
description: 'Code linting and unit tests for ${project_name} on python ${python_version[0]}.${python_version[1]}'
description: 'Code linting and unit tests for ${project_name} on python ${python_version[0]}.${python_version[1:]}'
owner: '${OWNER}'
source: '${REPO_URL}/raw/${HEAD_REV}/.taskcluster.yml'
# Build docker image and (optionally) push to docker hub
Expand Down
4 changes: 2 additions & 2 deletions api/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
envlist = docker

[testenv:docker]
whitelist_externals=docker
allowlist_externals=docker
passenv =
PYTHON_VERSION
TOXENV
Expand Down Expand Up @@ -48,7 +48,7 @@ commands =
# check-manifest -v {toxinidir}

[testenv:codecov]
whitelist_externals = sed
allowlist_externals = sed
passenv =
CI
CI_*
Expand Down
2 changes: 1 addition & 1 deletion client/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ passenv =
HOME

deps =
py38: -rrequirements/test.txt
-rrequirements/test.txt

# Installing with deps can downgrade packages specified in requirements-test.txt causing us
# to not fail in `pip check` below. We do however want the requirements file installed
Expand Down
56 changes: 56 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
envlist =
tooltool_api-py38
tooltool_client-py38
tooltool_api-py39
tooltool_client-py39
tooltool_api-py310
tooltool_client-py310
tooltool_api-py311
tooltool_client-py311
tooltool_api-py312
tooltool_client-py312

skipsdist = true

Expand All @@ -26,3 +34,51 @@ changedir = {toxinidir}/client
commands =
tox -e py38
tox -e codecov

[testenv:tooltool_api-py39]
changedir = {toxinidir}/api
commands =
tox -e py39
tox -e codecov

[testenv:tooltool_client-py39]
changedir = {toxinidir}/client
commands =
tox -e py39
tox -e codecov

[testenv:tooltool_api-py310]
changedir = {toxinidir}/api
commands =
tox -e py310
tox -e codecov

[testenv:tooltool_client-py310]
changedir = {toxinidir}/client
commands =
tox -e py310
tox -e codecov

[testenv:tooltool_api-py311]
changedir = {toxinidir}/api
commands =
tox -e py311
tox -e codecov

[testenv:tooltool_client-py311]
changedir = {toxinidir}/client
commands =
tox -e py311
tox -e codecov

[testenv:tooltool_api-py312]
changedir = {toxinidir}/api
commands =
tox -e py312
tox -e codecov

[testenv:tooltool_client-py312]
changedir = {toxinidir}/client
commands =
tox -e py312
tox -e codecov

0 comments on commit d5b08b3

Please sign in to comment.