-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add JUnit config to intellijinit #133
base: master
Are you sure you want to change the base?
Add JUnit config to intellijinit #133
Conversation
@pejovica could you please sign the oracle contributor agreement? Here are the instructions:
|
Otherwise, LGTM |
- Make IntelliJ builds fail on Ant Exec task error - Pass IntelliJ project's JDK to Ant build tasks, so that they are independent of the environment (i.e., they run even without JAVA_HOME being set) - Make ideclean remove IntelliJ's modules that were created by running intellijinit with --mx-python-modules flag
I've added the final set of changes, so could you have another look? |
mx.py
Outdated
@@ -13166,6 +13166,85 @@ def artifactFileName(dist): | |||
artifactFile = join(artifactsDir, artifactFileName(dist)) | |||
update_file(artifactFile, artifactXML.xml(indent=' ', newl='\n')) | |||
|
|||
# JUnit configuration | |||
def get_unittest_args(): |
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.
This is a bit invasive: it introduces an invisible dependency between this code and unittest
and these eventually fire back. We need to re-organize unittest
such that it uses the same function this code will use. This function will simply return all the arguments.
Also, in this way, there will be less code.
mx.py
Outdated
default_configuration = ''.join([line.strip() for line in default_configuration.splitlines()]) | ||
|
||
# until the official solution becomes available (IDEA-65915), use `workspase.xml` | ||
wsXml = XMLDoc() |
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.
We can't just nuke someones workspace
someone might of spent hours on setting it up. We need to find <configuration default="true" type="JUnit" factoryName="JUnit">
and replace it with the new one.
mx.py
Outdated
'''.format(vm_params=get_unittest_args()) | ||
|
||
# remove all whitespace between tags, so that we don't end up with excess newlines in xml output | ||
default_configuration = ''.join([line.strip() for line in default_configuration.splitlines()]) |
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.
This is not good as it breaks indentation. Try some of these that you find the easiest:
http://stackoverflow.com/questions/2504411/proper-indentation-for-python-multiline-strings
Sad that python does not support this. You can also do what Scala does just with a regex here.
mx.py
Outdated
# remove all whitespace between tags, so that we don't end up with excess newlines in xml output | ||
default_configuration = ''.join([line.strip() for line in default_configuration.splitlines()]) | ||
|
||
# until the official solution becomes available (IDEA-65915), use `workspase.xml` |
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.
workspase ~> workspace
…mx:mx-benchmark-jmh to master * commit '34ed8b50032600d6f2d3aac4584470bcef3df6b0': work around pylint bug Bump version to 5.32.0 mx benchmark: add a default vm and jmh benchmark (if mx is primary suite) mx benchmark: add support for JMH
If you believe this is an error, please contact [email protected]. |
We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address pejovica -(at)- users -(dot)- noreply -(dot)- github -(dot)- com. You can sign it at that link. If you think you've already signed it, please comment below and we'll check. |
@pejovica will there be progress on this or we can close the PR? |
Hello Aleksandar Pejović, thanks for contributing a PR to our project! We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address pejovica -(at)- users -(dot)- noreply -(dot)- github -(dot)- com. You can sign it at that link. If you think you've already signed it, please comment below and we'll check. |
@pejovica is this still valid? |
Makes intellijinit generate default run/debug configuration for JUnit.
There are two aspects to proposed changes. First one is the placement of generated configuration. At the moment it is stored in the workspace.xml, since the official location is not available yet (IDEA-65915). And the second one is the collection of necessary VM parameters for JUnit to run. I tried to reuse mx unittest for that by effectively making it execute a dry run. This implementation of dry run only prevents tests from running. It doesn't prevent side effects, e.g., unittest's test discovery and caching. But since unittest allows custom launchers, i.e., implemented by other modules, I am not sure what can be expected from them in this regard. Graal core seems to work fine.