Skip to content

Commit 1b6cc04

Browse files
committed
revert removal of tests for NetBox 4.2.3
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
1 parent 82f2093 commit 1b6cc04

21 files changed

+1071
-1
lines changed

.github/workflows/lint-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
strategy:
2727
matrix:
2828
python: [ "3.10" ]
29+
netbox: [ "", "v4.2.3" ]
2930
steps:
3031
- name: Checkout
3132
uses: actions/checkout@v4
@@ -47,7 +48,7 @@ jobs:
4748
- name: Test
4849
id: test
4950
run: |
50-
make docker-compose-netbox-plugin-test-cover
51+
make NETBOX_VERSION=${{ matrix.netbox }} docker-compose-netbox-plugin-test-cover
5152
continue-on-error: true
5253
- name: Check results
5354
if: always()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM netboxcommunity/netbox:v4.2.3-3.1.1
2+
3+
COPY ./netbox/configuration/ /etc/netbox/config/
4+
RUN chmod 755 /etc/netbox/config/* && \
5+
chown unit:root /etc/netbox/config/*
6+
7+
COPY ./netbox/local_settings.py /opt/netbox/netbox/netbox/local_settings.py
8+
RUN chmod 755 /opt/netbox/netbox/netbox/local_settings.py && \
9+
chown unit:root /opt/netbox/netbox/netbox/local_settings.py
10+
11+
COPY ./requirements-diode-netbox-plugin.txt /opt/netbox/
12+
RUN /opt/netbox/venv/bin/pip install --no-warn-script-location -r /opt/netbox/requirements-diode-netbox-plugin.txt
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: diode-netbox-plugin-4.2.3
2+
services:
3+
netbox:
4+
volumes:
5+
- ./netbox/plugins_test.py:/etc/netbox/config/plugins.py:z,ro

docker/v4.2.3/docker-compose.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: diode-netbox-plugin-4.2.3
2+
services:
3+
netbox: &netbox
4+
image: netboxcommunity/netbox:v4.2.3-3.1.1-diode-netbox-plugin
5+
build:
6+
context: .
7+
dockerfile: Dockerfile-diode-netbox-plugin
8+
pull: true
9+
depends_on:
10+
- netbox-postgres
11+
- netbox-redis
12+
- netbox-redis-cache
13+
env_file: netbox/env/netbox.env
14+
user: 'unit:root'
15+
healthcheck:
16+
start_period: 60s
17+
timeout: 3s
18+
interval: 15s
19+
test: "curl -f http://localhost:8080/netbox/api/ || exit 1"
20+
volumes:
21+
- ./netbox/docker-entrypoint.sh:/opt/netbox/docker-entrypoint.sh:z,ro
22+
- ./netbox/nginx-unit.json:/opt/netbox/nginx-unit.json:z,ro
23+
- ../../netbox_diode_plugin:/opt/netbox/netbox/netbox_diode_plugin:z,rw
24+
- ../oauth2/secrets:/run/secrets:z,ro
25+
- ./netbox/launch-netbox.sh:/opt/netbox/launch-netbox.sh:z,ro
26+
- ./netbox/plugins_dev.py:/etc/netbox/config/plugins.py:z,ro
27+
- ./coverage:/opt/netbox/netbox/coverage:z,rw
28+
- netbox-media-files:/opt/netbox/netbox/media:rw
29+
- netbox-reports-files:/opt/netbox/netbox/reports:rw
30+
- netbox-scripts-files:/opt/netbox/netbox/scripts:rw
31+
extra_hosts:
32+
- "host.docker.internal:host-gateway"
33+
ports:
34+
- "8000:8080"
35+
36+
netbox-worker:
37+
<<: *netbox
38+
depends_on:
39+
netbox:
40+
condition: service_healthy
41+
command:
42+
- /opt/netbox/venv/bin/python
43+
- /opt/netbox/netbox/manage.py
44+
- rqworker
45+
healthcheck:
46+
test: ps -aux | grep -v grep | grep -q rqworker || exit 1
47+
start_period: 20s
48+
timeout: 3s
49+
interval: 15s
50+
ports: []
51+
52+
# postgres
53+
netbox-postgres:
54+
image: docker.io/postgres:16-alpine
55+
env_file: netbox/env/postgres.env
56+
volumes:
57+
- netbox-postgres-data:/var/lib/postgresql/data
58+
59+
# redis
60+
netbox-redis:
61+
image: docker.io/redis:7-alpine
62+
command:
63+
- sh
64+
- -c # this is to evaluate the $REDIS_PASSWORD from the env
65+
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
66+
env_file: netbox/env/redis.env
67+
volumes:
68+
- netbox-redis-data:/data
69+
70+
netbox-redis-cache:
71+
image: docker.io/redis:7-alpine
72+
command:
73+
- sh
74+
- -c # this is to evaluate the $REDIS_PASSWORD from the env
75+
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
76+
env_file: netbox/env/redis-cache.env
77+
volumes:
78+
- netbox-redis-cache-data:/data
79+
80+
volumes:
81+
netbox-media-files:
82+
driver: local
83+
netbox-postgres-data:
84+
driver: local
85+
netbox-redis-cache-data:
86+
driver: local
87+
netbox-redis-data:
88+
driver: local
89+
netbox-reports-files:
90+
driver: local
91+
netbox-scripts-files:
92+
driver: local

0 commit comments

Comments
 (0)