Skip to content

Prepared release 1.6.1 #2305

Prepared release 1.6.1

Prepared release 1.6.1 #2305

Workflow file for this run

name: Test with all supported Python versions
on:
- push
- pull_request
permissions:
contents: read
jobs:
test-netbox:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13", "3.14"]
services:
redis:
image: redis
ports:
- 6379:6379
postgres:
image: postgres
env:
POSTGRES_USER: netbox
POSTGRES_PASSWORD: netbox
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
path: netbox-plugin-dns
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@4f41a90a1f38628c7ccc608d05fbafe701bc20ae
with:
python-version: ${{ matrix.python-version }}
- name: Checkout NetBox
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
repository: "netbox-community/netbox"
path: netbox
ref: v4.6.10
- name: Install NetBox DNS
working-directory: netbox-plugin-dns
run: |
# include tests directory for test
sed -i 's/exclude/#exclude/g' pyproject.toml
pip install .
- name: Install dependencies
working-directory: netbox
run: |
python -m pip install --upgrade pip
python -m pip install tblib
pip install -r requirements.txt -U
- name: Run tests
working-directory: netbox
run: >
NETBOX_CONFIGURATION=netbox_dns.tests.configuration
python netbox/manage.py test netbox_dns.tests --parallel -v2
test-netbox-branching:
# Exercises the NetBox Branching integration (netbox_dns.tests.branching).
# These tests provision real branch schemas, so they run separately from
# the main suite: without --parallel, with netbox-branching installed and
# a branching-aware configuration.
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
postgres:
image: postgres
env:
POSTGRES_USER: netbox
POSTGRES_PASSWORD: netbox
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
path: netbox-plugin-dns
- name: Set up Python
uses: actions/setup-python@4f41a90a1f38628c7ccc608d05fbafe701bc20ae
with:
python-version: "3.12"
- name: Checkout NetBox
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98
with:
repository: "netbox-community/netbox"
path: netbox
ref: main
- name: Install NetBox DNS
working-directory: netbox-plugin-dns
run: |
# include tests directory for test
sed -i 's/exclude/#exclude/g' pyproject.toml
pip install .
- name: Install dependencies
working-directory: netbox
run: |
python -m pip install --upgrade pip
python -m pip install tblib
pip install -r requirements.txt -U
# register_branching_resolver (the API this integration relies on)
# is available in netbox-branching >= 1.0.4.
pip install 'netboxlabs-netbox-branching>=1.0.4'
- name: Tune PostgreSQL for branching test performance
run: |
sudo apt-get install -y -q postgresql-client
PGPASSWORD=netbox psql -h localhost -U netbox \
-c "ALTER SYSTEM SET checkpoint_timeout = '30min'" \
-c "ALTER SYSTEM SET max_wal_size = '2GB'" \
-c "ALTER SYSTEM SET synchronous_commit = off" \
-c "ALTER SYSTEM SET lock_timeout = '60s'" \
-c "SELECT pg_reload_conf()"
- name: Run branching tests
working-directory: netbox
run: >
NETBOX_CONFIGURATION=netbox_dns.tests.configuration_branching
python netbox/manage.py test netbox_dns.tests.branching --keepdb -v2