Skip to content

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

test(cron): assert projected delivery status and reload job in helper

Steven Enamakeld713863a19a8
diff --git a/crates/openhuman-core/src/cron/ops_delivery_tests.rs b/crates/openhuman-core/src/cron/ops_delivery_tests.rs
index 249f777f12..41d4a88a36 100644
--- a/crates/openhuman-core/src/cron/ops_delivery_tests.rs
+++ b/crates/openhuman-core/src/cron/ops_delivery_tests.rs
@@ -146,7 +146,11 @@ async fn run_job_now_pairs_trigger_and_completion_after_delivery() {
.expect("Run Now completion event arrives");
assert_eq!(pair, vec!["triggered", "completed"]);
let runs = cron::list_runs(&config, &job.id, 10).unwrap();
- assert_eq!(runs[0].delivery_status, None);
+ assert_eq!(
+ runs[0].delivery_status,
+ Some(DeliveryStatus::NotRequested),
+ "requested delivery is projected even when the configured mode sends nothing"
+ );
}
#[tokio::test]
diff --git a/crates/openhuman-core/src/cron/ops_tests.rs b/crates/openhuman-core/src/cron/ops_tests.rs
index 017a7a4b56..e66faff03d 100644
--- a/crates/openhuman-core/src/cron/ops_tests.rs
+++ b/crates/openhuman-core/src/cron/ops_tests.rs
@@ -361,7 +361,7 @@ pub(super) fn single_flight_system_job(config: &Config, name: &str) -> CronJob {
},
)
.unwrap();
- job
+ crate::cron::get_job(config, &job.id).unwrap()
}
#[tokio::test]