Skip to content
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

Compiler: Test fail on non english system #221

Closed
Rileran opened this issue Oct 5, 2022 · 0 comments
Closed

Compiler: Test fail on non english system #221

Rileran opened this issue Oct 5, 2022 · 0 comments
Labels

Comments

@Rileran
Copy link

Rileran commented Oct 5, 2022

I am using a french system (LANG FR_fr) and I got into trouble trying to run tests on the Compiler project. The test messages are compared against localized message, therefore making test case fail.

Example in ASPrrivateConstructorTests, test testConstructorMustBePublicProblem_withInternalConstructor_andAllowPrivateConstructorsDisabled

[ERROR]   ASPrivateConstructorTests.testConstructorMustBePublicProblem_withInternalConstructor_andAllowPrivateConstructorsDisabled:110->ASFeatureTestsBase.compileAndExpectErrors:175 
Expected: is "A constructor can only be declared public\n"
     got: "Un constructeur ne peut être déclaré que public.\n"

This can be easily fix by setting this variable to EN_us, but maybe this should be a default in the test configuration.

I have tried adding configuration to the maven-surefire-plugin without success. What I have tried so far (in compiler/pom.xml) :

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
      <environmentVariables>
        <LANG>en_US</LANG>
      </environmentVariables>
  ...
</plugin>

and

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
      <systemPropertyVariables>
        <user.language>en</user.language>
        <user.country>US</user.country>
      </systemPropertyVariables>
  ...
</plugin>

and

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
      <argLine>-Duser.language=en -Duser.country=US</argline>
  ...
</plugin>

Maybe there is something that I am missing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants