From 652c5913f695ba7e8dfd78cd0cbe5cc3de67fa59 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 4 Nov 2025 21:58:23 +0000 Subject: 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 --- test_relay.sh | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100755 test_relay.sh (limited to 'test_relay.sh') 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 @@ -#!/usr/bin/env bash -set -e - -echo "๐Ÿงช Testing ngit-grasp NIP-01 relay" -echo "" - -# Start the relay in the background -echo "๐Ÿ“ก Starting relay on port 9000..." -cd grasp-audit -nix develop -c bash -c "cd .. && NGIT_BIND_ADDRESS=127.0.0.1:9000 RUST_LOG=info cargo run" > /tmp/relay.log 2>&1 & -RELAY_PID=$! -cd .. - -echo "Relay PID: $RELAY_PID" -echo "Waiting for relay to start..." -sleep 3 - -# Check if relay is running -if ! ps -p $RELAY_PID > /dev/null; then - echo "โŒ Relay failed to start" - cat /tmp/relay.log - exit 1 -fi - -echo "โœ… Relay started" -echo "" - -# Run the audit -echo "๐Ÿ” Running NIP-01 smoke tests..." -cd grasp-audit -nix develop -c cargo run -- audit --relay ws://127.0.0.1:9000 --spec nip01-smoke - -# Capture exit code -AUDIT_EXIT=$? - -# Stop the relay -echo "" -echo "๐Ÿ›‘ Stopping relay..." -kill $RELAY_PID 2>/dev/null || true -wait $RELAY_PID 2>/dev/null || true - -# Show relay log if there were errors -if [ $AUDIT_EXIT -ne 0 ]; then - echo "" - echo "๐Ÿ“‹ Relay log:" - cat /tmp/relay.log -fi - -exit $AUDIT_EXIT -- cgit v1.2.3