From a5826e0e746f8aeaba5bf1710740ca56427a277e Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Tue, 17 Nov 2026 14:53:34 -0500 Subject: [PATCH] fix(scripts): rename test runner to run-tests to avoid shadowing POSIX test - Rename scripts/test to scripts/run-tests to eliminate name collision with standard POSIX test (/usr/bin/test, [) - Prevent nixos-rebuild-ng activation safety assertions (test -f) from invoking the Python test suite instead of coreutils test - Update test runner invocation paths across AGENTS.md, README.md, ROADMAP.md, SECURITY.md, and documentation runbooks --- AGENTS.md | 2 +- README.md | 4 ++-- ROADMAP.md | 2 +- SECURITY.md | 2 +- docs/plans/p4-readiness-plan.md | 2 +- docs/setup_guide.md | 2 +- scripts/{test => run-tests} | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename scripts/{test => run-tests} (90%) diff --git a/AGENTS.md b/AGENTS.md index c6ffc1a..927415d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -27,7 +27,7 @@ Every implementation step must close with the automated verification gate before ```bash # Full verification gate: Ruff + Pyright + Pytest (124+ tests) + nix flake check + NixOS drv eval -./scripts/test +./scripts/run-tests # Targeted fast iteration commands (inside direnv / nix develop, or via .venv) ruff check . diff --git a/README.md b/README.md index a2dce4c..5c8f073 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ For detailed runtime layers, network segmentation, and the P4 control-plane tran │ ├── bootstrap_token.py # Operator Bearer token provisioning helper │ ├── core_manifest.py # Authoritative Pydantic v2 schema v1.0 parser for app.yaml │ ├── gitops_dispatcher.py # Authenticated webhook CD engine with Compose AST validation -│ └── test # Automated verification gate (Ruff, Pyright, Pytest, Nix flake checks) +│ └── run-tests # Automated verification gate (Ruff, Pyright, Pytest, Nix flake checks) ├── tests/ # Unit, structural, and security invariant test suites └── docs/ # Architecture references, operational runbooks, and MADR decisions ``` @@ -110,7 +110,7 @@ Entering the directory via `direnv` (`use flake`) or `nix develop` provisions th ```bash # Run full automated verification (Ruff + Pyright + Pytest + nix flake check + NixOS drv eval) -./scripts/test +./scripts/run-tests # Run individual checks directly ruff check . diff --git a/ROADMAP.md b/ROADMAP.md index f79969c..215c975 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -148,5 +148,5 @@ It describes the implementation trajectory and phased engineering milestones for Progress across milestones is governed by explicit verification criteria: * **Behavioral Invariant Coverage**: All defined domain, authorization, deployment, and security invariants must have automated regression tests. -* **Pre-Merge Validation**: Every commit must pass `./scripts/test` (Ruff linter + Pytest suite + Nix flake check). +* **Pre-Merge Validation**: Every commit must pass `./scripts/run-tests` (Ruff linter + Pytest suite + Nix flake check). * **Zero Production Regressions**: Platform migrations must include verified pre-flight snapshots, state parity proofs, and documented rollback runbooks. diff --git a/SECURITY.md b/SECURITY.md index 881705b..7b12190 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -63,7 +63,7 @@ This document outlines the security controls, container isolation rules, and ope - [x] User identities managed in LLDAP (`users.${HOMELAB_DOMAIN}`). - [x] `socket-proxy` configured with `POST=0`, `DELETE=0`, `BUILD=0`, `EXEC=0`. - [x] Webhook HMAC signature verification active on port 9000. -- [x] Invariant test runner (`./scripts/test`) passing on changes. +- [x] Invariant test runner (`./scripts/run-tests`) passing on changes. - [x] `config/letsencrypt/acme.json` permissions set to `0600`. - [x] Host firewall ports restricted to declared services in `nixos/modules/homeserver.nix`. - [x] Control plane daemon (`homelab-appctl.service`) isolated to UDS (`0660`) and loopback HTTP. diff --git a/docs/plans/p4-readiness-plan.md b/docs/plans/p4-readiness-plan.md index b10822f..27a22ed 100644 --- a/docs/plans/p4-readiness-plan.md +++ b/docs/plans/p4-readiness-plan.md @@ -391,4 +391,4 @@ Before marking Milestone P4 complete, the following automated regression suite m | **Truthful Error Reporting** | `test_execution_failure_audit`: Failing or timing-out Docker/Git subprocess returns `500 ERR_EXECUTION_FAILED` and records `phase: FAILED` in `audit.jsonl`. | Reject PR | | **Audit Persistence Gate** | `test_audit_failure_blocks_mutation`: Unwritable `audit.jsonl` aborts mutating command with `500 ERR_EXECUTION_FAILED` and zero Docker/Git invocations. | Block Release | | **Daemon Crash Recovery** | `test_daemon_restart_preserves_state`: Clean stop and restart of daemon unlinks/rebinds socket cleanly and leaves running workloads and Git state undisturbed. | Reject PR | -| **Existing Invariant Regression** | Run `./scripts/test`: All 124 existing unit, security, structural, Ruff, Pyright, and Nix flake sandbox checks pass with 0 regressions. | Block Merge | +| **Existing Invariant Regression** | Run `./scripts/run-tests`: All 124 existing unit, security, structural, Ruff, Pyright, and Nix flake sandbox checks pass with 0 regressions. | Block Merge | diff --git a/docs/setup_guide.md b/docs/setup_guide.md index 447b271..96de463 100644 --- a/docs/setup_guide.md +++ b/docs/setup_guide.md @@ -207,7 +207,7 @@ Before committing changes to Homelab Core, run the repository test runner: ```bash cd ~/Core -./scripts/test +./scripts/run-tests ``` This runs: * Code formatting and lint checks (`ruff`). diff --git a/scripts/test b/scripts/run-tests similarity index 90% rename from scripts/test rename to scripts/run-tests index 7cc5a49..d30d05f 100755 --- a/scripts/test +++ b/scripts/run-tests @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# scripts/test - Automated test & invariant verification runner for Homelab Core +# scripts/run-tests - Automated test & invariant verification runner for Homelab Core set -euo pipefail cd "$(dirname "$0")/.."