test: Test suite against CTFd's own test app, lint tooling
- plugin_tests/: 9 tests running the plugin inside CTFd 3.8.9's test app (users and teams mode): own/shared flags, single reports, admins, invalid owners and empty flags, teams, create_flag_if_missing, the admin flag form, the admin page and dismissing. - make venv (uv, Python 3.11), make lint, make format, make test: same tools and versions as ctfd-whale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8084b3996a
commit
e54d98498c
7 files changed
+307
No files matched your search
@@ -0,0 +1,25 @@
|
||||
# Same lint tools and rules as CTFd 3.8.9 (see CTFd's Makefile and linting.txt).
|
||||
# Setup: make venv (needs uv; Python 3.11 like CTFd's Docker image)
|
||||
VENV ?= .venv/bin
|
||||
CTFD_PATH ?= ../CTFd
|
||||
PYTHON ?= 3.11
|
||||
|
||||
venv:
|
||||
uv venv --python $(PYTHON) .venv
|
||||
uv pip install --python .venv/bin/python -r $(CTFD_PATH)/requirements.txt -r dev-requirements.txt
|
||||
|
||||
lint:
|
||||
$(VENV)/ruff check --select E,F,W,B,C4,I --ignore E402,E501,E712,B904,B905,I001 --exclude=.venv .
|
||||
$(VENV)/isort --profile=black --check-only --skip=.venv .
|
||||
$(VENV)/black --check --diff --exclude=.venv .
|
||||
|
||||
format:
|
||||
$(VENV)/isort --profile=black --skip=.venv .
|
||||
$(VENV)/black --exclude=.venv .
|
||||
|
||||
# Runs inside CTFd's own test app, with the plugin loaded from this
|
||||
# checkout; CTFD_PATH must be a checkout of the CTFd version it targets.
|
||||
test:
|
||||
CTFD_PATH=$(CTFD_PATH) $(VENV)/pytest -c plugin_tests/pytest.ini plugin_tests
|
||||
|
||||
.PHONY: venv lint format test
|
||||
Reference in new issue
Block a user