From ebecd60dc7f6c58879b2fe3f31bd172ab311ca54 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 20 Oct 2025 06:57:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test(message-list):=20add=20opti?= =?UTF-8?q?onal=20ignored=20integration=20test=20for=20Gmail=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/gmail_message_list_integration.rs | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/gmail_message_list_integration.rs diff --git a/tests/gmail_message_list_integration.rs b/tests/gmail_message_list_integration.rs new file mode 100644 index 0000000..52c5cdf --- /dev/null +++ b/tests/gmail_message_list_integration.rs @@ -0,0 +1,36 @@ +// Optional integration test for Gmail API interactions. +// +// This test is ignored by default to avoid network use in CI. +// To run locally, ensure you have valid OAuth client credentials and set up +// the configuration as required by `ClientConfig`. +// +// Example to run: +// cargo test --test gmail_message_list_integration -- --ignored + +use cull_gmail::{ClientConfig, GmailClient, MessageList, Result}; + +#[ignore] +#[tokio::test] +async fn list_first_page_of_messages_smoke_test() -> Result<()> { + // Configure with your own credentials before running locally. + let config = ClientConfig::builder() + // .with_config_base(&cull_gmail::client_config::config_root::RootBase::Home) + // .with_config_path(".cull-gmail") + // .with_credential_file("client_secret.json") + // Alternatively specify client_id/client_secret and related fields: + // .with_client_id("") + // .with_client_secret("") + .build(); + + let mut client = GmailClient::new_with_config(config).await?; + + // Configure a conservative query to avoid heavy traffic + client.set_query("in:inbox newer_than:30d"); + client.set_max_results(10); + + // Should complete without error; results may be empty depending on mailbox + client.get_messages(1).await?; + let _ids = client.message_ids(); + + Ok(()) +}