From fdf76a2ecd6a64b5a682bbb023b4266dafc027a2 Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 18 Nov 2025 18:23:14 -0800 Subject: [PATCH 1/8] Consider object_types as set in the response --- pynetbox/core/response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pynetbox/core/response.py b/pynetbox/core/response.py index 824bd6a3..cd00ff36 100644 --- a/pynetbox/core/response.py +++ b/pynetbox/core/response.py @@ -23,7 +23,7 @@ from pynetbox.core.util import Hashabledict # List of fields that are lists but should be treated as sets. -LIST_AS_SET = ("tags", "tagged_vlans") +LIST_AS_SET = ("tags", "tagged_vlans", "object_types") def get_return(lookup, return_fields=None): From 99f7a95caa3576601f6b3845729f6bad12dd45bc Mon Sep 17 00:00:00 2001 From: Arthur Date: Tue, 18 Nov 2025 18:29:03 -0800 Subject: [PATCH 2/8] remove for test --- pynetbox/core/response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pynetbox/core/response.py b/pynetbox/core/response.py index cd00ff36..824bd6a3 100644 --- a/pynetbox/core/response.py +++ b/pynetbox/core/response.py @@ -23,7 +23,7 @@ from pynetbox.core.util import Hashabledict # List of fields that are lists but should be treated as sets. -LIST_AS_SET = ("tags", "tagged_vlans", "object_types") +LIST_AS_SET = ("tags", "tagged_vlans") def get_return(lookup, return_fields=None): From 9e33cd98724d41ff240a4d1dbe3855ade0d13829 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 24 Nov 2025 14:25:09 -0800 Subject: [PATCH 3/8] update netbox-docker versions for tests --- tests/integration/conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 127379f7..8e410504 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 From 20c09f7eef290011576e1e57f6d7bf1ed116bcb3 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 24 Nov 2025 14:28:39 -0800 Subject: [PATCH 4/8] update netbox-docker versions for tests --- .github/workflows/py3.yml | 2 +- docs/development/getting-started.md | 2 +- tests/conftest.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/py3.yml b/.github/workflows/py3.yml index 82c74b6c..86e162b2 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 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): From 5eec5b006bc6018d0d8245e5306e1b5b37c6241a Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 24 Nov 2025 14:44:27 -0800 Subject: [PATCH 5/8] update netbox-docker versions for tests --- .github/workflows/py3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/py3.yml b/.github/workflows/py3.yml index 86e162b2..71b64b3f 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.2", "4.3", "4.4"] + netbox: ["4.2",] steps: - uses: actions/checkout@v4 From fac5d46956b5be224adf95bed6dc623af381e951 Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 24 Nov 2025 15:01:10 -0800 Subject: [PATCH 6/8] Increase health check timeouts and add debugging --- .github/workflows/py3.yml | 15 +++++++++++++++ tests/integration/conftest.py | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/py3.yml b/.github/workflows/py3.yml index 71b64b3f..707a7ee4 100644 --- a/.github/workflows/py3.yml +++ b/.github/workflows/py3.yml @@ -26,8 +26,23 @@ 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 - name: Run Tests run: pytest --netbox-versions=${{ matrix.netbox }} + + - name: Show Docker Logs on Failure + if: failure() + run: | + echo "=== Docker Container Status ===" + docker ps -a + echo "=== NetBox Container Logs ===" + docker logs $(docker ps -a | grep netbox_v4_2_netbox-1 | grep -v worker | grep -v housekeeping | awk '{print $1}') || echo "Could not find netbox container" + echo "=== All Container Health Status ===" + docker inspect $(docker ps -aq) --format='{{.Name}}: {{.State.Health.Status}}' || true diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 8e410504..c771b460 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -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"] = { From 53c39a3cf98ab7b7f95109d2c60b62b2cf5f28de Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 24 Nov 2025 15:04:46 -0800 Subject: [PATCH 7/8] Increase health check timeouts and add debugging --- tests/integration/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index c771b460..5d8c0121 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -268,9 +268,9 @@ def docker_compose_file(pytestconfig, netbox_docker_repo_dirpaths): 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 + "timeout": "10s", # Increased from 3s "interval": "15s", - "retries": 5 + "retries": 5, } # set the network and an alias to the proper short name of the container From c4841204a78e74ad7f61b7bbbac346b79f87eb8c Mon Sep 17 00:00:00 2001 From: Arthur Date: Mon, 24 Nov 2025 15:25:58 -0800 Subject: [PATCH 8/8] Increase health check timeouts and add debugging --- .github/workflows/py3.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/py3.yml b/.github/workflows/py3.yml index 707a7ee4..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.2",] + netbox: ["4.2", "4.3", "4.4"] steps: - uses: actions/checkout@v4 @@ -36,13 +36,3 @@ jobs: - name: Run Tests run: pytest --netbox-versions=${{ matrix.netbox }} - - - name: Show Docker Logs on Failure - if: failure() - run: | - echo "=== Docker Container Status ===" - docker ps -a - echo "=== NetBox Container Logs ===" - docker logs $(docker ps -a | grep netbox_v4_2_netbox-1 | grep -v worker | grep -v housekeeping | awk '{print $1}') || echo "Could not find netbox container" - echo "=== All Container Health Status ===" - docker inspect $(docker ps -aq) --format='{{.Name}}: {{.State.Health.Status}}' || true