Files
nixos-core/scripts/test
T
kiskaadee ccea8abb4a
Core Architecture & Invariant CI / validate (push) Successful in 34s
fix(nixos): correct python3.withPackages syntax in systemPackages and add toplevel evaluation to test script
- 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.
2026-10-13 07:12:53 -05:00

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