feat: throwaway netbox deployment for end-to-end testing

compose stack modelled on the production netbox deployment (same pinned
images, worker, healthchecks) minus traefik: the API is served straight
on localhost and nothing survives an e2e-down.
This commit is contained in:
2026-08-25 13:47:18 +02:00
parent e4a1e6a472
commit 706a12b8e4
4 changed files with 144 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2026 Bryan Joshua Pedini
.PHONY: help dev-environment test lint lint-fix format clean
.PHONY: help dev-environment test lint lint-fix format clean e2e-up e2e-down test-e2e
VENV ?= .venv
PYTHON ?= $(VENV)/bin/python
@@ -13,6 +13,9 @@ help:
@echo " lint-fix run ruff checks and fix what is auto-fixable"
@echo " format run the ruff formatter"
@echo " clean remove the virtualenv and caches"
@echo " e2e-up start the throwaway NetBox stack for e2e tests"
@echo " e2e-down stop the e2e stack and delete its data"
@echo " test-e2e run the end-to-end tests against the e2e stack"
dev-environment:
python3 -m venv $(VENV)
@@ -31,5 +34,15 @@ lint-fix:
format:
$(PYTHON) -m ruff format .
e2e-up:
test -f e2e/.env || cp e2e/env.example e2e/.env
docker compose --project-directory e2e --env-file e2e/.env up -d --wait
e2e-down:
docker compose --project-directory e2e --env-file e2e/.env down -v
test-e2e:
$(PYTHON) -m pytest e2e
clean:
rm -rf $(VENV) .pytest_cache .ruff_cache __pycache__ tests/__pycache__