Files
nixos-core/scripts/test
T

25 lines
657 B
Bash
Executable File

#!/usr/bin/env bash
# scripts/test - Automated test & invariant verification runner for Homelab Core
set -euo pipefail
cd "$(dirname "$0")/.."
echo "🔍 Running code linters (ruff)..."
if command -v ruff &>/dev/null; then
ruff check .
else
nix-shell -p ruff --run "ruff check ."
fi
echo "🧪 Running architecture & security test suite (pytest)..."
if command -v pytest &>/dev/null; then
pytest tests/
else
nix-shell -p python3Packages.pytest python3Packages.pyyaml --run "pytest tests/"
fi
echo "❄️ Verifying NixOS flake & sandbox checks..."
nix flake check
echo "✨ All tests and architectural invariants passed successfully!"