cal.com
cal.com copied to clipboard
Tests: Smoke Tests for packaged embeds and build improvements
What does this PR do?
Adds tests for the packaged code and improved packaged publlishing flow to avoid 2 critical issues reported recently by customers.
- TypeScript types issue couldn't be caught in e2e because we don't import @calcom/embed-react there
- Packaged code with http://localhost:3000 couldn't be caught because when I tested locally or in CI that URL is available but in production obviously that won't be available. For now that's avoided by ensuring that during npm publish the packages are rebuilt(with existing dist being cleaned-up) for sure with correct env variables.
Fixes #9168 Fixes CAL-1805 Fixes #9091 Fixes CAL-1757
Type of change
- Tests
How should this be tested?
- [x] Run packaged code tests with
yarn test -- --packaged-embed-tests-only. It would need you to buildembed-reactfirst usingcd packages/embeds/embed-react && yarn build - [x] Run
yarn publish-embedcommand after deletingdistfrom all embed packages(embed-core, embed-react,embed-snippet). It would generatedistfolder automatically with correct URL https://app.calc.om
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| api | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 1, 2023 8:38pm |
| cal | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 1, 2023 8:38pm |
| ui | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jun 1, 2023 8:38pm |
📦 Next.js Bundle Analysis for @calcom/web
This analysis was generated by the Next.js Bundle Analysis action. 🤖
This PR introduced no changes to the JavaScript bundle! 🙌
CAL-1805 Embed: The current build process has no checks to prevent sending wrong embed URL in built code.
It happened recently that embed-snippet was built without these explicity env variables.NEXT_PUBLIC_EMBED_LIB_URL='https://app.cal.com/embed/embed.js' NEXT_PUBLIC_WEBAPP_URL='https://app.cal.com'
When I published embed-react it used that build which had localhost:3000 references in it.
Ensure that when publish-embed command is used, all embed packages are rebuild with correct env variables.
Originally reported here: https://calendso.slack.com/archives/C01NXDSRY9W/p1685341062862069?thread_ts=1685310906.817079&cid=C01NXDSRY9W
CAL-1757 [CI Automation]Make an independent react application that uses @calcom/embed-react and verify that it builds fine.
This is needed because a built package when published to npm might have certain files missing and types are imported from *.d.ts files instead of .ts files directly in that case.
Current Playwright Test Results Summary
✅ 96 Passing - ⚠️ 1 Flaky
Run may still be in progress, this comment will be updated as current testing workflow or job completes...
(Last updated on 06/01/2023 08:41:45pm UTC)
Run Details
Running Workflow PR Update on Github Actions
Commit: ab584df4ca9499132d14758fbb77a26df0c7e4c8
Started: 06/01/2023 08:39:27pm UTC
⚠️ Flakes
📄 packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Flake
Test Case Results
| Test Case | Last 7 days Failures | Last 7 days Flakes |
|---|---|---|
|
Popup Tests should be able to reschedule
Retry 1 • Initial Attempt |
3.07% (7)7 / 228 runsfailed over last 7 days |
79.39% (181)181 / 228 runsflaked over last 7 days |