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

bug: jest takes --max-workers as a file pattern when it is not specified and a pattern is provided #3855

Closed
3 tasks done
andrew9994 opened this issue Nov 29, 2022 · 6 comments
Labels
ionitron: needs reproduction This PR or Issue does not have a reproduction case URL

Comments

@andrew9994
Copy link
Contributor

andrew9994 commented Nov 29, 2022

Prerequisites

Stencil Version

> 2.19.0

Current Behavior

When stencil test is called with a file pattern, without specifying the max workers in the pool like this:

npx stencil test --e2e -- some-file-name.e2e.ts

stencil adds the --max-workers argument to the end of the passed arguments, and gets passed to jest like this:

jest args: --e2e -- some-file-name.e2e.ts --max-workers=8

but jest expects that '--' is only followed by filename patterns and that all flags like --json are before it in the argument list, therefore the --max-workers has no effect and indeed jest interprets it as a file pattern:

Ran all test suites matching /some-file-name.e2e.ts|--max-workers=8/i.

The bug got introduced with: 8a221e8

Expected Behavior

Jest --max-workers arg should be passed before -- when not specified.

System Info

No response

Steps to Reproduce

Run a test with a file pattern, without specifying the num of max-workers. Like:
npx stencil test --e2e -- some-file-name.e2e.ts

Code Reproduction URL

https://github.com/ionic-team/ionic-framework

Additional Information

I would open a PR to solve this issue.

@ionitron-bot ionitron-bot bot added the triage label Nov 29, 2022
@rwaskiewicz
Copy link
Contributor

Hey @andrew9994 👋

We've added #3827 since the commit you linked in:

The bug got introduced with: 8a221e8

which sounds very much like the issue you're seeing.

Can you please add a minimal reproduction URL for the team to look at? Thanks!

@rwaskiewicz rwaskiewicz added the ionitron: needs reproduction This PR or Issue does not have a reproduction case URL label Nov 29, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Nov 29, 2022

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@ionitron-bot ionitron-bot bot removed the triage label Nov 29, 2022
@andrew9994
Copy link
Contributor Author

Sorry, I noticed that it was fixed already in eb44060, but it is not yet released.

@rwaskiewicz
Copy link
Contributor

rwaskiewicz commented Nov 29, 2022

Ah, not a problem! I expect this to be released next Monday, as a part of Stencil 2.20.0

@andrew9994
Copy link
Contributor Author

Thanks @rwaskiewicz !

@rwaskiewicz
Copy link
Contributor

@andrew9994

👋 I wanted to follow up and let you know that v2.20.0 has been released with the fix for this issue. Should the fix in the release not solve the one you reported, please feel free to open a new issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ionitron: needs reproduction This PR or Issue does not have a reproduction case URL
Projects
None yet
Development

No branches or pull requests

2 participants