test suite with docker container and linter
This commit is contained in:
@@ -19,3 +19,44 @@ kreation: basic
|
||||
stow kreation
|
||||
bunters-monster: basic hypr kreation
|
||||
_install_skripte/buntes-monster-links.sh
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Testing (see README.md "Testing" and test/ for details)
|
||||
# ---------------------------------------------------------------------------
|
||||
.PHONY: test test-lint test-smoke test-stow test-shellcheck test-lint-docker
|
||||
|
||||
# Full test suite: fast offline lint first, then the optional Docker smoke.
|
||||
test: test-lint test-smoke
|
||||
|
||||
# Fast, offline integrity checks. No Docker required.
|
||||
# shellcheck is used if installed, otherwise only syntax checks run.
|
||||
test-lint:
|
||||
bash test/lint.sh
|
||||
|
||||
# Check stow package resolution without creating symlinks.
|
||||
test-stow:
|
||||
bash test/probe_stow.sh
|
||||
|
||||
# Run shellcheck over all tracked repo scripts (needs shellcheck installed).
|
||||
test-shellcheck:
|
||||
shellcheck -S warning $$(git ls-files '*.sh' | grep -v '/tpm/')
|
||||
|
||||
# Test shellcheck: build the /dev stage with shellcheck and run lint.sh.
|
||||
# docker build context is the repo root; .dockerignore excludes heavy dirs.
|
||||
test-lint-docker:
|
||||
docker build --target dev -t dotfiles-lint -f test/Dockerfile .
|
||||
docker run --rm dotfiles-lint
|
||||
|
||||
# Docker smoke test: builds the Arch container and runs the dry probes.
|
||||
# RUN_SMOKE=1 also installs the real pacman packages inside the container.
|
||||
# RUN_SMOKE=1 RUN_FULL=1 additionally attempts AUR/npm + hypr/kreation.
|
||||
# SKIP_NET=1 skips anything that contacts the network.
|
||||
# Example: make test-smoke RUN_SMOKE=1
|
||||
test-smoke:
|
||||
docker build --target test -t dotfiles-test -f test/Dockerfile .
|
||||
docker run --rm \
|
||||
-e RUN_SMOKE="$${RUN_SMOKE:-0}" \
|
||||
-e RUN_FULL="$${RUN_FULL:-0}" \
|
||||
-e SKIP_NET=$${SKIP_NET:-0} \
|
||||
-v "$$PWD":/dotfiles \
|
||||
dotfiles-test
|
||||
|
||||
Reference in New Issue
Block a user