From b44edb417bb091badf82c07010dcc9cb81d5d4f7 Mon Sep 17 00:00:00 2001 From: Lucas Guillermou Date: Wed, 22 Jan 2025 15:10:50 +0100 Subject: [PATCH] WIP: Run CI tests against multiple versions --- .github/workflows/ci.yml | 10 +++++++++- tests/integration/test_infrahub_client.py | 4 ---- tests/integration/test_node.py | 4 ---- tests/integration/test_repository.py | 6 ------ 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8a348a..e7b7e45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -183,6 +183,9 @@ jobs: runs-on: group: "huge-runners" timeout-minutes: 30 + strategy: + matrix: + version: ["1.0.0", "1.1.0"] steps: - name: "Check out repository code" uses: "actions/checkout@v4" @@ -201,8 +204,13 @@ jobs: pip install invoke toml codecov - name: "Install Package" run: "poetry install --all-extras" + - name: "Set environment variables for python_testcontainers" + run: | + echo INFRAHUB_TESTING_IMAGE_VER=${{ matrix.version }} >> $GITHUB_ENV - name: "Integration Tests" - run: "poetry run pytest --cov infrahub_sdk tests/integration/" + run: | + echo "Running tests for version: ${{ matrix.version }}" + poetry run pytest --cov infrahub_sdk tests/integration/ - name: "Upload coverage to Codecov" run: | codecov --flags integration-tests diff --git a/tests/integration/test_infrahub_client.py b/tests/integration/test_infrahub_client.py index 3c60751..817205e 100644 --- a/tests/integration/test_infrahub_client.py +++ b/tests/integration/test_infrahub_client.py @@ -16,10 +16,6 @@ class TestInfrahubNode(TestInfrahubDockerClient, SchemaAnimal): - @pytest.fixture(scope="class") - def infrahub_version(self) -> str: - return "1.1.0" - @pytest.fixture(scope="class") async def base_dataset( self, diff --git a/tests/integration/test_node.py b/tests/integration/test_node.py index a0d8e89..03d7e24 100644 --- a/tests/integration/test_node.py +++ b/tests/integration/test_node.py @@ -11,10 +11,6 @@ class TestInfrahubNode(TestInfrahubDockerClient, SchemaCarPerson): - @pytest.fixture(scope="class") - def infrahub_version(self) -> str: - return "1.1.0" - @pytest.fixture(scope="class") async def initial_schema(self, default_branch: str, client: InfrahubClient, schema_base: SchemaRoot) -> None: await client.schema.wait_until_converged(branch=default_branch) diff --git a/tests/integration/test_repository.py b/tests/integration/test_repository.py index 359f1e6..76b14f5 100644 --- a/tests/integration/test_repository.py +++ b/tests/integration/test_repository.py @@ -2,8 +2,6 @@ from typing import TYPE_CHECKING -import pytest - from infrahub_sdk.testing.docker import TestInfrahubDockerClient from infrahub_sdk.testing.repository import GitRepo from infrahub_sdk.utils import get_fixtures_dir @@ -13,10 +11,6 @@ class TestInfrahubRepository(TestInfrahubDockerClient): - @pytest.fixture(scope="class") - def infrahub_version(self) -> str: - return "1.1.0" - async def test_add_repository(self, client: InfrahubClient, remote_repos_dir): src_directory = get_fixtures_dir() / "integration/mock_repo" repo = GitRepo(name="mock_repo", src_directory=src_directory, dst_directory=remote_repos_dir)