aboutsummaryrefslogtreecommitdiffstats
path: root/pom.xml
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-04-02 15:17:31 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-04-02 16:53:38 +0200
commitd5b84364c57fd4f1f160661e3da105527ead4c28 (patch)
tree446b481d6ff94ddc0949b4997d5b2cceeb561ed8 /pom.xml
parent9d98b11d4ed298aa9a6c312f9f34b51f32bfd481 (diff)
downloadsonarqube-d5b84364c57fd4f1f160661e3da105527ead4c28.tar.gz
sonarqube-d5b84364c57fd4f1f160661e3da105527ead4c28.zip
Use random timezone when executing tests from maven
This allows to fail-fast if a test is heavily coupled with local timezone.
Diffstat (limited to 'pom.xml')
-rw-r--r--pom.xml26
1 files changed, 25 insertions, 1 deletions
diff --git a/pom.xml b/pom.xml
index 0a42ea7e833..49573c964c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -414,6 +414,30 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.5</version>
+ <executions>
+ <execution>
+ <id>randomize-environment</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>
+ <![CDATA[
+ String[] timezones = ["UTC", "EST", "ECT", "CST", "NZ", "GMT-9", "GMT+9"];
+ String testTimezone = timezones[new Random().nextInt(timezones.length)];
+ project.properties['testTimezone'] = testTimezone;
+ log.info('Timezone used for tests: ' + testTimezone);
+ ]]>
+ </source>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
@@ -535,7 +559,7 @@
<systemPropertyVariables>
<java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
<!-- temporary workaround. Waiting for tests to not be coupled with env timezone. -->
- <user.timezone>GMT+1</user.timezone>
+ <user.timezone>${testTimezone}</user.timezone>
</systemPropertyVariables>
<groups>${junitGroups}</groups>
<threadCount>1</threadCount>