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
7 changes: 6 additions & 1 deletion .github/workflows/py3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/development/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pytest
from packaging import version

DEFAULT_NETBOX_VERSIONS = "4.3"
DEFAULT_NETBOX_VERSIONS = "4.4"


def pytest_addoption(parser):
Expand Down
18 changes: 14 additions & 4 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"] = {
Expand Down