The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(raw_coverage): add e2e test for memory sync sources\n\nAdds an end-to-end test to verify that raw coverage data is correctly synchronized from memory sources, ensuring the system handles in-memory coverage inputs as expected during integration testing.\n\nAuto-committed-on: dragonfly\n
Steven Enamakelcc94c4dbfc0b
diff --git a/tests/raw_coverage/memory_sync_sources_raw_coverage_e2e.rs b/tests/raw_coverage/memory_sync_sources_raw_coverage_e2e.rsindex 9ef7e638e4..de4f7f9957 100644--- a/tests/raw_coverage/memory_sync_sources_raw_coverage_e2e.rs+++ b/tests/raw_coverage/memory_sync_sources_raw_coverage_e2e.rs@@ -420,30 +420,26 @@ async fn github_reader_uses_fake_gh_for_list_and_read_paths() {assert!(bad.contains("expected https://github.com/<owner>/<repo>"));}+/// Was `composio_providers_fetch_profiles_tasks_and_cover_error_branches`,+/// which built each deleted `ComposioProvider` (`GitHubProvider`,+/// `ClickUpProvider`, `GmailProvider`, `SlackProvider`) directly and called+/// `fetch_user_profile`/`fetch_tasks`/`on_trigger`/`run_backfill_via_search`+/// against a loopback router simulating the Composio execute API. None of+/// that construction or those methods exist any more — see the module doc+/// comment for where the behaviour moved (the `tinyconnectors` module) and+/// why it cannot be exercised from here without a live loaded module and real+/// network. What survives as the honest current entry point for "fetch a+/// connected account's profile" is `integrations::composio::ops::{+/// composio_get_user_profile, composio_sync}`, module-mediated now instead of+/// registry-mediated. With `modules.enabled = false` both refuse+/// deterministically and without touching the network, which is what this+/// test asserts in place of the deleted per-provider parsing coverage.#[tokio::test]-async fn composio_providers_fetch_profiles_tasks_and_cover_error_branches() {+async fn composio_ops_refuse_cleanly_without_a_loaded_connectors_module() {let _guard = env_lock();let tmp = TempDir::new().expect("tempdir");let mut config = config_in(&tmp);- let requests: Arc<Mutex<Vec<Value>>> = Arc::new(Mutex::new(Vec::new()));- let router = {- let requests = Arc::clone(&requests);- Router::new().route(- "/agent-integrations/composio/execute",- any(move |Json(body): Json<Value>| {- let requests = Arc::clone(&requests);- async move {- requests.lock().unwrap().push(body.clone());- Json(json!({- "success": true,- "data": execute_response_for(&body),- }))- }- }),- )- };- let (base, server) = loopback_router(router).await;- config.api_url = Some(base);+ config.modules.enabled = false;persist_config(&config).await;let _workspace = EnvGuard::set_path("OPENHUMAN_WORKSPACE", tmp.path());let _home = EnvGuard::set_path("HOME", tmp.path());@@ -457,107 +453,57 @@ async fn composio_providers_fetch_profiles_tasks_and_cover_error_branches() {).expect("store session token");- let ctx = ProviderContext {- config: Arc::new(config.clone()),- toolkit: "github".to_string(),- connection_id: Some("conn-github".to_string()),- usage: Default::default(),- max_items: None,- sync_depth_days: None,- };- let github = GitHubProvider::new();- let github_profile = github- .fetch_user_profile(&ctx)- .await- .expect("github profile");- assert_eq!(github_profile.username.as_deref(), Some("octo-round15"));- assert_eq!(- github_profile.display_name.as_deref(),- Some("Round Fifteen")- );-- let tasks = github- .fetch_tasks(- &ctx,- &TaskFetchFilter {- repo: Some("tinyhumansai/openhuman".to_string()),- labels: vec!["coverage".to_string()],- state: Some("open".to_string()),- max: 2,- ..TaskFetchFilter::default()- },- )- .await- .expect("github tasks");- assert_eq!(tasks.len(), 1);- assert_eq!(tasks[0].provider, "github");- assert_eq!(tasks[0].labels, vec!["coverage"]);-- let clickup_ctx = ProviderContext {- toolkit: "clickup".to_string(),- connection_id: Some("conn-clickup".to_string()),- ..ctx.clone()- };- let clickup = ClickUpProvider::new();- let clickup_profile = clickup- .fetch_user_profile(&clickup_ctx)- .await- .expect("clickup profile");- assert_eq!(clickup_profile.username.as_deref(), Some("9988"));- assert_eq!(clickup_profile.email.as_deref(), Some("[email protected]"));-- let clickup_tasks = clickup- .fetch_tasks(- &clickup_ctx,- &TaskFetchFilter {- team_id: Some("team_1".to_string()),- list_id: Some("list_1".to_string()),- max: 3,- ..TaskFetchFilter::default()- },+ let profile_error =+ openhuman_core::openhuman::integrations::composio::ops::composio_get_user_profile(+ &config,+ "conn-github",).await- .expect("clickup tasks");- assert_eq!(clickup_tasks.len(), 1);- assert_eq!(clickup_tasks[0].provider, "clickup");- assert_eq!(clickup_tasks[0].priority.as_deref(), Some("high"));-- let gmail = GmailProvider::new();- let gmail_err = gmail- .fetch_tasks(&ctx, &TaskFetchFilter::default())- .await- .expect_err("gmail has no task surface");- assert!(gmail_err.contains("no task-fetch surface"));-- let slack = SlackProvider::new();- assert_eq!(slack.toolkit_slug(), "slack");- assert_eq!(slack.sync_interval_secs(), Some(15 * 60));- assert!(slack.curated_tools().is_some());- slack- .on_trigger(&ctx, "message.created", &json!({"event": "ignored"}))- .await- .expect("slack trigger path is defensive");-- let bad_backfill = run_backfill_via_search(&ctx, 0)- .await- .expect_err("zero days rejected");- assert!(!bad_backfill.trim().is_empty());+ .expect_err("profile fetch must refuse without a loaded connectors module");+ assert!(+ profile_error.contains("modules are disabled in configuration"),+ "unexpected error: {profile_error}"+ );- assert!(!requests.lock().unwrap().is_empty());- server.abort();+ let sync_error = openhuman_core::openhuman::integrations::composio::ops::composio_sync(+ &config,+ "conn-github",+ None,+ )+ .await+ .expect_err("sync must refuse without a loaded connectors module");+ assert!(+ sync_error.contains("modules are disabled in configuration"),+ "unexpected error: {sync_error}"+ );}+/// Was `composio_provider_registry_and_bus_subscribers_expose_stable_metadata`,+/// which asked the deleted engine's provider registry+/// (`init_default_composio_sync_providers`/`get_composio_sync_provider`/+/// `all_composio_sync_providers`) which toolkits it knew. The registry is+/// gone; the six-toolkit fact it reported is now `NATIVE_PROVIDERS` (a pure+/// contract table re-exported unchanged from+/// `integrations::composio::providers`, see module doc comment), which this+/// test checks instead. The bus-subscriber and `SyncReason` coverage is+/// otherwise unchanged.#[test]-fn composio_provider_registry_and_bus_subscribers_expose_stable_metadata() {- init_default_composio_sync_providers();- assert!(get_composio_sync_provider("slack").is_some());- assert!(get_composio_sync_provider("github").is_some());- assert!(get_composio_sync_provider("clickup").is_some());- assert!(get_composio_sync_provider("missing").is_none());- assert!(- all_composio_sync_providers().len() >= 6,- "default providers should include gmail/notion/slack/clickup/github/linear"+fn composio_provider_catalog_and_bus_subscribers_expose_stable_metadata() {+ assert!(has_native_provider("slack"));+ assert!(has_native_provider("github"));+ assert!(has_native_provider("clickup"));+ assert!(!has_native_provider("missing"));+ assert_eq!(+ NATIVE_PROVIDERS.len(),+ 6,+ "native providers should be exactly gmail/notion/slack/clickup/github/linear");+ for toolkit in ["gmail", "notion", "slack", "clickup", "github", "linear"] {+ assert!(+ has_native_provider(toolkit),+ "{toolkit} should have a native provider"+ );+ }let trigger = ComposioTriggerSubscriber::new();let connection = ComposioConnectionCreatedSubscriber::new();