Skip to content

test(sourcemaps): Add cloudflare wrangler source maps e2e test #1000

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

Merged
merged 16 commits into from
Jun 2, 2025

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented May 21, 2025

This PR adds a new e2e test app for the new cloudflare source maps wizard flow (#999). This introduces an (arguable 😅 ) improvement to our e2e test setup:

A couple of weeks ago I started working on a small NPM package called clifty to declaratively define a CLI interaction before executing the actual child process. The main goal of this package is to:

  • reduce clutter of defining interactions imperatively and ensuring correct promise awaiting to avoid timeouts and race conditions
  • create a readable flow through the interaction so that it's easy to understand what's going on, simply when reading the test code

IMHO this makes our e2e tests better readable compared to the solution we have in other tests and hopefully also less prone to flakes. Let's see if reviewers and CI agree :)

I propose we give the package a try in this e2e test and check for flakes or other weird behaviour. We can convert any of the other tests to this package whenever we want (or not).

#skip-changelog

@Lms24 Lms24 changed the base branch from master to lms/feat-cf-wrangler-sourcemaps-wizard May 21, 2025 16:04
Copy link

codecov bot commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.98%. Comparing base (afb2704) to head (b331287).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1000   +/-   ##
=======================================
  Coverage   27.98%   27.98%           
=======================================
  Files         130      130           
  Lines       14233    14233           
  Branches      882      882           
=======================================
  Hits         3983     3983           
  Misses      10233    10233           
  Partials       17       17           
Flag Coverage Δ
unit-tests 27.98% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Lms24 Lms24 self-assigned this May 21, 2025
@Lms24 Lms24 force-pushed the lms/test-e2e-sourcemaps-wizard-cf-wrangler branch from 69ed443 to 555e6b6 Compare May 22, 2025 12:54
@Lms24 Lms24 requested review from AbhiPrasad, a team and RulaKhaled and removed request for a team May 22, 2025 13:35
import { Integration } from '../../lib/Constants';
import * as path from 'path';
import fs from 'fs';
//@ts-expect-error - clifty is ESM only
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
//@ts-expect-error - clifty is ESM only
// @ts-expect-error - clifty is ESM only

but also esm only 😢

Copy link
Member Author

@Lms24 Lms24 May 28, 2025

Choose a reason for hiding this comment

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

Maybe I should just emit CJS as well. Or actually, we probably need to adjust the build/TS config at some point in the wizard because I'm sure there are nicer ways to handle this than the ts-expect-error comment. Since we do this in a bunch of places (with clack), I'll follow up with another PR.

@Lms24 Lms24 force-pushed the lms/feat-cf-wrangler-sourcemaps-wizard branch from 0559287 to b0ad164 Compare May 30, 2025 14:59
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

The Clifty workflow looks so much cleaner 😮

@Lms24 Lms24 force-pushed the lms/test-e2e-sourcemaps-wizard-cf-wrangler branch 2 times, most recently from b822349 to 6fce122 Compare June 2, 2025 08:28
Base automatically changed from lms/feat-cf-wrangler-sourcemaps-wizard to master June 2, 2025 08:47
@Lms24 Lms24 force-pushed the lms/test-e2e-sourcemaps-wizard-cf-wrangler branch from 6fce122 to b331287 Compare June 2, 2025 08:48
@Lms24 Lms24 merged commit 7489fad into master Jun 2, 2025
43 checks passed
@Lms24 Lms24 deleted the lms/test-e2e-sourcemaps-wizard-cf-wrangler branch June 2, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants