Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ 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=latest >> $GITHUB_ENV
- name: "Integration Tests"
run: |
poetry run pytest --cov infrahub_sdk tests/integration/
Expand Down
9 changes: 4 additions & 5 deletions infrahub_sdk/testing/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@

from .. import Config, InfrahubClient, InfrahubClientSync

INFRAHUB_VERSION = os.getenv("INFRAHUB_TESTING_IMAGE_VER", "latest")
INFRAHUB_VERSION = os.getenv("INFRAHUB_TESTING_IMAGE_VER")


def skip_version(min_infrahub_version: str | None = None, max_infrahub_version: str | None = None) -> bool:
"""
Check if a test should be skipped depending on infrahub version.
"""
if INFRAHUB_VERSION is None:
return True

Check warning on line 19 in infrahub_sdk/testing/docker.py

View check run for this annotation

Codecov / codecov/patch

infrahub_sdk/testing/docker.py#L19

Added line #L19 was not covered by tests

try:
version = Version(INFRAHUB_VERSION)
except InvalidVersion:
Expand All @@ -31,10 +34,6 @@


class TestInfrahubDockerClient(TestInfrahubDocker):
@pytest.fixture(scope="class")
def infrahub_version(self) -> str:
return INFRAHUB_VERSION

@pytest.fixture(scope="class")
def client(self, infrahub_port: int) -> InfrahubClient:
return InfrahubClient(
Expand Down
52 changes: 42 additions & 10 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ pytest-xdist = "^3.3.1"
types-python-slugify = "^8.0.0.3"
invoke = "^2.2.0"
towncrier = "^24.8.0"
infrahub-testcontainers = "~1.1.9"

infrahub-testcontainers = { version = "^1.2.5", python = ">=3.10" }
astroid = "~3.1"

[tool.poetry.extras]
Expand Down