upleb.uk

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

summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-11-04 14:33:18 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-11-04 14:33:18 +0000
commitc2c0cdba4af434043f3fa707231d8f5a7e3fd882 (patch)
tree02adae65fba476e5fcdf1fadcd0ce9efa4f1fbcd /README.md
parent4d89f4537c325f60571cc6339df0708ee8161514 (diff)
add announcement tests
Diffstat (limited to 'README.md')
-rw-r--r--README.md70
1 files changed, 58 insertions, 12 deletions
diff --git a/README.md b/README.md
index 920d1d5..0d454bc 100644
--- a/README.md
+++ b/README.md
@@ -76,17 +76,22 @@ This approach provides:
76git clone https://gitworkshop.dev/ngit-grasp 76git clone https://gitworkshop.dev/ngit-grasp
77cd ngit-grasp 77cd ngit-grasp
78 78
79# Build 79# Build (using Nix for reproducible environment)
80cargo build --release 80nix develop -c cargo build --release
81 81
82# Configure 82# Configure
83cp .env.example .env 83cp .env.example .env
84# Edit .env with your settings 84# Edit .env with your settings
85 85
86# Run 86# Run
87cargo run --release 87nix develop -c cargo run --release
88
89# Run tests
90nix develop -c cargo test --lib
88``` 91```
89 92
93**Don't have Nix?** See [Getting Started Tutorial](docs/tutorials/getting-started.md) for alternative setup methods.
94
90## Configuration 95## Configuration
91 96
92Environment variables (see `.env.example`): 97Environment variables (see `.env.example`):
@@ -114,24 +119,65 @@ We use the **[Diátaxis](https://diataxis.fr/)** framework for documentation:
114 119
115See [Architecture Overview](docs/explanation/architecture.md) for system design and [Test Strategy](docs/reference/test-strategy.md) for testing approach. 120See [Architecture Overview](docs/explanation/architecture.md) for system design and [Test Strategy](docs/reference/test-strategy.md) for testing approach.
116 121
122### Running Tests
123
124We have two test suites:
125
126**1. Main Project Tests (ngit-grasp)**
127
117```bash 128```bash
118# Run tests 129# Run unit tests (no external dependencies)
119cargo test 130nix develop -c cargo test --lib
131
132# Run integration tests (tests our relay implementation)
133# First, start ngit-grasp relay in one terminal:
134NGIT_BIND_ADDRESS=127.0.0.1:7000 nix develop -c cargo run
135
136# Then in another terminal, run integration tests:
137nix develop -c cargo test --test announcement_tests --ignored
138
139# Or use the test script (starts relay automatically):
140./test_relay.sh
141```
120 142
121# Run compliance tests 143**2. GRASP Audit Tool (grasp-audit)**
122cargo test --test compliance
123 144
145The audit tool tests GRASP compliance of any relay (including ours or external ones).
146
147```bash
148# Enter grasp-audit directory
149cd grasp-audit
150
151# Run unit tests
152nix develop -c cargo test
153
154# Test against our ngit-grasp relay:
155# First, start ngit-grasp (in another terminal):
156cd .. && NGIT_BIND_ADDRESS=127.0.0.1:7000 nix develop -c cargo run
157
158# Then run audit:
159nix develop -c cargo run -- --url ws://127.0.0.1:7000
160
161# Or test against any external relay:
162nix develop -c cargo run -- --url wss://relay.example.com
163```
164
165### Development Commands
166
167```bash
124# Run with logging 168# Run with logging
125RUST_LOG=debug cargo run 169RUST_LOG=debug nix develop -c cargo run
126 170
127# Check code 171# Check code
128cargo clippy 172nix develop -c cargo clippy
129cargo fmt --check 173nix develop -c cargo fmt --check
130 174
131# Generate test coverage 175# Generate test coverage (requires tarpaulin)
132cargo tarpaulin --out Html 176nix develop -c cargo tarpaulin --out Html
133``` 177```
134 178
179**Note:** Always use `nix develop` to ensure the correct build environment. See [docs/how-to/nix-flakes.md](docs/how-to/nix-flakes.md) for details.
180
135## Project Structure 181## Project Structure
136 182
137``` 183```