Skip to content
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

test: split fixtures for browser test #4878

Closed
wants to merge 13 commits into from

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Jan 5, 2024

Description

Base branch: #4867 (new change is only the last commit)

Testing to see if splitting the custom base test would affect test failure on CI.
I also rewrote an assertion to be based on stdout/stderr, so it might be easier to debug.

I'll retry CI for a few times by force-pushing the same commit.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Copy link

netlify bot commented Jan 5, 2024

Deploy Preview for fastidious-cascaron-4ded94 canceled.

Name Link
🔨 Latest commit f1be906
🔍 Latest deploy log https://app.netlify.com/sites/fastidious-cascaron-4ded94/deploys/659793128d1a7d0008679a90

@hi-ogawa hi-ogawa changed the title test: split browser test fixtures test: simplify browser mode custom base test Jan 5, 2024
@hi-ogawa hi-ogawa changed the title test: simplify browser mode custom base test test: split fixtures for browser test Jan 5, 2024
@hi-ogawa hi-ogawa mentioned this pull request Jan 5, 2024
6 tasks
@hi-ogawa hi-ogawa force-pushed the test-browser-flaky branch 2 times, most recently from 8e21772 to f1be906 Compare January 5, 2024 05:26
Comment on lines +6 to +8
const result = await execa('npx', [
'vitest',
'run',
Copy link
Member

Choose a reason for hiding this comment

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

Was this using npx before? Signal terminals are buggy when scripts are launched via npx. I can't find the link for the issue or older references for these issues right now. Consider using startVitest instead.

Copy link
Member

Choose a reason for hiding this comment

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

pnpm exec should also work correctly.

Copy link
Contributor Author

@hi-ogawa hi-ogawa Jan 5, 2024

Choose a reason for hiding this comment

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

Currently browser mode testing is written with execa + npx vitest, so I was keeping the same structure from:

const argv = ['vitest', '--run', `--browser.name=${browser}`]
if (browser !== 'safari')
argv.push('--browser.headless')
const { stderr, stdout } = await execa('npx', argv.concat(moreArgs), {

The test runner used here is node --test, so test utils like runVitest are not available and runner.test.mjs would probably be easier to written with execa, so I'll keep that there for now.

This small test custom-base.test.mjs should be fine with startVitest API, so I'll rewrite that. Thanks for the suggestion!


Btw, I found things are already flaky without update-snapshot.test.mjs from #4867, so I'm now testing with only runner.test.mjs and custom-base.test.mjs here #4879.

@hi-ogawa
Copy link
Contributor Author

hi-ogawa commented Jan 5, 2024

Closing this in favor of the other one

@hi-ogawa hi-ogawa closed this Jan 5, 2024
@hi-ogawa hi-ogawa deleted the test-browser-flaky branch January 5, 2024 08:38
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.

2 participants