upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/test_relay.sh
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-11-04 21:58:23 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-11-04 21:58:23 +0000
commit652c5913f695ba7e8dfd78cd0cbe5cc3de67fa59 (patch)
treee76bc0bcdc9eeec466ddf6e5e75a7f63a9d6650e /test_relay.sh
parentc2c0cdba4af434043f3fa707231d8f5a7e3fd882 (diff)
test: migrate to TestRelay fixture pattern and add compliance docs
- Remove unnecessary 'nix' dev dependency (Unix syscalls crate, not needed) - Migrate announcement tests to new TestRelay fixture pattern - Delete legacy test files (announcement_tests.rs, test_relay.sh) - Add comprehensive test documentation (docs/how-to/test-compliance.md) - Update README.md with new test commands - All 18 integration tests passing (NIP-01 + NIP-34) Benefits: - Automatic relay lifecycle management - No manual setup required - Pure Rust integration tests - Better developer experience - CI/CD ready
Diffstat (limited to 'test_relay.sh')
-rwxr-xr-xtest_relay.sh49
1 files changed, 0 insertions, 49 deletions
diff --git a/test_relay.sh b/test_relay.sh
deleted file mode 100755
index be463fa..0000000
--- a/test_relay.sh
+++ /dev/null
@@ -1,49 +0,0 @@
1#!/usr/bin/env bash
2set -e
3
4echo "๐Ÿงช Testing ngit-grasp NIP-01 relay"
5echo ""
6
7# Start the relay in the background
8echo "๐Ÿ“ก Starting relay on port 9000..."
9cd grasp-audit
10nix develop -c bash -c "cd .. && NGIT_BIND_ADDRESS=127.0.0.1:9000 RUST_LOG=info cargo run" > /tmp/relay.log 2>&1 &
11RELAY_PID=$!
12cd ..
13
14echo "Relay PID: $RELAY_PID"
15echo "Waiting for relay to start..."
16sleep 3
17
18# Check if relay is running
19if ! ps -p $RELAY_PID > /dev/null; then
20 echo "โŒ Relay failed to start"
21 cat /tmp/relay.log
22 exit 1
23fi
24
25echo "โœ… Relay started"
26echo ""
27
28# Run the audit
29echo "๐Ÿ” Running NIP-01 smoke tests..."
30cd grasp-audit
31nix develop -c cargo run -- audit --relay ws://127.0.0.1:9000 --spec nip01-smoke
32
33# Capture exit code
34AUDIT_EXIT=$?
35
36# Stop the relay
37echo ""
38echo "๐Ÿ›‘ Stopping relay..."
39kill $RELAY_PID 2>/dev/null || true
40wait $RELAY_PID 2>/dev/null || true
41
42# Show relay log if there were errors
43if [ $AUDIT_EXIT -ne 0 ]; then
44 echo ""
45 echo "๐Ÿ“‹ Relay log:"
46 cat /tmp/relay.log
47fi
48
49exit $AUDIT_EXIT