-
Notifications
You must be signed in to change notification settings - Fork 88
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 the way locale information is passed to Surefire #315
Conversation
cc: @findepi |
See #98 (comment) Does this mean #98 never actually worked? @ksobolew how do you test these changes? |
I just run
Maybe it broke in the meantime? That configuration was added 4 years ago... I did some googling and found problem reports about that, but no fix in Surefire was ever mentioned. |
Thanks for testing this out. Does this test pass for you locally? (even if it does, i would somewhat prefer to set timezone region and lang same way) cc @electrum |
Maybe we need similar test for the locale?
Yes, this makes the tests pass for me. |
70dc6b7
to
f099204
Compare
|
f099204
to
4634826
Compare
Addressed comments. One interesting thing to note is that this is actually broken in Maven, but IntelliJ correctly passes these parameters so these test work fine in the IDE. |
4634826
to
5e4e918
Compare
@@ -440,6 +437,9 @@ | |||
<!-- ${argLine} is for Jacoco: https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html --> | |||
<argLine> | |||
${argLine} | |||
-Duser.timezone=${air.test.timezone} |
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.
add a code comment why this goes in argsLine and not systemPropertyVariables
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.
Added :)
This moves primarily the `user.language` and `user.region` from `systemPropertyVariables` to explicit property setting on the JVM. These two methods to set them are supposed to be the same, but passing via system properties does not actually work. Which is annoying, because when the are set in both ways, Surefire complains about it: ``` [WARN] The system property user.language is configured twice! The property appears in <argLine/> and any of <systemPropertyVariables/>, <systemProperties/> or user property. [WARN] The system property user.region is configured twice! The property appears in <argLine/> and any of <systemPropertyVariables/>, <systemProperties/> or user property. ``` It seems that the `user.timezone` actually works as expected, but is moved along with the other two for consistency.
5e4e918
to
70ca37d
Compare
As a result of this change, my IntelliJ no longer sets @ksobolew does it work on your side? |
Hm, I haven't encountered any problems 🤔 |
Not yet, anyway |
Do Trino's |
You're right, it's not working in IDEA 😞 |
Looks like IDEA is confused by <argLine>
${argLine}
...
</argLine> Once I removed it, it worked. Thing is, if there's no Jacoco, this does not get expanded and sits there as literal |
See #300 that should provide a default value when Jacoco is disabled |
Would definining the properties twice, both in |
Seems like it was merged long ago, and IntelliJ doesn't pick the time zone ~today.
would prefer to avoid duplication, but maybe we need to do this this will make surefire issue warnings, like mentioned in the PR description
or maybe we move back the user.timezone (provided IntelliJ can pick the other to) BTW @ksobolew is there a surefire bug report about this? |
It was then changed in #301 to activate on |
Actually with Surefire it works just fine |
Not sure, probably yes. But there are two "but"s:
|
Can Trino define a default for |
I think it can. This will make enabling jacoco harder, though. Can we activate the jacoco profiles explicitly? |
This PR (#315) is a workaround for somre surefire's behavior.
Can you expand on this? What would be worse than it is today, or before this PR was merged?
The bug is in airbase. In trino we can workaround, sure, but can we fix this here? |
Oh, right :) I guess not. The best I could find was https://stackoverflow.com/questions/8901880/set-surefire-plugin-locale-in-maven-pom-file
Fair question. I hope so! |
We should have reported this before/while working on this PR. Can you please follow-up accordingly? |
Reported it as https://issues.apache.org/jira/browse/SUREFIRE-2104 |
The presence of the unexpanded |
I was not successful in making this work.
is it only for me, or is this problem persistent? |
It was some time ago and I don't remember exactly what the problem was, but I checked now and indeed, it doesn't work. In fact, it seems that IDEA does not pick any of the arguments specified inside |
awesome, let's do this, thanks!
the PR title talks about locale |
These are all system properties so they are handled the same way. We pin locale for the same reason we pin the time zone, and they have the same issues. |
I read the original commit message and it seems that it's wrong - they are not handled the same way. |
Is there anything preventing us from restoring correct time zone handling for intellij? |
No, I don't think there is anything that prevents us, except for making sure that it works. |
We want to see if anything breaks. There's a suspicion that this is not an issue anymore, and causes issues of its own.
This moves primarily the
user.language
anduser.region
fromsystemPropertyVariables
to explicit property setting on the JVM. These two methods to set them are supposed to be the same, but passing via system properties does not actually work. Which is annoying, because when the are set in both ways, Surefire complains about it:It seems that the
user.timezone
actually works as expected, but is moved along with the other two for consistency.