upleb.uk

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

summaryrefslogtreecommitdiff
path: root/grasp-audit/test-ngit-relay.sh
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-11-05 07:03:04 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-11-05 07:03:04 +0000
commit74c7b090a6ec7f749a3a79dcb0c9a0a6bc198702 (patch)
treecfb3a0b6ac170ff54a7f82cfd0472ecbfe1206cf /grasp-audit/test-ngit-relay.sh
parent5cd47079ee762125817612d2bf82a0bca07da3ad (diff)
test: add ngit-relay integration testing instructions
- Add RELAY_URL environment variable support to tests - Document expected behavior when testing against ngit-relay - Add test-ngit-relay.sh script for automated testing - Clarify that ngit-relay only accepts Git events (NIP-34) - Note that 4/6 NIP-01 smoke tests passing is expected - Key validation tests (invalid signature/ID) pass correctly - Add instructions for testing against general-purpose relays The validation tests passing confirms ngit-relay implements NIP-01 correctly, even though it has restrictive acceptance policies.
Diffstat (limited to 'grasp-audit/test-ngit-relay.sh')
-rwxr-xr-xgrasp-audit/test-ngit-relay.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/grasp-audit/test-ngit-relay.sh b/grasp-audit/test-ngit-relay.sh
new file mode 100755
index 0000000..b719b86
--- /dev/null
+++ b/grasp-audit/test-ngit-relay.sh
@@ -0,0 +1,46 @@
1#!/bin/bash
2set -e
3
4echo "๐Ÿงน Cleaning up old test data..."
5# Use docker to cleanup with proper permissions
6docker run --rm -v /tmp/ngit-test:/data alpine sh -c "rm -rf /data/*" 2>/dev/null || true
7mkdir -p /tmp/ngit-test/{repos,blossom,relay-db,logs}
8
9echo "๐Ÿš€ Starting ngit-relay..."
10# Remove any existing container with this name
11docker rm -f ngit-relay-test 2>/dev/null || true
12docker run --rm -d \
13 --name ngit-relay-test \
14 -p 8082:8081 \
15 -e NGIT_DOMAIN=localhost \
16 -e NGIT_RELAY_NAME="ngit-relay test instance" \
17 -e NGIT_RELAY_DESCRIPTION="Test instance for grasp-audit" \
18 -e NGIT_OWNER_NPUB="npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr" \
19 -e NGIT_PROACTIVE_SYNC_GIT=false \
20 -e NGIT_PROACTIVE_SYNC_BLOSSOM=false \
21 -e NGIT_PROACTIVE_SYNC_NOSTR=false \
22 -e NGIT_LOG_LEVEL=INFO \
23 -v /tmp/ngit-test/repos:/srv/ngit-relay/repos \
24 -v /tmp/ngit-test/blossom:/srv/ngit-relay/blossom \
25 -v /tmp/ngit-test/relay-db:/srv/ngit-relay/relay-db \
26 -v /tmp/ngit-test/logs:/var/log/ngit-relay \
27 ghcr.io/danconwaydev/ngit-relay:latest
28
29echo "โณ Waiting for relay to start..."
30sleep 3
31
32echo "๐Ÿงช Running tests..."
33echo ""
34echo "Note: ngit-relay only accepts Git-related events (NIP-34)."
35echo "Some NIP-01 smoke tests will fail (expected behavior)."
36echo "Validation tests should pass."
37echo ""
38RELAY_URL=ws://localhost:8082 cargo test --lib -- --ignored --nocapture
39
40echo "๐Ÿ›‘ Stopping relay..."
41docker stop ngit-relay-test
42
43echo "๐Ÿงน Cleaning up..."
44docker run --rm -v /tmp/ngit-test:/data alpine sh -c "rm -rf /data/*" 2>/dev/null || true
45
46echo "โœ… Done!"