-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
minor: remove testLocaleIsSupported tests #11544
Conversation
* the violation does not use the default value. | ||
*/ | ||
@Test | ||
public void testLocaleIsSupported() { |
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.
It was created at 8a4b6e0
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.
The only way we can keep such a test is if we confirm we have a property file for the language we are testing against as @pbludov demonstrated at #11544 (comment) .
Is it because Can you share command and some part of output? |
This statement conflicts with the correction for the language run in #11529 which is run under russian. We only got 2 test failures and not 200+ (see #11529 (comment) ). As best I can tell, the fix is valid that we are now running with russian in that PR and not english. Can you explain this? |
$ sudo apt install language-pack-fr
$ LANG=fr_FR.UTF-8 mvn test
....
[ERROR] Tests run: 3788, Failures: 177, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------ There are many failed tests similar to
|
$ sudo apt install language-pack-ru Patch branch$ LANG=ru_RU.UTF-8 mvn test
....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------ Master branch$ LANG=ru_RU.UTF-8 mvn test
....
[ERROR] Tests run: 22, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.122 s <<< FAILURE! - in com.puppycrawl.tools.checkstyle.api.ViolationTest
[ERROR] testLocaleIsSupported Time elapsed: 0.042 s <<< FAILURE!
com.google.common.truth.AssertionErrorWithFacts:
Unsupported language: ru_RU
expected not to be: Empty statement.
at com.puppycrawl.tools.checkstyle.api.ViolationTest.testLocaleIsSupported(ViolationTest.java:93)
....
[ERROR] Tests run: 15, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.015 s <<< FAILURE! - in com.puppycrawl.tools.checkstyle.DefaultLoggerTest
[ERROR] testLocaleIsSupported Time elapsed: 0.002 s <<< ERROR!
java.lang.NoSuchMethodException: com.puppycrawl.tools.checkstyle.DefaultLogger$LocalizedMessage.<init>(java.lang.String,[Ljava.lang.String;)
at com.puppycrawl.tools.checkstyle.DefaultLoggerTest.testLocaleIsSupported(DefaultLoggerTest.java:254)
....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------ |
We got two failures because all messages for any unsupported language are messages in English actually. If any supported language (except English) is set as the default system language, all messages will be different. And many tests will fail. |
Thanks for the clarification. This makes sense now. |
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.
I am ok with this change, but I would prefer we found some kind of replacement for the tests as talked about in #11544 (comment) .
Ok , we are going to enforce English during test execution, bdd nature of tests are forcing us to do this. So execution in any locale will be same and not problematic. |
@pbludov , please change commit to reference this PR, it has very valuable conversation that are not obvious. Let's keep it in history. |
done |
These tests are useless. If the user.language property is set to anything else but English, 200+ tests will fail.
So we need a dedicated test suite to validate all supported languages.