Add Pax to Development tests

This commit is contained in:
Jazz Turner-Baggs 2026-06-02 19:11:47 -07:00
parent 3372e58253
commit 071655e169
No known key found for this signature in database

View File

@ -275,13 +275,14 @@ fn core_client() {
let swp = WakeupProvider::new(); let swp = WakeupProvider::new();
let rwp = WakeupProvider::new(); let rwp = WakeupProvider::new();
let pwp = WakeupProvider::new();
let ds = LocalBroadcaster::new(); let ds = LocalBroadcaster::new();
let rs = EphemeralRegistry::new(); let rs = EphemeralRegistry::new();
let saro_account = TestLogosAccount::new("saro"); let saro_account = TestLogosAccount::new("saro");
let raya_account = TestLogosAccount::new("raya"); let raya_account = TestLogosAccount::new("raya");
let pax_account = TestLogosAccount::new("pax");
let saro = CoreClient::new( let saro = CoreClient::new(
saro_account, saro_account,
@ -294,25 +295,38 @@ fn core_client() {
swp.fill_slot(&saro); swp.fill_slot(&saro);
let raya = CoreClient::new( let raya = CoreClient::new(
raya_account, raya_account,
ds, ds.clone(),
rs, rs.clone(),
rwp.create_wakeup_service(), rwp.create_wakeup_service(),
MemStore::new(), MemStore::new(),
) )
.unwrap(); .unwrap();
rwp.fill_slot(&raya); rwp.fill_slot(&raya);
let pax = CoreClient::new(
pax_account,
ds.clone(),
rs.clone(),
pwp.create_wakeup_service(),
MemStore::new(),
)
.unwrap();
pwp.fill_slot(&pax);
let mut clients = vec![ let mut clients = vec![
PollableClient::init(saro, Some(pretty_print(" Saro "))), PollableClient::init(saro, Some(pretty_print(" Saro "))),
PollableClient::init(raya, Some(pretty_print(" Raya "))), PollableClient::init(raya, Some(pretty_print(" Raya "))),
PollableClient::init(pax, Some(pretty_print(" Pax "))),
]; ];
let mut wakeups = vec![swp, rwp]; let mut wakeups = vec![swp, rwp];
const SARO: usize = 0; const SARO: usize = 0;
const RAYA: usize = 1; const RAYA: usize = 1;
const PAX: usize = 2;
let s_convo = clients[SARO] let s_convo = clients[SARO]
.create_group_convo(&[&clients[RAYA].account_id()]) .create_group_convo(&[&clients[RAYA].account_id(), &clients[PAX].account_id()])
.unwrap(); .unwrap();
// Bounded driver: de-mls reschedules its steward poll every tick, so a // Bounded driver: de-mls reschedules its steward poll every tick, so a
@ -323,8 +337,8 @@ fn core_client() {
// welcome to Raya's InboxV2 1-1 channel, and lets her `accept_welcome`. // welcome to Raya's InboxV2 1-1 channel, and lets her `accept_welcome`.
// Run extra cycles afterward so Raya polls her inbox and joins after the // Run extra cycles afterward so Raya polls her inbox and joins after the
// welcome is published. // welcome is published.
process(&mut clients, &mut wakeups, 80); process(&mut clients, &mut wakeups, 180);
process(&mut clients, &mut wakeups, 180);
// Raya joined via the invite path. // Raya joined via the invite path.
let raya_convos = clients[RAYA].list_conversations().unwrap(); let raya_convos = clients[RAYA].list_conversations().unwrap();
assert!( assert!(
@ -336,13 +350,12 @@ fn core_client() {
// in the log). // in the log).
info!(target: "chat", "Saro -> sending: HI"); info!(target: "chat", "Saro -> sending: HI");
s_convo.send_content(b"HI").unwrap(); s_convo.send_content(b"HI").unwrap();
process(&mut clients, &mut wakeups, 20); process(&mut clients, &mut wakeups, 120);
// Raya replies; Saro receives it (look for "Saro received: hi back"). // Raya replies; Saro receives it (look for "Saro received: hi back").
let raya_convo = clients[RAYA] let raya_convo = clients[RAYA]
.convo(&raya_convos[0]) .convo(&raya_convos[0])
.expect("Raya must have a usable conversation handle"); .expect("Raya must have a usable conversation handle");
info!(target: "chat", "Raya -> sending: hi back"); info!(target: "chat", "Raya -> sending: hi back");
raya_convo.send_content(b"hi back").unwrap(); raya_convo.send_content(b"hi back").unwrap();
process(&mut clients, &mut wakeups, 20); process(&mut clients, &mut wakeups, 120);
} }