From 38952e10f01cf413a48370e3bc342b149c3b2c78 Mon Sep 17 00:00:00 2001 From: ryanmerolle Date: Fri, 23 Jun 2023 21:18:04 +0000 Subject: [PATCH] housekeeping --- .devcontainer/requirements-dev.txt | 1 + .gitignore | 15 +++++++++++++++ Makefile | 11 +++++++++-- test.sh | 2 +- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.devcontainer/requirements-dev.txt b/.devcontainer/requirements-dev.txt index 80fc9bf..5b4885e 100644 --- a/.devcontainer/requirements-dev.txt +++ b/.devcontainer/requirements-dev.txt @@ -2,6 +2,7 @@ autoflake autopep8 bandit black +coverage flake8 isort mypy diff --git a/.gitignore b/.gitignore index 2f771e8..52547c9 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,18 @@ cython_debug/ .vscode/ # JetBrains .idea/ + +# Temporary files +*.tmp +tmp/ + +# coverage +coverage/ +htmlcov/ +.coverage +.coverage.* +coverage.xml +*.cover + +# ruff +.ruff_cache/ diff --git a/Makefile b/Makefile index fb3ba16..259948c 100644 --- a/Makefile +++ b/Makefile @@ -75,8 +75,15 @@ rebuild: setup makemigrations migrate collectstatic start .PHONY: test test: setup - ${VENV_PY_PATH} ${NETBOX_MANAGE_PATH}/manage.py makemigrations ${PLUGIN_NAME} --check - ${VENV_PY_PATH} ${NETBOX_MANAGE_PATH}/manage.py test ${PLUGIN_NAME} + ${NETBOX_MANAGE_PATH}/manage.py makemigrations ${PLUGIN_NAME} --check + coverage run --source "netbox_acls" ${NETBOX_MANAGE_PATH}/manage.py test ${PLUGIN_NAME} -v 2 + +.PHONY: coverage_report +coverage_report: + coverage report + +.PHONY: test_coverage +test_coverage: test coverage_report #relpatch: # $(eval GSTATUS := $(shell git status --porcelain)) diff --git a/test.sh b/test.sh index 5fc2e06..7f16723 100755 --- a/test.sh +++ b/test.sh @@ -17,7 +17,7 @@ doco="docker compose --file docker-compose.yml" test_netbox_unit_tests() { echo "⏱ Running NetBox Unit Tests" $doco run --rm netbox python manage.py makemigrations netbox_acls --check - $doco run --rm netbox python manage.py test netbox_acls + $doco run --rm netbox python manage.py test netbox_acls -v 2 } test_cleanup() {