This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/master by this push:
     new 18560d1  Add JUnit category for extremely slow tests, launch them in a 
separate Travis job
18560d1 is described below

commit 18560d1eb21fe46056b6e459d75444419937c9de
Author: Vladimir Sitnikov <sitnikov.vladi...@gmail.com>
AuthorDate: Fri Feb 1 20:39:53 2019 +0300

    Add JUnit category for extremely slow tests, launch them in a separate 
Travis job
    
    Note: Travis runs 5 jobs in parallel, so we don't really want to have 6 
jobs.
    That is why jdk-10 runs SLOW tests and other perform regular ones
---
 .travis.yml                                        |  5 +++--
 core/pom.xml                                       | 19 ++++++++++++++++
 .../calcite/materialize/LatticeSuggesterTest.java  |  3 +++
 .../org/apache/calcite/profile/ProfilerTest.java   |  3 +++
 .../java/org/apache/calcite/test/FoodmartTest.java |  2 ++
 .../java/org/apache/calcite/test/LatticeTest.java  |  2 ++
 .../apache/calcite/test/MaterializationTest.java   |  2 ++
 .../java/org/apache/calcite/test/SlowTests.java    | 25 ++++++++++++++++++++++
 .../calcite/util/PartiallyOrderedSetTest.java      |  3 +++
 9 files changed, 62 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 390d38e..6099a04 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,7 +22,7 @@ matrix:
   include:
     - env: IMAGE=maven:3-jdk-12
     - env: IMAGE=maven:3-jdk-11 JDOC=Y RAT=Y
-    - env: IMAGE=maven:3-jdk-10
+    - env: IMAGE=maven:3-jdk-10 SLOW_TESTS=Y
     - env: IMAGE=maven:3-jdk-9
     - env: IMAGE=maven:3-jdk-8 JDOC=Y
 branches:
@@ -47,7 +47,8 @@ script:
   - unset _JAVA_OPTIONS
   - if [ $JDOC = "Y" ]; then export JDOC=javadoc:javadoc; fi
   - if [ $RAT = "Y" ]; then export RAT="apache-rat:check -Drat.consoleOutput"; 
fi
-  - $DOCKERRUN $IMAGE mvn -Dcheckstyle.skip -Dsurefire.useFile=false 
-Dsurefire.threadCount=1 -Dsurefire.perCoreThreadCount=false 
-Djavax.net.ssl.trustStorePassword=changeit test $JDOC $RAT
+  - if [ $SLOW_TESTS = "Y" ]; then export 
TESTS="-Dgroups=org.apache.calcite.test.SlowTests --projects :calcite-core"; 
else export TESTS=-DskipSlowTests; fi
+  - $DOCKERRUN $IMAGE mvn -Dcheckstyle.skip -Dsurefire.useFile=false 
-Dsurefire.threadCount=1 -Dsurefire.perCoreThreadCount=false 
-Djavax.net.ssl.trustStorePassword=changeit test $TESTS $JDOC $RAT
 git:
   depth: 10000
 sudo: required
diff --git a/core/pom.xml b/core/pom.xml
index efb37a8..7758233 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -554,6 +554,25 @@ limitations under the License.
         </resources>
       </build>
     </profile>
+    <profile>
+      <id>skipSlowTests</id>
+      <activation>
+        <property>
+          <name>skipSlowTests</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              
<excludedGroups>org.apache.calcite.test.SlowTests</excludedGroups>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
 </project>
diff --git 
a/core/src/test/java/org/apache/calcite/materialize/LatticeSuggesterTest.java 
b/core/src/test/java/org/apache/calcite/materialize/LatticeSuggesterTest.java
index 43f7562..92e562b 100644
--- 
a/core/src/test/java/org/apache/calcite/materialize/LatticeSuggesterTest.java
+++ 
b/core/src/test/java/org/apache/calcite/materialize/LatticeSuggesterTest.java
@@ -23,6 +23,7 @@ import org.apache.calcite.sql.SqlNode;
 import org.apache.calcite.sql.parser.SqlParseException;
 import org.apache.calcite.test.CalciteAssert;
 import org.apache.calcite.test.FoodMartQuerySet;
+import org.apache.calcite.test.SlowTests;
 import org.apache.calcite.tools.FrameworkConfig;
 import org.apache.calcite.tools.Frameworks;
 import org.apache.calcite.tools.Planner;
@@ -38,6 +39,7 @@ import org.hamcrest.Description;
 import org.hamcrest.Matcher;
 import org.hamcrest.TypeSafeMatcher;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.Arrays;
 import java.util.Comparator;
@@ -51,6 +53,7 @@ import static org.junit.Assert.assertThat;
 /**
  * Unit tests for {@link LatticeSuggester}.
  */
