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

Unselected Test Suite Being Run #99

Closed
skipjack opened this issue Jul 30, 2021 · 6 comments
Closed

Unselected Test Suite Being Run #99

skipjack opened this issue Jul 30, 2021 · 6 comments

Comments

@skipjack
Copy link

If you have multiple test suites in a project, and one happens to be the substring of another, then the running the substring one will cause both to be picked up. So in the following example (see the screenshot) if I run invoices.json then changelog_header_invoices.json will also be picked up.

image

The steps above should make this straightforward to reproduce. We've seen the issue on two MacOS boxes running Big Sur 11.5.1 and Puppetry v3.2.5.

I have a feeling this is related to the fact that jest accepts a regex pattern by default, not a specific filename.

@skipjack
Copy link
Author

It looks like maybe this module is the one that would have to be updated?

@skipjack
Copy link
Author

I'm guessing that if we populate targetFiles with absolute or even relative file paths rather than names, it might address the issue.

@dsheiko
Copy link
Owner

dsheiko commented Aug 11, 2021

Sorry for the delay. I'm back.
That's what you described a bit weird. The app doesn't rely on a pattern/glob. Instead it cleans up temporary directory for Jest project and create a new one. It populates the specs subdirectory with test suite files depend on what is selected in checkbox group (like on your screenshot). So you have there any not intended suites I can think only that some where not removed during clean up. Checking now

@skipjack
Copy link
Author

The app doesn't rely on a pattern/glob.

My point was that jest does. So jest invoices.spec.js will actually run anything that ends in invoices.spec.js (e.g. more-invoices.spec.js) not just the exact match. Are you saying that Puppetry rebuilds a clean jest project every time you run using only the .json files selected so the jest pattern shouldn't matter?

@dsheiko
Copy link
Owner

dsheiko commented Aug 12, 2021

Oh, I got it now. While the export it's as I explained, but when you run the tests from the app it doesn't clean the directory - I'm on it.

dsheiko added a commit that referenced this issue Aug 12, 2021
@dsheiko
Copy link
Owner

dsheiko commented Aug 12, 2021

just committed the fix, will be published with the next release.

@dsheiko dsheiko closed this as completed Aug 12, 2021
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

No branches or pull requests

2 participants