diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-28 01:44:58 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-28 01:44:58 +0000 |
| commit | f053827e0a157f348d9cf834f026a8de322abfe2 (patch) | |
| tree | 4dcde0f1e92dfe26fde131ef0f3f35e677e56b5b /grasp-audit/test-ngit-relay.sh | |
| parent | 0c1d60a2ad69e79e83d36ed8a001743fde3d6666 (diff) | |
grasp-audit run all tests in audit mode
Diffstat (limited to 'grasp-audit/test-ngit-relay.sh')
| -rwxr-xr-x | grasp-audit/test-ngit-relay.sh | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/grasp-audit/test-ngit-relay.sh b/grasp-audit/test-ngit-relay.sh index 2f43042..2e013b1 100755 --- a/grasp-audit/test-ngit-relay.sh +++ b/grasp-audit/test-ngit-relay.sh | |||
| @@ -35,19 +35,27 @@ OPTIONS: | |||
| 35 | --mode <audit|test> Execution mode (default: audit) | 35 | --mode <audit|test> Execution mode (default: audit) |
| 36 | audit: Run grasp-audit CLI tool | 36 | audit: Run grasp-audit CLI tool |
| 37 | test: Run cargo test suite | 37 | test: Run cargo test suite |
| 38 | --spec <spec> Specification to test (default: nip01-smoke) | 38 | --spec <spec> Specification to test (default: all) |
| 39 | Available specs: nip01-smoke, nip11, event-acceptance, | ||
| 40 | cors, git-clone, push-auth, repo-creation, all | ||
| 39 | Only used in audit mode | 41 | Only used in audit mode |
| 40 | --help Show this help message | 42 | --help Show this help message |
| 41 | 43 | ||
| 42 | EXAMPLES: | 44 | EXAMPLES: |
| 43 | # Run audit with default settings (current behavior) | 45 | # Run audit with all tests (default) |
| 44 | ./test-ngit-relay.sh | 46 | ./test-ngit-relay.sh |
| 45 | 47 | ||
| 46 | # Run cargo tests instead | 48 | # Run cargo tests instead |
| 47 | ./test-ngit-relay.sh --mode test | 49 | ./test-ngit-relay.sh --mode test |
| 48 | 50 | ||
| 49 | # Run audit with specific spec | 51 | # Run audit with specific spec |
| 50 | ./test-ngit-relay.sh --mode audit --spec grasp01 | 52 | ./test-ngit-relay.sh --mode audit --spec nip01-smoke |
| 53 | ./test-ngit-relay.sh --mode audit --spec nip11 | ||
| 54 | ./test-ngit-relay.sh --mode audit --spec event-acceptance | ||
| 55 | ./test-ngit-relay.sh --mode audit --spec cors | ||
| 56 | ./test-ngit-relay.sh --mode audit --spec git-clone | ||
| 57 | ./test-ngit-relay.sh --mode audit --spec push-auth | ||
| 58 | ./test-ngit-relay.sh --mode audit --spec repo-creation | ||
| 51 | 59 | ||
| 52 | EOF | 60 | EOF |
| 53 | exit 0 | 61 | exit 0 |
| @@ -56,9 +64,9 @@ EOF | |||
| 56 | # ----------------------------------------------------------------------------- | 64 | # ----------------------------------------------------------------------------- |
| 57 | # Argument Parsing | 65 | # Argument Parsing |
| 58 | # ----------------------------------------------------------------------------- | 66 | # ----------------------------------------------------------------------------- |
| 59 | # Default values maintain backward compatibility | 67 | # Default: run audit mode with all specs |
| 60 | MODE="audit" | 68 | MODE="audit" |
| 61 | SPEC="nip01-smoke" | 69 | SPEC="all" |
| 62 | 70 | ||
| 63 | # Parse command-line arguments | 71 | # Parse command-line arguments |
| 64 | while [[ $# -gt 0 ]]; do | 72 | while [[ $# -gt 0 ]]; do |
| @@ -184,11 +192,13 @@ if [ "$MODE" = "audit" ]; then | |||
| 184 | # - --relay: Command-line parameter for relay address | 192 | # - --relay: Command-line parameter for relay address |
| 185 | # - --mode ci: Continuous integration mode (structured output) | 193 | # - --mode ci: Continuous integration mode (structured output) |
| 186 | # - --spec: Which specification to test | 194 | # - --spec: Which specification to test |
| 195 | # - --git-data-dir: Path to git data directory (for git-clone, push-auth, repo-creation) | ||
| 187 | # The '|| { }' block provides user-friendly messaging on failure | 196 | # The '|| { }' block provides user-friendly messaging on failure |
| 188 | RELAY_URL="ws://localhost:$PORT" cargo run -- audit \ | 197 | RELAY_URL="ws://localhost:$PORT" cargo run -- audit \ |
| 189 | --relay "ws://localhost:$PORT" \ | 198 | --relay "ws://localhost:$PORT" \ |
| 190 | --mode ci \ | 199 | --mode ci \ |
| 191 | --spec "$SPEC" || { | 200 | --spec "$SPEC" \ |
| 201 | --git-data-dir "$TEST_DIR/repos" || { | ||
| 192 | echo "⚠️ Some tests failed (expected for ngit-relay)" | 202 | echo "⚠️ Some tests failed (expected for ngit-relay)" |
| 193 | echo " Validation tests should have passed" | 203 | echo " Validation tests should have passed" |
| 194 | } | 204 | } |