-
Notifications
You must be signed in to change notification settings - Fork 915
Follow testRun and project launch config options.
#8470
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
Conversation
|
So, if I open a Maven test, go to the I.e. if Please let me know what you think. Thanks! |
9522cae to
9259893
Compare
lahodaj
left a comment
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.
To summarize, this is PR adjusts what happens when a file is open, and "Run" (or "Debug") is invoked.
Currently, both "ordinary" and "test" files can be run using the "Start Debugging" and "Run Without Debugging" actions. The server determines whether the file is run as "ordinary" (i.e. typically main method) or as test based on the location of the file. Whether this is really correct, I am not completely sure. It could be argued that test runs should only be done using the "Testing" tab or the test glyph-gutter annotations. I am not sure, although I guess I somewhat like the ability to just run test. @jisedlac, any opinion? Thanks!
There's a problem in the current implementation and that is that if a test file contains a "main" method, it cannot be run using the "ordinary" execution, as it will always be run as a test.
This PR adjusts the existing behavior to allow "ordinary" execution of files inside the test roots as follows: there's an existing testRun option recognized in the launch configuration. The interpretation of this option changes slightly:
- if the
testRunoption is present andfalse, the file will be (unconditionally) run using "ordinary" execution (i.e. commonly as a main class). - if the
testRunoption is present andtrue, the file will be (unconditionally) run using "test" execution. - if the
testRunoption is not present, then the execution will be determined based on the file location - the test execution will be used for files inside the test directory, otherwise the "ordinary" execution will be used.
This way, it is always possible to override the autodetection and say exactly what should happen by explicitly setting the testRun option.
|
Unless there are objections, I would like to merge this in a few days. Thanks! |
…run non-test for `false` and test for `true`). Following the `project` launch configuration setting, if present.
2a85f68 to
d6374ce
Compare
testRun and project launch config options.
|
@lahodaj have any tests run on this? Showing as still needing approval. |
Right. I've approved the workflow. Tests ran on the previous iteration (which is invisible/hard to find, due to the squash requirement and hence force push), and the current iteration is exactly the same. So, I assume (read: hope) the tests will pass. |
Changed the NBLaunchDelegate to use launchType instead of guessing it from file location.
bug - #353
Similarly preferProjActions is picked up launch arguments (if available) instead of guessing it
bug - #431
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)