From 1e9d2effeee72b87acc6fb0301736c5b4136bbfa Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Thu, 20 Nov 2025 17:20:23 +0100 Subject: [PATCH] Run old server version tests in separate CI jobs --- .github/workflows/ci_cd.yml | 23 +++++++++++++++-------- tests/conftest.py | 2 +- tox.ini | 7 +------ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 1ef981b6cd..ab84923600 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -54,14 +54,25 @@ jobs: tests: name: "Tests and coverage" - runs-on: ${{ matrix.os }} + runs-on: "ubuntu-latest" strategy: matrix: # We can't test on windows because it is not possible to run linux # docker images on the windows agents. See the issue # https://github.com/actions/runner-images/issues/1143 - os: [ubuntu-latest] python-version: ['3.10', '3.11', '3.12', '3.13'] + container-tag: [ 'latest' ] + include: + - python-version: "3.13" + container-tag: "2025r2" + - python-version: "3.13" + container-tag: "2025r1" + - python-version: "3.13" + container-tag: "2024r2" + - python-version: "3.13" + container-tag: "2024r1" + - python-version: "3.13" + container-tag: "2023r2_pre1" fail-fast: false steps: - name: "Login in Github Container registry" @@ -75,12 +86,7 @@ jobs: # 2023r2_pre1 is used to test backward compatibility. Also update testenv in tox.ini # if other containers must be tested. run: | - docker pull ghcr.io/ansys/pydpf-composites:${{ env.CONTAINER_TAG }} - docker pull ghcr.io/ansys/pydpf-composites:2025r2 - docker pull ghcr.io/ansys/pydpf-composites:2025r1 - docker pull ghcr.io/ansys/pydpf-composites:2024r2 - docker pull ghcr.io/ansys/pydpf-composites:2024r1 - docker pull ghcr.io/ansys/pydpf-composites:2023r2_pre1 + docker pull ghcr.io/ansys/pydpf-composites:${{ matrix.container-tag }} - name: "Checkout the project" uses: actions/checkout@v5 @@ -101,6 +107,7 @@ jobs: tox env: LICENSE_SERVER: ${{ secrets.LICENSE_SERVER }} + CONTAINER_TAG: ${{ matrix.container-tag }} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 diff --git a/tests/conftest.py b/tests/conftest.py index 3da4ec070c..fc5f5a64da 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -51,7 +51,7 @@ ANSYS_PATH_OPTION_KEY = "--ansys-path" LICENSE_SERVER_OPTION_KEY = "--license-server" ANSYSLMD_LICENSE_FILE_KEY = "ANSYSLMD_LICENSE_FILE" -DOCKER_IMAGE_TAG_KEY = "--image-tag" +DOCKER_IMAGE_TAG_KEY = "--container-tag" DEFAULT_DOCKER_IMAGE_TAG = "latest" diff --git a/tox.ini b/tox.ini index f7e52f2e5d..7f1961a3be 100644 --- a/tox.ini +++ b/tox.ini @@ -31,12 +31,7 @@ setenv = PYTEST_COV_APPEND_ARG = --cov-append commands = poetry install -E test - poetry run pytest --reruns 1 --license-server={env:LICENSE_SERVER:} --image-tag=latest {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {env:PYTEST_COV_APPEND_ARG:} {posargs:-vv} - poetry run pytest --reruns 1 --license-server={env:LICENSE_SERVER:} --image-tag=2025r2 {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {env:PYTEST_COV_APPEND_ARG:} {posargs:-vv} - poetry run pytest --reruns 1 --license-server={env:LICENSE_SERVER:} --image-tag=2025r1 {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {env:PYTEST_COV_APPEND_ARG:} {posargs:-vv} - poetry run pytest --reruns 1 --license-server={env:LICENSE_SERVER:} --image-tag=2024r2 {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {env:PYTEST_COV_APPEND_ARG:} {posargs:-vv} - poetry run pytest --reruns 1 --license-server={env:LICENSE_SERVER:} --image-tag=2024r1 {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {env:PYTEST_COV_APPEND_ARG:} {posargs:-vv} - poetry run pytest --reruns 1 --license-server={env:LICENSE_SERVER:} --image-tag=2023r2_pre1 {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {env:PYTEST_COV_APPEND_ARG:} {posargs:-vv} + poetry run pytest --reruns 1 --license-server={env:LICENSE_SERVER:} --container-tag={env:CONTAINER_TAG:latest} {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {env:PYTEST_COV_APPEND_ARG:} {posargs:-vv} [testenv:test-minimal] description = Checks for project unit tests with minimal package versions