Conversation
WalkthroughUpdated packages/app-store/googlecalendar/lib/tests/CalendarService.test.ts to replace a fixed performance threshold (speedupRatio > 5) with a CI-aware minimum. Introduced minSpeedup = process.env.CI ? 1.5 : 5 and updated the assertion to speedupRatio > minSpeedup. Added an inline comment explaining the lower threshold for CI. No other changes. ✨ 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 |
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
|
@anikdhabal is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
| const minSpeedup = process.env.CI ? 1.5 : 5; // Lower threshold for CI | ||
| expect(speedupRatio).toBeGreaterThan(minSpeedup); |
There was a problem hiding this comment.
NOTE:- Running all tests together in CI makes performance benchmarks unreliable. The 5x threshold becomes impossible to meet when CPU/memory is shared across many concurrent tests. Set a decent threshold in CI and keep it 5 when running this test independently.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/app-store/googlecalendar/lib/__tests__/CalendarService.test.ts (2)
1313-1314: Harden perf assertion to avoid edge-case flakes (>= and env override).Good direction. To eliminate equality-edge flakes and allow quick tuning in CI, consider ≥ and an overridable env threshold.
- const minSpeedup = process.env.CI ? 1.5 : 5; // Lower threshold for CI - expect(speedupRatio).toBeGreaterThan(minSpeedup); + const envMin = Number(process.env.CI_MIN_SPEEDUP); + const minSpeedup = Number.isFinite(envMin) ? envMin : (process.env.CI ? 1.5 : 5); // CI overrideable + expect(speedupRatio).toBeGreaterThanOrEqual(minSpeedup);
764-764: Quiet noisy console logs in tests.These logs add noise in CI and can mask failures.
- console.log({ calendarCachesAfter }); + // log.debug({ calendarCachesAfter });- console.log({ error }); + // log.debug({ error });Also applies to: 783-783
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/app-store/googlecalendar/lib/__tests__/CalendarService.test.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/app-store/googlecalendar/lib/__tests__/CalendarService.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/app-store/googlecalendar/lib/__tests__/CalendarService.test.ts
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/app-store/googlecalendar/lib/__tests__/CalendarService.test.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: din-prajapati
PR: calcom/cal.com#21854
File: packages/app-store/office365calendar/__tests__/unit_tests/SubscriptionManager.test.ts:0-0
Timestamp: 2025-08-05T12:04:29.037Z
Learning: In packages/app-store/office365calendar/lib/CalendarService.ts, the fetcher method in Office365CalendarService class is public, not private. It was specifically changed from private to public in this PR to support proper testing and external access patterns.
📚 Learning: 2025-08-05T12:04:29.037Z
Learnt from: din-prajapati
PR: calcom/cal.com#21854
File: packages/app-store/office365calendar/__tests__/unit_tests/SubscriptionManager.test.ts:0-0
Timestamp: 2025-08-05T12:04:29.037Z
Learning: In packages/app-store/office365calendar/lib/CalendarService.ts, the fetcher method in Office365CalendarService class is public, not private. It was specifically changed from private to public in this PR to support proper testing and external access patterns.
Applied to files:
packages/app-store/googlecalendar/lib/__tests__/CalendarService.test.ts
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Tests / Unit
- GitHub Check: Linters / lint
- GitHub Check: Type check / check-types
keithwillcode
left a comment
There was a problem hiding this comment.
We should plan to move this and other benchmark/perf tests we have to a different, dedicated perf suite that is more predictable.
E2E results are ready! |
What does this PR do?
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
Image Demo (if applicable):
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Checklist