mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
Fix cargo test invocation in test-ngit-relay.sh and documentation
- Changed from 'cargo test --lib test_grasp01_nostr_relay_against_relay' to 'cargo test --lib -- --ignored --nocapture' - This correctly runs ALL library tests marked with #[ignore], not just GRASP-01 - Updated AGENTS.md and grasp-audit/README.md with correct commands - Added examples showing both 'run all ignored tests' and 'run specific test' patterns
This commit is contained in:
@@ -37,6 +37,10 @@ nix-shell --run "cargo build"
|
||||
docker run --rm -p 18081:8081 ghcr.io/danconwaydev/ngit-relay:latest
|
||||
|
||||
# From grasp-audit directory, set RELAY_URL to match your port
|
||||
# Run all ignored tests (includes GRASP-01 and other relay-dependent tests)
|
||||
RELAY_URL="ws://localhost:18081" nix develop -c cargo test --lib -- --ignored --nocapture
|
||||
|
||||
# Or run a specific test
|
||||
RELAY_URL="ws://localhost:18081" nix develop -c cargo test --lib test_grasp01_nostr_relay_against_relay -- --ignored --nocapture
|
||||
```
|
||||
|
||||
@@ -89,12 +93,16 @@ nix develop -c cargo test --lib specific_test_name -- --nocapture
|
||||
To verify GRASP-01 compliance tests are working correctly:
|
||||
|
||||
```bash
|
||||
# Run all ignored library tests (includes GRASP-01)
|
||||
cd grasp-audit && RELAY_URL="ws://localhost:18081" nix develop -c cargo test --lib -- --ignored --nocapture 2>&1 | tail -60
|
||||
|
||||
# Or run specific GRASP-01 test
|
||||
cd grasp-audit && RELAY_URL="ws://localhost:18081" nix develop -c cargo test --lib test_grasp01_nostr_relay_against_relay -- --ignored --nocapture 2>&1 | tail -60
|
||||
```
|
||||
|
||||
**Expected Output:**
|
||||
- 2-3 tests passing
|
||||
- 15 tests showing "Not implemented yet"
|
||||
- 15+ tests showing "Not implemented yet"
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
@@ -194,7 +202,8 @@ cd grasp-audit && nix develop -c cargo build
|
||||
|
||||
# Manual relay testing (if needed)
|
||||
# 1. Start relay: docker run --rm -p 18081:8081 ghcr.io/danconwaydev/ngit-relay:latest
|
||||
# 2. Run tests: RELAY_URL="ws://localhost:18081" nix develop -c cargo test --ignored
|
||||
# 2. Run all ignored tests: RELAY_URL="ws://localhost:18081" nix develop -c cargo test --lib -- --ignored --nocapture
|
||||
# 3. Or specific test: RELAY_URL="ws://localhost:18081" nix develop -c cargo test --lib test_grasp01_nostr_relay_against_relay -- --ignored --nocapture
|
||||
|
||||
# Run single test
|
||||
cd grasp-audit && nix develop -c cargo test --lib test_name -- --nocapture
|
||||
|
||||
@@ -178,7 +178,10 @@ docker run --rm -p 18081:8081 ghcr.io/danconwaydev/ngit-relay:latest
|
||||
# In another terminal, run tests with RELAY_URL
|
||||
grasp-audit audit --relay ws://localhost:18081 --mode ci
|
||||
|
||||
# or specific test via cargo
|
||||
# or run all ignored tests via cargo
|
||||
RELAY_URL="ws://localhost:18081" cargo test --lib -- --ignored --nocapture
|
||||
|
||||
# or run specific test via cargo
|
||||
RELAY_URL="ws://localhost:18081" cargo test --lib test_grasp01_nostr_relay_against_relay -- --ignored --nocapture
|
||||
```
|
||||
|
||||
|
||||
@@ -195,12 +195,13 @@ elif [ "$MODE" = "test" ]; then
|
||||
# Run cargo test suite
|
||||
# - RELAY_URL: Environment variable tests use to connect
|
||||
# - --lib: Only library tests (not integration tests in tests/)
|
||||
# - test_grasp01_nostr_relay_against_relay: Specific test module
|
||||
# - --ignored: Run tests marked with #[ignore] (these need relay)
|
||||
# - --nocapture: Show println! output from tests
|
||||
# This runs all library tests marked with #[ignore], including:
|
||||
# - test_grasp01_nostr_relay_against_relay (GRASP-01 relay tests)
|
||||
# - Any other integration tests requiring a relay
|
||||
RELAY_URL="ws://localhost:$PORT" cargo test \
|
||||
--lib test_grasp01_nostr_relay_against_relay \
|
||||
-- --ignored --nocapture || {
|
||||
--lib -- --ignored --nocapture || {
|
||||
echo "⚠️ Some tests failed"
|
||||
echo " Review output above for details"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user