Skip to content

Conversation

@anikdhabal
Copy link
Contributor

@anikdhabal anikdhabal commented Dec 31, 2025

What does this PR do?

Reduces E2E API v2 test execution time and simplifies CI workflows by replacing custom GitHub Actions caching with Turbo remote caching. Also optimizes Jest/ts-jest configuration for CI and fixes a flaky test caused by a type-only import issue.

Changes:

  1. Turbo remote caching for E2E tests (.github/workflows/e2e-api-v2.yml):

    • Added TURBO_TOKEN and TURBO_TEAM env vars to enable Turbo remote caching
    • Added explicit yarn turbo run build --filter=... step to build platform packages through Turbo
    • Each E2E shard now benefits from Turbo's remote cache instead of rebuilding from scratch
  2. Turbo remote caching for production build (.github/workflows/api-v2-production-build.yml):

    • Replaced custom actions/cache with Turbo remote caching
    • Simplified workflow by removing conditional cache hit/miss logic
    • Now uses yarn turbo run build --filter=@calcom/api-v2 which handles caching internally
  3. Jest CI optimizations (apps/api/v2/jest-e2e.ts):

    • Added isolatedModules: true for CI to skip full TypeScript program creation
    • Added diagnostics: false for CI to skip TypeScript diagnostics
    • These settings significantly speed up test startup time
  4. New CI-specific test script (apps/api/v2/package.json):

    • Added test:e2e:ci script that skips yarn dev:build (since Turbo handles builds)
  5. Flaky test fix (organizations-teams.controller.ts):

    • Changed type SkipTakePagination to value import SkipTakePagination
    • Type-only imports strip class metadata at runtime, preventing Nest.js @Transform decorators from converting query params to numbers, causing Prisma errors

How should this be tested?

  • CI should show Turbo remote caching output: "Remote caching enabled", "Tasks: X successful", "Cached: X cached"
  • E2E API v2 tests should pass without the flaky "organizations-teams" pagination test failure
  • Verify TURBO_TOKEN and TURBO_TEAM secrets are configured in the repository

Human Review Checklist

  • Verify TURBO_TOKEN and TURBO_TEAM secrets are configured in GitHub repository settings
  • Confirm the SkipTakePagination import fix is correct (line 46 in organizations-teams.controller.ts)
  • Verify removing preset: "ts-jest" from jest-e2e.ts doesn't cause issues (the transform config handles this)
  • Verify the api-v2-production-build.yml simplification doesn't break production builds

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - CI/workflow changes only.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Link to Devin run: https://app.devin.ai/sessions/9459a7bc0e354d46b25e95d7f7b88df0
Requested by: [email protected] (@anikdhabal)

Increase the number of parallel E2E test shards from 4 to 6 to reduce
overall CI wall-clock time. Each shard runs on a separate 4-vCPU runner
with 4 workers, so adding more shards increases total parallelism.

This should reduce E2E test time from ~3 minutes per shard to ~2 minutes
per shard by distributing tests across more parallel jobs.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link

vercel bot commented Dec 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Review Updated (UTC)
cal Ignored Ignored Dec 31, 2025 1:15pm
cal-companion Ignored Ignored Preview Dec 31, 2025 1:15pm
cal-eu Ignored Ignored Dec 31, 2025 1:15pm

@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2025

E2E results are ready!

@anikdhabal anikdhabal changed the title perf: increase E2E test shards from 4 to 6 for faster CI ci: increase E2E test shards from 4 to 6 for faster CI Dec 31, 2025
@anikdhabal anikdhabal marked this pull request as ready for review December 31, 2025 05:47
@anikdhabal anikdhabal requested a review from a team as a code owner December 31, 2025 05:47
@anikdhabal anikdhabal changed the title ci: increase E2E test shards from 4 to 6 for faster CI ci: reduce e2e-api-v2 test overhead with caching and Jest optimizations Dec 31, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@devin-ai-integration
Copy link
Contributor

I've reviewed the changes and updated the PR description to reflect all the optimizations:

Summary of changes:

  1. Platform packages build caching - New build-platform-packages job that builds once and caches, so each E2E shard restores the cached build instead of rebuilding
  2. Jest CI optimizations - Added isolatedModules: true and diagnostics: false for faster TypeScript compilation in CI
  3. New test:e2e:ci script - Skips yarn dev:build since builds are now cached

The PR description has been updated with full details.

@anikdhabal
Copy link
Contributor Author

@anikdhabal anikdhabal force-pushed the devin/1767154316-e2e-increase-shards branch from e33ea82 to 24b46e1 Compare December 31, 2025 11:45
@pull-request-size pull-request-size bot added size/S and removed size/M labels Dec 31, 2025
@devin-ai-integration devin-ai-integration bot changed the title ci: reduce e2e-api-v2 test overhead with caching and Jest optimizations ci: reduce e2e-api-v2 test overhead with Turbo caching and Jest optimizations Dec 31, 2025
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1767154316-e2e-increase-shards branch from 75a2f7d to 24b46e1 Compare December 31, 2025 12:24
@pull-request-size pull-request-size bot added size/M and removed size/S labels Dec 31, 2025
@anikdhabal anikdhabal merged commit 17224d9 into main Dec 31, 2025
75 of 76 checks passed
@anikdhabal anikdhabal deleted the devin/1767154316-e2e-increase-shards branch December 31, 2025 13:19
@anikdhabal anikdhabal changed the title ci: reduce e2e-api-v2 test overhead with Turbo caching and Jest optimizations ci: optimize E2E API v2 with Turbo remote caching and Jest improvements Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants