cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Tests: Smoke Tests for packaged embeds and build improvements

Open hariombalhara opened this issue 2 years ago • 4 comments
trafficstars

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-react first using cd packages/embeds/embed-react && yarn build
  • [x] Run yarn publish-embed command after deleting dist from all embed packages(embed-core, embed-react,embed-snippet). It would generate dist folder automatically with correct URL https://app.calc.om

hariombalhara avatar May 29 '23 07:05 hariombalhara

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

vercel[bot] avatar May 29 '23 07:05 vercel[bot]

📦 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! 🙌

github-actions[bot] avatar May 29 '23 08:05 github-actions[bot]

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

linear[bot] avatar May 29 '23 11:05 linear[bot]

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.

linear[bot] avatar May 29 '23 11:05 linear[bot]

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 1Initial Attempt
3.07% (7) 7 / 228 runs
failed over last 7 days
79.39% (181) 181 / 228 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar May 30 '23 10:05 deploysentinel[bot]