-
Notifications
You must be signed in to change notification settings - Fork 688
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
C3: Improve e2e testing reliability #3686
Conversation
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5869937533/npm-package-wrangler-3686 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5869937533/npm-package-wrangler-3686 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5869937533/npm-package-wrangler-3686 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5869937533/npm-package-cloudflare-pages-shared-3686 Note that these links will no longer work once the GitHub Actions artifact expires. |
Codecov Report
@@ Coverage Diff @@
## main #3686 +/- ##
=======================================
Coverage 75.17% 75.17%
=======================================
Files 194 194
Lines 11410 11410
Branches 3013 3013
=======================================
Hits 8577 8577
Misses 2833 2833 |
a28ae4f
to
fdfacd0
Compare
29b5529
to
c6e2d01
Compare
c56b595
to
8aa7ed7
Compare
22fcc2d
to
fb66ef6
Compare
0ec691b
to
a3957bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that the PR got merged as I was reviewing it 😭
(I figured I'd at least publish the comment I had....)
- name: ESlint and Typescript caching | ||
uses: actions/cache@v3 | ||
id: eslint-cache | ||
with: | ||
path: | | ||
.eslintcache | ||
tsconfig.tsbuildinfo | ||
key: ${{ matrix.os }}-eslint-tsbuildinfo-${{ hashFiles('**/*.ts','**/*.js', 'package.json', 'tsconfig.json') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this supposed to be in the install-dependencies
actions?
@@ -6,7 +6,7 @@ | |||
"hono": "0.2.6", | |||
"next": "13.4.2", | |||
"nuxt": "3.4.2", | |||
"qwik": "1.1.x", | |||
"qwik": "1.2.7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity, since before it was 1.1.x
why not going to 1.2.x
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't have a ton of time to test multiple 1.2.x versions so I just bumped to latest. I also didn't like that it was sort of a one off, I'd like to re-evaluate our version pinning and use .x
for everything or pin to specific consistently.
const { name, version } = whichPmRuns() ?? { name: "npm", version: "0.0.0" }; | ||
let { name, version } = whichPmRuns() ?? { name: "npm", version: "0.0.0" }; | ||
|
||
if (process.env.TEST_PM) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to understand things better, I don't see you setting this anywhere, so I assume that it isn't currently used right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In package.json:
"test:e2e:npm": "npm run build && TEST_PM=npm vitest run --config ./vitest-e2e.config.ts",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, sorry, somehow I missed that 🤦
|
||
const nodeModulesPath = path.join(ctx.project.path, "node_modules"); | ||
rmSync(nodeModulesPath, { recursive: true }); | ||
const lockfilePath = path.join(ctx.project.path, "package-lock.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this correct? this code runs for pnpm
and yarn
but those two don't produce a package-lock.json
, I think that they produce respectively a pnpm-lock.yaml
and a yarn.lock
(maybe all possible lock files should get deleted? 🤷)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, the idea here is that if you're using yarn or pnpm, it will delete the lockfile and node_modules, then install with the appropriate package manager, thus creating fresh (and hopefully working) dependencies, and a new lockfile to describe them.
The issue is that some create scripts use npm regardless of which PM you choose, and these need to be reset before we try to install wrangler with pnpm
or yarn
. Otherwise, it fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see thanks 🙂👍
What this PR solves / how to test:
Improves the reliability of c3 e2e tests by putting a more stable cleanup script in place that runs before each test run. Also does some refactoring to have a re-usable composite action for checkout and install. Lays some additional ground work for pnpm tests which still need some work
Reviewer is to perform the following, as applicable: