#!/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!"