Core Architecture & Invariant CI / validate (push) Successful in 34s
- Wrap python3.withPackages in outer parentheses with proper whitespace for argument application. - Enhance scripts/test to evaluate nixosConfigurations.server toplevel derivation during pre-merge testing.
26 lines
750 B
Bash
Executable File
26 lines
750 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
|
|
nix eval .#nixosConfigurations.server.config.system.build.toplevel.drvPath --json >/dev/null
|
|
|
|
echo "✨ All tests and architectural invariants passed successfully!"
|