diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-28 02:30:10 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-28 02:54:34 +0000 |
| commit | 15892018705b3b4ca42586174518319adc224c0e (patch) | |
| tree | 7b589ec2fce2c7bc802ecf9ae7b1d91c20e4a5c7 /grasp-audit | |
| parent | 43e53b4ccd9fcebf20cc9c1bdbfe568ddd8051b9 (diff) | |
fix running audit with production flag
no events were allowed to be published which broke most tests
Diffstat (limited to 'grasp-audit')
| -rw-r--r-- | grasp-audit/src/bin/grasp-audit.rs | 5 | ||||
| -rw-r--r-- | grasp-audit/src/specs/grasp01/nip01_smoke.rs | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/grasp-audit/src/bin/grasp-audit.rs b/grasp-audit/src/bin/grasp-audit.rs index b810bea..760ed55 100644 --- a/grasp-audit/src/bin/grasp-audit.rs +++ b/grasp-audit/src/bin/grasp-audit.rs | |||
| @@ -48,11 +48,14 @@ async fn main() -> Result<()> { | |||
| 48 | 48 | ||
| 49 | match cli.command { | 49 | match cli.command { |
| 50 | Commands::Audit { relay, mode, spec, git_data_dir } => { | 50 | Commands::Audit { relay, mode, spec, git_data_dir } => { |
| 51 | let config = match mode.as_str() { | 51 | let mut config = match mode.as_str() { |
| 52 | "ci" => AuditConfig::ci(), | 52 | "ci" => AuditConfig::ci(), |
| 53 | "production" => AuditConfig::production(), | 53 | "production" => AuditConfig::production(), |
| 54 | _ => return Err(anyhow!("Invalid mode: {}. Use 'ci' or 'production'", mode)), | 54 | _ => return Err(anyhow!("Invalid mode: {}. Use 'ci' or 'production'", mode)), |
| 55 | }; | 55 | }; |
| 56 | |||
| 57 | // Audit needs to create events to test the relay, so disable read-only mode | ||
| 58 | config.read_only = false; | ||
| 56 | 59 | ||
| 57 | // Derive relay_domain from relay URL (e.g., "ws://localhost:8081" -> "localhost:8081") | 60 | // Derive relay_domain from relay URL (e.g., "ws://localhost:8081" -> "localhost:8081") |
| 58 | let relay_domain = relay | 61 | let relay_domain = relay |
diff --git a/grasp-audit/src/specs/grasp01/nip01_smoke.rs b/grasp-audit/src/specs/grasp01/nip01_smoke.rs index 182e362..b16d61a 100644 --- a/grasp-audit/src/specs/grasp01/nip01_smoke.rs +++ b/grasp-audit/src/specs/grasp01/nip01_smoke.rs | |||
| @@ -32,7 +32,7 @@ impl Nip01SmokeTests { | |||
| 32 | pub async fn test_websocket_connection(client: &AuditClient) -> TestResult { | 32 | pub async fn test_websocket_connection(client: &AuditClient) -> TestResult { |
| 33 | TestResult::new( | 33 | TestResult::new( |
| 34 | "websocket_connection", | 34 | "websocket_connection", |
| 35 | "NIP-01:basic", | 35 | "NIP-01", |
| 36 | "Can establish WebSocket connection to /", | 36 | "Can establish WebSocket connection to /", |
| 37 | ) | 37 | ) |
| 38 | .run(|| async { | 38 | .run(|| async { |
| @@ -61,7 +61,7 @@ impl Nip01SmokeTests { | |||
| 61 | pub async fn test_send_receive_event(client: &AuditClient) -> TestResult { | 61 | pub async fn test_send_receive_event(client: &AuditClient) -> TestResult { |
| 62 | TestResult::new( | 62 | TestResult::new( |
| 63 | "send_receive_event", | 63 | "send_receive_event", |
| 64 | "NIP-01:event-message", | 64 | "NIP-01", |
| 65 | "Can send EVENT and receive OK response", | 65 | "Can send EVENT and receive OK response", |
| 66 | ) | 66 | ) |
| 67 | .run(|| async { | 67 | .run(|| async { |
| @@ -127,7 +127,7 @@ impl Nip01SmokeTests { | |||
| 127 | pub async fn test_create_subscription(client: &AuditClient) -> TestResult { | 127 | pub async fn test_create_subscription(client: &AuditClient) -> TestResult { |
| 128 | TestResult::new( | 128 | TestResult::new( |
| 129 | "create_subscription", | 129 | "create_subscription", |
| 130 | "NIP-01:req-message", | 130 | "NIP-01", |
| 131 | "Can create subscription with REQ and receive EOSE", | 131 | "Can create subscription with REQ and receive EOSE", |
| 132 | ) | 132 | ) |
| 133 | .run(|| async { | 133 | .run(|| async { |
| @@ -165,7 +165,7 @@ impl Nip01SmokeTests { | |||
| 165 | pub async fn test_close_subscription(client: &AuditClient) -> TestResult { | 165 | pub async fn test_close_subscription(client: &AuditClient) -> TestResult { |
| 166 | TestResult::new( | 166 | TestResult::new( |
| 167 | "close_subscription", | 167 | "close_subscription", |
| 168 | "NIP-01:close-message", | 168 | "NIP-01", |
| 169 | "Can close subscriptions", | 169 | "Can close subscriptions", |
| 170 | ) | 170 | ) |
| 171 | .run(|| async { | 171 | .run(|| async { |
| @@ -193,7 +193,7 @@ impl Nip01SmokeTests { | |||
| 193 | pub async fn test_reject_invalid_signature(client: &AuditClient) -> TestResult { | 193 | pub async fn test_reject_invalid_signature(client: &AuditClient) -> TestResult { |
| 194 | TestResult::new( | 194 | TestResult::new( |
| 195 | "reject_invalid_signature", | 195 | "reject_invalid_signature", |
| 196 | "NIP-01:validation", | 196 | "NIP-01", |
| 197 | "Rejects events with invalid signatures", | 197 | "Rejects events with invalid signatures", |
| 198 | ) | 198 | ) |
| 199 | .run(|| async { | 199 | .run(|| async { |
| @@ -247,7 +247,7 @@ impl Nip01SmokeTests { | |||
| 247 | pub async fn test_reject_invalid_event_id(client: &AuditClient) -> TestResult { | 247 | pub async fn test_reject_invalid_event_id(client: &AuditClient) -> TestResult { |
| 248 | TestResult::new( | 248 | TestResult::new( |
| 249 | "reject_invalid_event_id", | 249 | "reject_invalid_event_id", |
| 250 | "NIP-01:validation", | 250 | "NIP-01", |
| 251 | "Rejects events with invalid event IDs", | 251 | "Rejects events with invalid event IDs", |
| 252 | ) | 252 | ) |
| 253 | .run(|| async { | 253 | .run(|| async { |