Github user pvillard31 commented on the issue:

    https://github.com/apache/nifi/pull/1480
  
    @trixpan I just wanted to check before getting this merged but I believe 
setting the properties like you did does not change the locale settings for 
surefire plugin (unit tests). The fact is I know there are some tests failing 
with French locale although the travis build looks OK.
    
    There is at least one in:
    ````
    
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/
    ````
    This is tracked with NIFI-2683.
    
    So I just did some tests:
    
    If I run
    ````
    mvn clean install -Duser.language=fr -Duser.region=FR
    ````
    In the above directory, the build is fine.
    
    But if I change the parent pom.xml with what I suggested in the JIRA:
    ````
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.18</version>
                        <configuration>
                            <includes>
                                <include>**/*Test.class</include>
                                <include>**/Test*.class</include>
                                <include>**/*Spec.class</include>
                            </includes>
                            
<redirectTestOutputToFile>true</redirectTestOutputToFile>
                            <argLine combine.children="append">-Xmx1G 
-Djava.net.preferIPv4Stack=true -Duser.language=fr -Duser.region=FR</argLine>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <!-- Force surefire to use JUnit -->
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-junit4</artifactId>
                                <version>2.18</version>
                            </dependency>
                        </dependencies>
                    </plugin>
    ````
    
    and run
    ````
    mvn clean install
    ````
    
    then I have a test failure:
    ````
    Failed tests:
      StandardHttpResponseMapperSpec.MergeResponses: #responseEntities.size() 
HTTP 200 #httpMethod responses for #requestUriPart:122 Condition not satisfied:
    ````
    
    IIRC the arguments passed along the maven command are not used by surefire 
plugin which uses its own environment to run unit tests.
    
    So here is my proposition, in the parent pom, add an empty property like 
this:
    ````
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.min-version>3.1.0</maven.min-version>
            <maven.surefire.arguments/>
            ...
        </properties>
    ````
    
    Then, in the plugin configuration, change the argLine with:
    ````
    <argLine combine.children="append">-Xmx1G -Djava.net.preferIPv4Stack=true 
${maven.surefire.arguments}</argLine>
    ````
    
    This way, there is absolutely no change with the current behavior and the 
default locale of the system will remain the one used when building. However 
you can now specify the locale to use with:
    ````
    mvn clean install -Dmaven.surefire.arguments="-Duser.language=fr 
-Duser.region=FR"
    ````
    
    And I confirm that the test is failing as "expected".
    
    What do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to