Skip to content

Conversation

@AhmadYasser1
Copy link

Summary

Fixes the skipped Gmail loader test that was failing due to googleapiclient import issues.

Changes

  • Removed @pytest.mark.skip decorator from test_load_data
  • Properly mocked GmailReader class and its methods
  • Fixed BeautifulSoup mock to return proper string values instead of MagicMock objects
  • Added additional assertions to verify data structure
  • All Gmail tests now pass successfully

Problem

The Gmail loader test was being skipped with a TODO comment: "Fix this test. Failing due to some googleapiclient import issue." This prevented proper testing of the Gmail loader functionality.

Solution

Instead of skipping the test, properly mock the dependencies:

  • Mock the GmailReader class to avoid actual Google API calls
  • Mock the BeautifulSoup parser to return proper string content
  • Mock the email data structure that would be returned by the Gmail API

Testing

pytest embedchain/tests/loaders/test_gmail.py -v

All tests pass successfully:

  • test_load_data_file_not_found
  • test_load_data

Impact

  • Improves test coverage for the Gmail loader
  • Ensures Gmail loader functionality works correctly
  • Removes technical debt (skipped test)
- Remove @pytest.mark.skip decorator from test_load_data
- Properly mock GmailReader class and its methods
- Fix BeautifulSoup mock to return proper string values
- Add additional assertions to verify data structure
- All Gmail tests now pass successfully

This resolves the skipped test that was failing due to googleapiclient import issues.
@CLAassistant
Copy link

CLAassistant commented Oct 19, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ AhmadYasser1
❌ Ahmed Hassanein


Ahmed Hassanein seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@AhmadYasser1
Copy link
Author

Vercel Deployment Status

The Vercel build is now working successfully! The build logs show:

  • Next.js app built successfully
  • Static pages generated (/ and /_not-found)
  • API route created (/api/chat)
  • Serverless functions created
  • Build completed in 3 minutes

The Vercel check is failing due to "Authorization required to deploy" - this is expected for external contributors and requires maintainer approval.

Since this PR only fixes test cases and doesn't affect the deployment functionality, could the maintainers either:

  1. Approve the workflow, or
  2. Skip the Vercel check for this test-only change?

The changes are working correctly as verified by the successful build logs.

@AhmadYasser1 AhmadYasser1 force-pushed the fix/embedchain-gmail-dependencies branch from 2430f5c to 52013b2 Compare October 22, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants