agent-orchestrator/scripts/check-test-flags.sh
Hibryda e76bc341f2 refactor(e2e): extract infrastructure into tests/e2e/infra/ module
- Move fixtures.ts, llm-judge.ts, results-db.ts to tests/e2e/infra/
- Deduplicate wdio.conf.js: use createTestFixture() instead of inline copy
- Replace __dirname paths with projectRoot-anchored paths
- Create test-mode-constants.ts (typed env var names, flag registry)
- Create scripts/preflight-check.sh (validates tauri-driver, display, Claude CLI)
- Create scripts/check-test-flags.sh (CI lint for AGOR_TEST flag drift)
- Rewrite tests/e2e/README.md with full documentation
- Update spec imports for moved infra files
2026-03-18 03:06:57 +01:00

50 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# Lint check: verify all AGOR_TEST references are documented.
# Run in CI to catch flag drift between code and documentation.
set -euo pipefail
echo "Checking AGOR_TEST flag references..."
# Known files that should reference AGOR_TEST (from test-mode-constants.ts)
KNOWN_FILES=(
"agor-core/src/config.rs"
"src-tauri/src/commands/misc.rs"
"src-tauri/src/lib.rs"
"src-tauri/src/watcher.rs"
"src-tauri/src/fs_watcher.rs"
"src-tauri/src/telemetry.rs"
"src/App.svelte"
"tests/e2e/wdio.conf.js"
"tests/e2e/infra/fixtures.ts"
"tests/e2e/infra/test-mode-constants.ts"
)
# Find all files referencing AGOR_TEST (excluding node_modules, target, .git)
FOUND=$(grep -rl 'AGOR_TEST' --include='*.rs' --include='*.ts' --include='*.js' --include='*.svelte' \
--exclude-dir=node_modules --exclude-dir=target --exclude-dir=.git . 2>/dev/null | \
sed 's|^\./||' | sort)
UNKNOWN=""
for f in $FOUND; do
MATCH=0
for k in "${KNOWN_FILES[@]}"; do
if [[ "$f" == "$k" ]]; then
MATCH=1
break
fi
done
if [[ $MATCH -eq 0 ]]; then
UNKNOWN="$UNKNOWN $f\n"
fi
done
if [[ -n "$UNKNOWN" ]]; then
echo ""
echo "WARNING: AGOR_TEST referenced in files not in the known registry:"
echo -e "$UNKNOWN"
echo "Update tests/e2e/infra/test-mode-constants.ts and this script."
exit 1
else
echo "All AGOR_TEST references are documented. ✓"
fi