-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(testing): convert testPathPattern to an array #1854
Conversation
I'm stumped by the failing test because locally it passes. |
@dgsmith2 - It's failing because your commit message on Unless the two commits are distinct, I suggest squashing them both into the later one. |
9d97812
to
29a2909
Compare
@jdpearce, I squashed the commits and force-pushed. The build errors are now due to network issues between Travis CI and Heroku. Can these be manually triggered or do I need to make another change for an automatic trigger? |
@dgsmith2 I've restarted that build for you. Hopefully it runs properly this time... 🤞 |
@jdpearce success! 🎉 |
@dgsmith2 will it break existing workspaces when they update? |
@vsavkin the motivation behind this PR is to address the "display problem" in #1693 (comment) Presently, the builder parses This fix eliminates the processing of additional (potentially all) tests only to have them skipped. That said, it may be possible there is an edge case in which a spread of the value interpretted as a string is providing an Nx user the behavior they expect. However, I presently believe it to be improbable. |
@dgsmith2 - while it's unlikely that anyone is relying on this behaviour, what will happen if someone has Should we fix those workspaces such that |
Perhaps I'm missing something, but there is no need to migrate. Changing it to an array means it will allow multiple values occurences of the argument (e.g., The command my IDE is running is no different than before my fix (single instance of the |
@dgsmith2 - you've changed the See, for example, |
@jdpearce, I will be glad to take a look at adding a migration. As a new contributer, I'm happy to defer to the experience of others in determining what is necessary for this PR. |
Seems like I need to create a migration of Is there a naming convention for migrations? |
Why not just support string and array? If it's a string, just convert to an array of 1 element |
@alfaproject, forgive me as I'm not completely familiar with it, but does the Angular CLI builder schema permit unioned types? |
@dgsmith2 Thanks again for your contribution! To answer your question: the schema permits union types. But I'd only use the union type of jest itself supports both string and arrays. If Jest doesn't, I'd write a migration update angular.json/workspace.json. This is an example of a migration that does something similar:
You can throw a migration into the update-8-6-0 folder. |
Per facebook/jest/nrwl#5066, the testPathPattern parameter to the CLI is an array
29a2909
to
66b9d62
Compare
@jdpearce and @vsavkin, I was finally able to circle back around to this PR and add the requested migration. Out of curiousity, once this PR is merged, what release schedule will it be under? I'm lead on a team tasked with incorporating Nx into our existing app. Once we roll it out I'd like to be able to inform developers when they can expect the test performance gains that result from this fix. Thanks for all the help and direction you two offerred! |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Per jestjs/jest#5066, the testPathPattern parameter to the CLI is an array