diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 33 |
1 files changed, 20 insertions, 13 deletions
| @@ -129,17 +129,28 @@ We have two test suites: | |||
| 129 | # Run unit tests (no external dependencies) | 129 | # Run unit tests (no external dependencies) |
| 130 | nix develop -c cargo test --lib | 130 | nix develop -c cargo test --lib |
| 131 | 131 | ||
| 132 | # Run integration tests (tests our relay implementation) | 132 | # Run all integration tests (automatic relay management) |
| 133 | # First, start ngit-grasp relay in one terminal: | 133 | nix develop -c cargo test --test nip01_compliance --test nip34_announcements |
| 134 | NGIT_BIND_ADDRESS=127.0.0.1:7000 nix develop -c cargo run | ||
| 135 | 134 | ||
| 136 | # Then in another terminal, run integration tests: | 135 | # Run NIP-01 compliance tests |
| 137 | nix develop -c cargo test --test announcement_tests --ignored | 136 | nix develop -c cargo test --test nip01_compliance |
| 138 | 137 | ||
| 139 | # Or use the test script (starts relay automatically): | 138 | # Run NIP-34 announcement tests |
| 140 | ./test_relay.sh | 139 | nix develop -c cargo test --test nip34_announcements |
| 140 | |||
| 141 | # With detailed output | ||
| 142 | nix develop -c cargo test --test nip01_compliance -- --nocapture | ||
| 143 | |||
| 144 | # Run specific test | ||
| 145 | nix develop -c cargo test --test nip01_compliance test_nip01_smoke | ||
| 141 | ``` | 146 | ``` |
| 142 | 147 | ||
| 148 | **Integration tests automatically:** | ||
| 149 | - Start a fresh relay instance | ||
| 150 | - Run compliance tests using grasp-audit library | ||
| 151 | - Clean up when done | ||
| 152 | - No manual relay management needed! | ||
| 153 | |||
| 143 | **2. GRASP Audit Tool (grasp-audit)** | 154 | **2. GRASP Audit Tool (grasp-audit)** |
| 144 | 155 | ||
| 145 | The audit tool tests GRASP compliance of any relay (including ours or external ones). | 156 | The audit tool tests GRASP compliance of any relay (including ours or external ones). |
| @@ -151,12 +162,8 @@ cd grasp-audit | |||
| 151 | # Run unit tests | 162 | # Run unit tests |
| 152 | nix develop -c cargo test | 163 | nix develop -c cargo test |
| 153 | 164 | ||
| 154 | # Test against our ngit-grasp relay: | 165 | # Test against any relay (including external ones) |
| 155 | # First, start ngit-grasp (in another terminal): | 166 | nix develop -c cargo run -- --url wss://relay.example.com |
| 156 | cd .. && NGIT_BIND_ADDRESS=127.0.0.1:7000 nix develop -c cargo run | ||
| 157 | |||
| 158 | # Then run audit: | ||
| 159 | nix develop -c cargo run -- --url ws://127.0.0.1:7000 | ||
| 160 | 167 | ||
| 161 | # Or test against any external relay: | 168 | # Or test against any external relay: |
| 162 | nix develop -c cargo run -- --url wss://relay.example.com | 169 | nix develop -c cargo run -- --url wss://relay.example.com |