diff --git a/.github/workflows/py3.yml b/.github/workflows/py3.yml index 82c74b6c..a089652a 100644 --- a/.github/workflows/py3.yml +++ b/.github/workflows/py3.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: python: ["3.10", "3.11", "3.12"] - netbox: ["4.1", "4.2", "4.3"] + netbox: ["4.2", "4.3", "4.4"] steps: - uses: actions/checkout@v4 @@ -26,6 +26,11 @@ jobs: - name: Install dev requirements run: pip install -r requirements-dev.txt . + - name: Free up Docker resources + run: | + docker system prune -af --volumes + docker network prune -f + - name: Run Linter run: black --diff --check pynetbox tests diff --git a/docs/development/getting-started.md b/docs/development/getting-started.md index 42fb64f2..9ab3a075 100644 --- a/docs/development/getting-started.md +++ b/docs/development/getting-started.md @@ -39,7 +39,7 @@ pytest tests/integration You can specify which versions of NetBox to test against using the `--netbox-versions` flag: ```bash -pytest tests/integration --netbox-versions 4.1 4.2 4.3 +pytest tests/integration --netbox-versions 4.2 4.3 4.4 ``` ### Running Specific Tests diff --git a/tests/conftest.py b/tests/conftest.py index fdc9327c..2fe39053 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,7 @@ import pytest from packaging import version -DEFAULT_NETBOX_VERSIONS = "4.3" +DEFAULT_NETBOX_VERSIONS = "4.4" def pytest_addoption(parser): diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 127379f7..5d8c0121 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -26,12 +26,12 @@ def get_netbox_docker_version_tag(netbox_version): """ major, minor = netbox_version.major, netbox_version.minor - if (major, minor) == (4, 1): - tag = "3.0.2" - elif (major, minor) == (4, 2): - tag = "3.2.0" + if (major, minor) == (4, 2): + tag = "3.2.1" elif (major, minor) == (4, 3): tag = "3.3.0" + elif (major, minor) == (4, 4): + tag = "3.4.2" else: raise NotImplementedError( "Version %s is not currently supported" % netbox_version @@ -263,6 +263,16 @@ def docker_compose_file(pytestconfig, netbox_docker_repo_dirpaths): # ensure the netbox container listens on a random port new_services[new_service_name]["ports"] = ["8080"] + # Increase health check timeouts for GitHub Actions runners + # which may have more resource constraints + new_services[new_service_name]["healthcheck"] = { + "test": "curl -f http://localhost:8080/login/ || exit 1", + "start_period": "180s", # Increased from 90s + "timeout": "10s", # Increased from 3s + "interval": "15s", + "retries": 5, + } + # set the network and an alias to the proper short name of the container # within that network new_services[new_service_name]["networks"] = {