From ff00d106da0abd734a233e6445cdd81ffb5f1d9f Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 5 Nov 2025 11:05:53 +0000 Subject: docs: fixed desired grasp-audit behaviour in README.md --- grasp-audit/README.md | 36 ++++++++-------------------- grasp-audit/src/specs/grasp01_nostr_relay.rs | 5 ++-- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/grasp-audit/README.md b/grasp-audit/README.md index b73d72b..3787fee 100644 --- a/grasp-audit/README.md +++ b/grasp-audit/README.md @@ -44,8 +44,8 @@ cargo install --path . # Run smoke tests against local relay grasp-audit audit --relay ws://localhost:7000 --mode ci --spec nip01-smoke -# Audit production server (read-only) -grasp-audit audit --relay wss://relay.example.com --mode production --spec all +# Audit production server +grasp-audit audit --relay wss://grasp.example.com --mode production --spec all ``` ## Test Specifications @@ -77,9 +77,9 @@ All audit events include special tags: ```json { "tags": [ - ["grasp-audit", "true"], - ["audit-run-id", "ci-a1b2c3d4-e5f6-7890-abcd-ef1234567890"], - ["audit-cleanup", "2025-11-03T12:00:00Z"] + ["t", "grasp-audit"], + ["r", "audit-run-id-ci-a1b2c3d4-e5f6-7890-abcd-ef1234567890"], + ["r", "audit-cleanup-2025-11-03T12:00:00Z"] ] } ``` @@ -134,7 +134,7 @@ nix develop cargo test ``` -### Integration Tests Against ngit-relay +### Integration Tests Against ngit-relay docker image Test against the reference GRASP implementation to ensure compatibility. @@ -151,31 +151,15 @@ See `test-ngit-relay.sh` for full setup/cleanup details. ```bash # Start relay on a specific port (example uses 18081) -docker run --rm -p 18081:8081 -e NGIT_BIND_ADDRESS=0.0.0.0:8081 ghcr.io/danconwaydev/ngit-relay:latest +docker run --rm -p 18081:8081 ghcr.io/danconwaydev/ngit-relay:latest # In another terminal, run tests with RELAY_URL -RELAY_URL="ws://localhost:18081" cargo test --lib test_grasp01_nostr_relay_against_relay -- --ignored --nocapture -``` - -**Note:** ngit-relay only accepts Git-related events (NIP-34). Some NIP-01 smoke tests will fail (expected). Validation tests should pass. - -### Testing Against General-Purpose Relays - -For full NIP-01 smoke test coverage (all 6 tests passing), test against a general-purpose relay: +grasp-audit audit --relay ws://localhost:18081 --mode ci -```bash -# Start nostr-rs-relay (accepts all event kinds) -docker run --rm -d --name nostr-test-relay -p 7000:8080 scsibug/nostr-rs-relay - -# Run tests (all should pass) -cargo test --lib -- --ignored --nocapture - -# Cleanup -docker stop nostr-test-relay +# or specific test via cargo +RELAY_URL="ws://localhost:18081" cargo test --lib test_grasp01_nostr_relay_against_relay -- --ignored --nocapture ``` -Expected: 6/6 tests passed (100%) - ## Architecture ``` diff --git a/grasp-audit/src/specs/grasp01_nostr_relay.rs b/grasp-audit/src/specs/grasp01_nostr_relay.rs index ca84a4b..7c4ef1e 100644 --- a/grasp-audit/src/specs/grasp01_nostr_relay.rs +++ b/grasp-audit/src/specs/grasp01_nostr_relay.rs @@ -653,9 +653,8 @@ mod tests { #[tokio::test] #[ignore] // Requires running relay async fn test_grasp01_nostr_relay_against_relay() { - // Read relay URL from environment variable, default to localhost:8081 - let relay_url = std::env::var("RELAY_URL") - .unwrap_or_else(|_| "ws://localhost:8081".to_string()); + // Read relay URL from environment variable - must be supplied + let relay_url = std::env::var("RELAY_URL")?; let config = AuditConfig::ci(); let client = AuditClient::new(&relay_url, config) -- cgit v1.2.3