+@Category(SlowTests.class)
 public class LatticeSuggesterTest {
 
   /** Some basic query patterns on the Scott schema with "EMP" and "DEPT"
diff --git a/core/src/test/java/org/apache/calcite/profile/ProfilerTest.java 
b/core/src/test/java/org/apache/calcite/profile/ProfilerTest.java
index d0a9e90..d284666 100644
--- a/core/src/test/java/org/apache/calcite/profile/ProfilerTest.java
+++ b/core/src/test/java/org/apache/calcite/profile/ProfilerTest.java
@@ -22,6 +22,7 @@ import org.apache.calcite.linq4j.Enumerator;
 import org.apache.calcite.rel.metadata.NullSentinel;
 import org.apache.calcite.test.CalciteAssert;
 import org.apache.calcite.test.Matchers;
+import org.apache.calcite.test.SlowTests;
 import org.apache.calcite.util.ImmutableBitSet;
 import org.apache.calcite.util.JsonBuilder;
 import org.apache.calcite.util.Util;
@@ -34,6 +35,7 @@ import com.google.common.collect.Ordering;
 import org.hamcrest.Matcher;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
@@ -57,6 +59,7 @@ import static org.junit.Assert.assertThat;
 /**
  * Unit tests for {@link Profiler}.
  */
+@Category(SlowTests.class)
 public class ProfilerTest {
   @Test public void testProfileZeroRows() throws Exception {
     final String sql = "select * from \"scott\".dept where false";
diff --git a/core/src/test/java/org/apache/calcite/test/FoodmartTest.java 
b/core/src/test/java/org/apache/calcite/test/FoodmartTest.java
index 0416c79..9fe32a6 100644
--- a/core/src/test/java/org/apache/calcite/test/FoodmartTest.java
+++ b/core/src/test/java/org/apache/calcite/test/FoodmartTest.java
@@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableList;
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
@@ -33,6 +34,7 @@ import java.util.List;
 /**
  * Test case that runs the FoodMart reference queries.
  */
+@Category(SlowTests.class)
 @RunWith(Parameterized.class)
 public class FoodmartTest {
 
diff --git a/core/src/test/java/org/apache/calcite/test/LatticeTest.java 
b/core/src/test/java/org/apache/calcite/test/LatticeTest.java
index a5e70dc..ac3f926 100644
--- a/core/src/test/java/org/apache/calcite/test/LatticeTest.java
+++ b/core/src/test/java/org/apache/calcite/test/LatticeTest.java
@@ -32,6 +32,7 @@ import com.google.common.collect.ImmutableList;
 import org.junit.Assume;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.io.IOException;
 import java.sql.Connection;
@@ -58,6 +59,7 @@ import static org.junit.Assert.assertThat;
 /**
  * Unit test for lattices.
  */
+@Category(SlowTests.class)
 public class LatticeTest {
   private static final String SALES_LATTICE = "{\n"
       + "  name: 'star',\n"
diff --git 
a/core/src/test/java/org/apache/calcite/test/MaterializationTest.java 
b/core/src/test/java/org/apache/calcite/test/MaterializationTest.java
index 1193664..458f0e1 100644
--- a/core/src/test/java/org/apache/calcite/test/MaterializationTest.java
+++ b/core/src/test/java/org/apache/calcite/test/MaterializationTest.java
@@ -60,6 +60,7 @@ import com.google.common.collect.Ordering;
 
 import org.junit.Ignore;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.math.BigDecimal;
 import java.sql.ResultSet;
@@ -84,6 +85,7 @@ import static org.junit.Assert.assertTrue;
  * query and one or more materializations (what Oracle calls materialized 
views)
  * and checks that the materialization is used.
  */
+@Category(SlowTests.class)
 public class MaterializationTest {
   private static final Consumer<ResultSet> CONTAINS_M0 =
       CalciteAssert.checkResultContains(
diff --git a/core/src/test/java/org/apache/calcite/test/SlowTests.java 
b/core/src/test/java/org/apache/calcite/test/SlowTests.java
new file mode 100644
index 0000000..af32a8b
--- /dev/null
+++ b/core/src/test/java/org/apache/calcite/test/SlowTests.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.test;
+
+/**
+ * Declares a JUnit category for slow tests to speedup CI.
+ */
+public interface SlowTests {
+}
+
+// End SlowTests.java
diff --git 
a/core/src/test/java/org/apache/calcite/util/PartiallyOrderedSetTest.java 
b/core/src/test/java/org/apache/calcite/util/PartiallyOrderedSetTest.java
index 2a9e9dc..50ca11f 100644
--- a/core/src/test/java/org/apache/calcite/util/PartiallyOrderedSetTest.java
+++ b/core/src/test/java/org/apache/calcite/util/PartiallyOrderedSetTest.java
@@ -17,9 +17,11 @@
 package org.apache.calcite.util;
 
 import org.apache.calcite.test.CalciteAssert;
+import org.apache.calcite.test.SlowTests;
 
 import org.junit.Assume;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import java.util.AbstractList;
 import java.util.ArrayList;
@@ -41,6 +43,7 @@ import static org.junit.Assert.assertTrue;
 /**
  * Unit test for {@link PartiallyOrderedSet}.
  */
+@Category(SlowTests.class)
 public class PartiallyOrderedSetTest {
   private static final boolean DEBUG = false;
 

Reply via email to