upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/common/relay.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-18 17:12:27 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-18 17:12:27 +0000
commit07c8c00274298e90654207d8baceb1089514ccae (patch)
tree931e1c5da2f7c605c50d6644012eed32d5c62b4e /tests/common/relay.rs
parentd76003b629a4a03dba23a8a1c41da6e4ac4c30cf (diff)
test: rewrite PR sync tests to reflect purgatory-first announcement flow
The tests now correctly reflect the actual purgatory behavior: 1. Announcement goes to purgatory (StateOnly) - not immediately accepted 2. State event goes to purgatory 3. Git push promotes announcement to Full and releases state event 4. PR event is sent AFTER announcement promotion (accepted since repo is Full) 5. PR commit push releases PR event from purgatory This matches the design: announcements require git data validation before being promoted to the database, which means PR events can only be accepted for repos with promoted announcements. Also routes relay stdout to /tmp/relay-{port}.log for easier debugging.
Diffstat (limited to 'tests/common/relay.rs')
-rw-r--r--tests/common/relay.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/common/relay.rs b/tests/common/relay.rs
index 227849a..0ec9a2e 100644
--- a/tests/common/relay.rs
+++ b/tests/common/relay.rs
@@ -213,8 +213,15 @@ impl TestRelay {
213 "RUST_LOG", 213 "RUST_LOG",
214 std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string()), 214 std::env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string()),
215 ) // Use RUST_LOG from environment or default to info 215 ) // Use RUST_LOG from environment or default to info
216 .stdout(Stdio::null()) // Suppress stdout for cleaner test output 216 .stdout(
217 .stderr(Stdio::null()); // Suppress stderr for cleaner test output 217 std::fs::OpenOptions::new()
218 .create(true)
219 .append(true)
220 .open(format!("/tmp/relay-{}.log", port))
221 .map(Stdio::from)
222 .unwrap_or(Stdio::null()),
223 )
224 .stderr(Stdio::inherit()); // Inherit stderr for test output
218 225
219 // Add bootstrap relay URL if provided 226 // Add bootstrap relay URL if provided
220 if let Some(ref bootstrap_url) = bootstrap_relay_url { 227 if let Some(ref bootstrap_url) = bootstrap_relay_url {