upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/archive/2025-11-05-ngit-relay-testing-setup.md
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:19:40 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:19:40 +0000
commit2eaff5b79fed364d5eba5eb38e4b7bf76326884d (patch)
treedeacd6294f8860096ee82ee76930204efd65e33c /docs/archive/2025-11-05-ngit-relay-testing-setup.md
parent57bc8cd9c021feaf08e139e8fb62800bc476068e (diff)
remove docs archive
Diffstat (limited to 'docs/archive/2025-11-05-ngit-relay-testing-setup.md')
-rw-r--r--docs/archive/2025-11-05-ngit-relay-testing-setup.md176
1 files changed, 0 insertions, 176 deletions
diff --git a/docs/archive/2025-11-05-ngit-relay-testing-setup.md b/docs/archive/2025-11-05-ngit-relay-testing-setup.md
deleted file mode 100644
index 7b4bd72..0000000
--- a/docs/archive/2025-11-05-ngit-relay-testing-setup.md
+++ /dev/null
@@ -1,176 +0,0 @@
1# ngit-relay Testing Setup - COMPLETE
2
3**Date:** November 5, 2025
4**Status:** ✅ COMPLETE
5**Purpose:** Document how to test grasp-audit against ngit-relay reference implementation
6
7---
8
9## ✅ What Was Done
10
11### 1. Updated grasp-audit/README.md
12
13Added comprehensive section "Integration Tests Against ngit-relay" with:
14
15- **Step-by-step manual instructions** for running tests
16- **Environment variable explanations** (all required vars documented)
17- **Port mapping details** (both WebSocket and HTTP on 8081)
18- **Clean state strategy** (fresh /tmp directories for each run)
19- **Cleanup procedures** (stop container, remove test data)
20
21### 2. Created test-ngit-relay.sh Script
22
23Automated test script at `grasp-audit/test-ngit-relay.sh` that:
24
25- ✅ Creates fresh test directories in /tmp
26- ✅ Starts ngit-relay Docker container with correct env vars
27- ✅ Waits for relay to start (3 second delay)
28- ✅ Runs integration tests (`cargo test --ignored`)
29- ✅ Stops container
30- ✅ Cleans up test data
31- ✅ Executable permissions set (`chmod +x`)
32- ✅ Syntax validated
33
34---
35
36## 🔑 Key Information
37
38### Docker Image
39```
40ghcr.io/danconwaydev/ngit-relay:latest
41```
42
43### Required Environment Variables
44```bash
45NGIT_DOMAIN=localhost # Domain name
46NGIT_RELAY_NAME="ngit-relay test instance"
47NGIT_RELAY_DESCRIPTION="Test instance for grasp-audit"
48NGIT_OWNER_NPUB="npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr"
49NGIT_PROACTIVE_SYNC_GIT=false # Disable for testing
50NGIT_PROACTIVE_SYNC_BLOSSOM=false # Disable for testing
51NGIT_PROACTIVE_SYNC_NOSTR=false # Disable for testing
52NGIT_LOG_LEVEL=INFO # For debugging
53```
54
55### Volume Mounts (Fresh for Each Run)
56```bash
57/tmp/ngit-test/repos → /srv/ngit-relay/repos
58/tmp/ngit-test/blossom → /srv/ngit-relay/blossom
59/tmp/ngit-test/relay-db → /srv/ngit-relay/relay-db
60/tmp/ngit-test/logs → /var/log/ngit-relay
61```
62
63### Port Mapping
64```
658081:8081 # Both WebSocket (relay) and HTTP (git) on same port
66```
67
68### Endpoints
69- **WebSocket (Nostr relay):** `ws://localhost:8081/`
70- **Git HTTP:** `http://localhost:8081/<npub>/<identifier>.git`
71
72---
73
74## 🎯 Usage
75
76### Option 1: Manual Commands
77
78```bash
79cd grasp-audit
80
81# 1. Create temp directories
82mkdir -p /tmp/ngit-test/{repos,blossom,relay-db,logs}
83
84# 2. Start relay
85docker run --rm -d \
86 --name ngit-relay-test \
87 -p 8081:8081 \
88 -e NGIT_DOMAIN=localhost \
89 -e NGIT_RELAY_NAME="ngit-relay test instance" \
90 -e NGIT_RELAY_DESCRIPTION="Test instance for grasp-audit" \
91 -e NGIT_OWNER_NPUB="npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr" \
92 -e NGIT_PROACTIVE_SYNC_GIT=false \
93 -e NGIT_PROACTIVE_SYNC_BLOSSOM=false \
94 -e NGIT_PROACTIVE_SYNC_NOSTR=false \
95 -e NGIT_LOG_LEVEL=INFO \
96 -v /tmp/ngit-test/repos:/srv/ngit-relay/repos \
97 -v /tmp/ngit-test/blossom:/srv/ngit-relay/blossom \
98 -v /tmp/ngit-test/relay-db:/srv/ngit-relay/relay-db \
99 -v /tmp/ngit-test/logs:/var/log/ngit-relay \
100 ghcr.io/danconwaydev/ngit-relay:latest
101
102# 3. Wait for startup
103sleep 3
104
105# 4. Run tests
106cargo test --ignored
107
108# 5. Cleanup
109docker stop ngit-relay-test
110rm -rf /tmp/ngit-test
111```
112
113### Option 2: Quick Script
114
115```bash
116cd grasp-audit
117./test-ngit-relay.sh
118```
119
120---
121
122## 🧪 What Gets Tested
123
124When you run `cargo test --ignored`, it runs integration tests that:
125
1261. **Connect to the relay** at `ws://localhost:8081/`
1272. **Verify NIP-01 compliance** (smoke tests)
1283. **Test GRASP-01 features** (when implemented)
1294. **Validate against reference implementation** behavior
130
131---
132
133## ✅ Benefits
134
135### Clean State Every Run
136- Fresh directories in /tmp
137- No pollution from previous tests
138- Matches CI environment
139
140### Easy Debugging
141- Manual commands for step-by-step debugging
142- Automated script for quick validation
143- Logs available in /tmp/ngit-test/logs
144
145### Reference Implementation Testing
146- Tests against the actual GRASP reference (ngit-relay)
147- Ensures compatibility with real-world implementation
148- Validates our tests match expected behavior
149
150---
151
152## 📚 References
153
154- **ngit-relay repo:** `../ngit-relay`
155- **Docker image:** `ghcr.io/danconwaydev/ngit-relay:latest`
156- **Environment vars:** `../ngit-relay/.env.example`
157- **Documentation:** `../ngit-relay/README.md`
158
159---
160
161## 🔜 Next Steps
162
163Now that we can test against ngit-relay, we're ready to:
164
1651. ✅ **Verify current NIP-01 smoke tests work** against ngit-relay
1662. 🔜 **Implement GRASP-01 tests** one at a time (per plan in work/current_status.md)
1673. 🔜 **Validate each test** against reference implementation
1684. 🔜 **Document any behavioral differences** we discover
169
170---
171
172**Ready to proceed with test implementation!**
173
174The plan in `work/current_status.md` calls for implementing GRASP-01 tests one at a time, each in a fresh session, validating against ngit-relay.
175
176We now have the infrastructure to do exactly that. ✅