-
Notifications
You must be signed in to change notification settings - Fork 10.9k
feat: Add comprehensive test coverage for calendar cache and sync functionality #23879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add tests for CalendarCacheRepository covering regular and delegation credentials - Add tests for CalendarCacheEventService and CalendarCacheEventRepository - Add tests for API v2 CalendarsCacheService Redis operations - Add integration tests for cron jobs and cleanup functionality - Add provider-specific calendar cache tests for Google Calendar and Office365 - Re-enable and enhance existing CalendarService cache tests - Add comprehensive mocking infrastructure for calendar cache testing - Add tests for utility functions like getShouldServeCache - Ensure all tests follow Cal.com patterns using vitest and prismock - Use TZ=UTC environment variable for consistent timezone handling This provides complete test coverage for the calendar cache implementation from PR #23876, ensuring reliability and maintainability of the caching system across all supported calendar providers and use cases. Co-Authored-By: Volnei Munhoz <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Add missing AppFlags properties for calendar-subscription-cache and calendar-subscription-sync - Fix SelectedCalendarRepository interface to match actual implementation return types - Handle nullable credential relationships in repository interface - Fix null/undefined handling in CalendarCacheEventService and CalendarCacheEventRepository - Update Office365CalendarSubscription adapter to use proper URL parsing instead of request.query - Fix isAllDay type compatibility in GoogleCalendarSubscription adapter - Improve error handling in cron route to handle unknown error types - Update CalendarService test to use proper type casting for private method access - Replace non-null assertions with nullish coalescing to satisfy ESLint rules - Use proper type definitions instead of 'any' type All TypeScript type checks now pass and test suite runs successfully. Co-Authored-By: Volnei Munhoz <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
What does this PR do?
This PR adds comprehensive test coverage for the calendar cache and sync functionality implemented in PR #23876. It provides extensive test suites for all major components of the calendar caching system including:
The test suite follows Cal.com's established patterns using Vitest and Prismock, ensuring consistent timezone handling with
TZ=UTC.Link to Devin run: https://app.devin.ai/sessions/d4c8af423e9a47efa4d61a60b2577653
Requested by: @volnei
Visual Demo (For contributors especially)
N/A - This PR focuses on test coverage and does not introduce user-facing changes.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Environment Setup
Running Tests
Test Coverage Areas
Expected Results
Checklist
Key Areas for Review
Files Added/Modified
New Test Files (13 files)
packages/features/calendar-cache/calendar-cache.repository.test.tspackages/features/calendar-cache/calendar-cache.test.tspackages/features/calendar-cache/api/cron.test.tspackages/features/calendar-cache/lib/getShouldServeCache.test.tspackages/features/calendar-subscription/lib/cache/CalendarCacheEventService.test.tspackages/features/calendar-subscription/lib/cache/CalendarCacheEventRepository.test.tsapps/api/v2/src/ee/calendars/services/calendars-cache.service.test.tsapps/web/app/api/cron/calendar-cache-cleanup/route.test.tspackages/app-store/googlecalendar/lib/__tests__/webhook-cache-integration.test.tspackages/app-store/office365calendar/lib/__tests__/webhook-cache-integration.test.tsMock Infrastructure (3 files)
packages/features/calendar-cache/__mocks__/CalendarCacheEventRepository.mock.tspackages/features/calendar-cache/__mocks__/CalendarProvider.mock.tspackages/features/calendar-cache/__mocks__/RedisService.mock.tsEnhanced Existing Tests (1 file)
packages/app-store/googlecalendar/lib/__tests__/CalendarService.test.ts- Re-enabled cache tests, added delegation credential scenariosThis comprehensive test suite ensures the calendar cache system is reliable, maintainable, and follows Cal.com's quality standards.