Skip to content

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

test(composio): add coverage for integration fetch and cache paths

Steven Enamakelc88c8cfe50c0
diff --git a/crates/openhuman-core/src/integrations/composio/ops_fetch_integrations_and_triggers_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_fetch_integrations_and_triggers_tests.rs
index 6f65e52ff0..e83642ae86 100644
--- a/crates/openhuman-core/src/integrations/composio/ops_fetch_integrations_and_triggers_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/ops_fetch_integrations_and_triggers_tests.rs
@@ -646,25 +646,3 @@ async fn composio_list_connections_returns_empty_when_direct_mode_no_key() {
);
}
-// ── sync reasons ─────────────────────────────────────────────────────────────
-
-/// Every parsed sync reason is a distinct event trigger — the stage events
-/// must not collapse periodic and connection-created syncs into "manual"
-/// (review finding on #5932).
-#[test]
-fn sync_reasons_map_to_distinct_triggers() {
- use crate::integrations::composio::providers::SyncReason;
- let all = [
- SyncReason::Manual,
- SyncReason::Periodic,
- SyncReason::ConnectionCreated,
- ];
- let mut seen = std::collections::HashSet::new();
- for reason in all {
- assert!(
- seen.insert(reason.as_str().to_string()),
- "duplicate trigger"
- );
- }
- assert_eq!(seen.len(), 3);
-}
diff --git a/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs b/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
index 108cfc3f95..ef5e335b77 100644
--- a/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/ops_no_session_and_cache_tests.rs
@@ -1,32 +1,5 @@
use super::*;
-#[test]
-fn parse_sync_reason_accepts_known_values() {
- assert_eq!(parse_sync_reason(None).unwrap(), SyncReason::Manual);
- assert_eq!(
- parse_sync_reason(Some("manual")).unwrap(),
- SyncReason::Manual
- );
- assert_eq!(
- parse_sync_reason(Some("periodic")).unwrap(),
- SyncReason::Periodic
- );
- assert_eq!(
- parse_sync_reason(Some("connection_created")).unwrap(),
- SyncReason::ConnectionCreated
- );
-}
-
-#[test]
-fn parse_sync_reason_rejects_unknown_values() {
- let err = parse_sync_reason(Some("scheduled")).unwrap_err();
- assert!(err.contains("unrecognized sync reason"));
- assert!(err.contains("scheduled"));
- // Typo of a real value should also fail rather than coerce.
- assert!(parse_sync_reason(Some("Periodic")).is_err());
- assert!(parse_sync_reason(Some("")).is_err());
-}
-
#[tokio::test]
async fn composio_list_toolkits_errors_without_session() {
let _serialised = module_guard().await;
@@ -124,7 +97,7 @@ async fn composio_delete_connection_errors_without_session() {
let _serialised = module_guard().await;
let tmp = tempfile::tempdir().unwrap();
let config = test_config(&tmp);
- let err = composio_delete_connection(&config, "c-1", false)
+ let err = composio_delete_connection(&config, "c-1")
.await
.unwrap_err();
assert!(
@@ -184,28 +157,6 @@ async fn composio_get_user_profile_errors_without_session() {
assert!(err.to_lowercase().contains("composio"), "{err}");
}
-#[tokio::test]
-async fn composio_sync_errors_without_session() {
- let _serialised = module_guard().await;
- let tmp = tempfile::tempdir().unwrap();
- let config = test_config(&tmp);
- let err = composio_sync(&config, "c-1", None).await.unwrap_err();
- assert!(err.to_lowercase().contains("composio"), "{err}");
-}
-
-#[tokio::test]
-async fn composio_sync_rejects_invalid_reason_before_client_check() {
- let _serialised = module_guard().await;
- let tmp = tempfile::tempdir().unwrap();
- let config = test_config(&tmp);
- // Invalid reason → should fail at parse step *before* touching the
- // client, so the error message references the reason, not auth.
- let err = composio_sync(&config, "c-1", Some("weird".into()))
- .await
- .unwrap_err();
- assert!(err.contains("unrecognized sync reason"));
-}
-
#[tokio::test]
async fn composio_list_trigger_history_errors_when_store_not_init() {
let _serialised = module_guard().await;
@@ -436,7 +387,7 @@ async fn composio_delete_connection_via_mock() {
let base = start_mock_backend(app).await;
let tmp = tempfile::tempdir().unwrap();
let config = config_with_backend(&tmp, base);
- let outcome = composio_delete_connection(&config, "c1", false)
+ let outcome = composio_delete_connection(&config, "c1")
.await
.unwrap();
assert!(outcome.value.deleted);