Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(saas_mode): install credential on the core running the turn

Steven Enamakel58364cd26b2a
diff --git a/tests/saas_mode/cluster.rs b/tests/saas_mode/cluster.rs
index c498355fe0..9963cfe35a 100644
--- a/tests/saas_mode/cluster.rs
+++ b/tests/saas_mode/cluster.rs
@@ -254,7 +254,14 @@ fn one_core_at_a_time(storage_url: Option<&str>) {
let (status, owner, _) = call(&one, "alice", "core.ping", json!({}));
assert_eq!((status, owner.as_deref()), (409, Some("core-2")));
- // Core 2 dies mid-turn, holding the lease.
+ // Core 2 dies mid-turn, holding the lease. (The credential is installed
+ // through the core that runs the turn: each node keeps its own keyring.)
+ let body = operator(
+ &two,
+ "openhuman.profiles_set_credential",
+ json!({ "profile_id": "alice", "kind": "session", "token": "alice-jwt" }),
+ );
+ assert!(body.get("result").is_some(), "{body}");
start_turn(&two, "alice", "t-kill");
wait_until("alice's turn in flight on core 2", &two, Duration::from_secs(60), || {
active(&two, "alice", "t-kill")
diff --git a/tests/saas_mode_e2e.rs b/tests/saas_mode_e2e.rs
index 2bb6617573..600e19c998 100644
--- a/tests/saas_mode_e2e.rs
+++ b/tests/saas_mode_e2e.rs
@@ -10,6 +10,9 @@ use std::time::{Duration, Instant};
use serde_json::{json, Value};
+#[path = "saas_mode/cluster.rs"]
+mod cluster;
+
const BEARER: &str = "saas-e2e-gateway-bearer-0123456789abcdef";
/// Environment a developer machine may carry that would point the child at a
@@ -23,6 +26,8 @@ const SCRUBBED_ENV: &[&str] = &[
"OPENHUMAN_APPROVAL_GATE",
"OPENHUMAN_SANDBOX",
"OPENHUMAN_MODE",
+ "OPENHUMAN_STORAGE_URL",
+ "OPENHUMAN_NODE_ID",
];
struct Deployment {