diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 3baeec99a..a0198a40b 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -34,10 +34,11 @@ jobs: matrix: profiles: - '' - - '-Pspark-3.0 -Dspark.archive.mirror=https://archive.apache.org/dist/spark/spark-3.1.1 -Dspark.archive.name=spark-3.1.1-bin-hadoop2.7.tgz -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.DataLakeTest' + - '-Pspark-3.0 -Dspark.archive.mirror=https://archive.apache.org/dist/spark/spark-3.1.1 -Dspark.archive.name=spark-3.1.1-bin-hadoop2.7.tgz -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DataLakeTest' - '-Pspark-3.1' - '-Pspark-3.1 -Pspark-hadoop-3.2' - - '-Pspark-3.2-snapshot -pl :kyuubi-spark-sql-engine,:kyuubi-common,:kyuubi-ha,:kyuubi-zookeeper -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.DataLakeTest' + - '-Pspark-3.2-snapshot -pl :kyuubi-spark-sql-engine,:kyuubi-common,:kyuubi-ha,:kyuubi-zookeeper -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DataLakeTest' + - '-DwildcardSuites=org.apache.kyuubi.operation.tpcds.TPCDSOutputSchemaSuite,org.apache.kyuubi.operation.tpcds.TPCDSDDLSuite -Dmaven.plugin.scalatest.exclude.tags=""' env: SPARK_LOCAL_IP: localhost steps: @@ -71,12 +72,16 @@ jobs: restore-keys: | ${{ runner.os }}-maven-io- - name: Build with Maven + if: ${{ ! contains(matrix.profiles, 'wildcardSuites') }} run: mvn clean install ${{ matrix.profiles }} -Dmaven.javadoc.skip=true -V + - name: Wild Card Suites Tests + if: ${{ contains(matrix.profiles, 'wildcardSuites') }} + run: mvn clean install -DskipTests -pl :kyuubi-spark-sql-engine,:kyuubi-common,:kyuubi-ha,:kyuubi-zookeeper && mvn -Dtest=none ${{ matrix.profiles }} test - name: Code coverage if: ${{ matrix.profiles == '' }} run: bash <(curl -s https://codecov.io/bash) - name: Detected Dependency List Change - if: ${{ ! contains(matrix.profiles, 'spark-3.2-snapshot') }} + if: ${{ ! contains(matrix.profiles, 'spark-3.2-snapshot') && ! contains(matrix.profiles, 'wildcardSuites') }} run: build/dependency.sh - name: Upload test logs if: failure() diff --git a/.travis.yml b/.travis.yml index 769313d89..ff15b2833 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,29 +31,33 @@ matrix: - name: Test Kyuubi w/ Default Profile env: - PROFILE="" - - EXCLUDE_TAGS="" + - EXCLUDE_TAGS="org.apache.kyuubi.tags.ExtendedSQLTest" - name: Test Kyuubi w/ -Pspark-3.0 and Spark 3.1 binary env: - PROFILE="-Pspark-3.0 -Dspark.archive.mirror=https://archive.apache.org/dist/spark/spark-3.1.1 -Dspark.archive.name=spark-3.1.1-bin-hadoop2.7.tgz" - - EXCLUDE_TAGS="org.apache.kyuubi.tags.DataLakeTest" + - EXCLUDE_TAGS="org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DataLakeTest" - name: Test Kyuubi w/ -Pspark-3.1 env: - PROFILE="-Pspark-3.1" - - EXCLUDE_TAGS="org.apache.kyuubi.tags.DataLakeTest" + - EXCLUDE_TAGS="org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DataLakeTest" - name: Test Kyuubi w/ -Pspark-3.1 -Pspark-hadoop-3.2 env: - PROFILE="-Pspark-3.1 -Dspark-hadoop-3.2" - - EXCLUDE_TAGS="org.apache.kyuubi.tags.DataLakeTest" + - EXCLUDE_TAGS="org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DataLakeTest" - name: Test Kyuubi w/ -Pspark-3.2-snapshot w/ Spark 3.2 nightly build env: - PROFILE="-Pspark-3.2-snapshot -pl :kyuubi-spark-sql-engine,:kyuubi-common,:kyuubi-ha,:kyuubi-zookeeper" - - EXCLUDE_TAGS="org.apache.kyuubi.tags.DataLakeTest" + - EXCLUDE_TAGS="org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DataLakeTest" + - name: Test Kyuubi w/ -Pspark-3.0 TPCDS Tests + env: + - TPCDS_TESTS=true install: - mvn --version script: - - mvn clean install $PROFILE -Dmaven.plugin.scalatest.exclude.tags=$EXCLUDE_TAGS -Dmaven.javadoc.skip=true -V + - if [[ "$TPCDS_TESTS" == "true" ]]; then mvn clean install -DskipTests -pl :kyuubi-spark-sql-engine,:kyuubi-common,:kyuubi-ha,:kyuubi-zookeeper && mvn -Dtest=none -DwildcardSuites=org.apache.kyuubi.operation.tpcds.TPCDSOutputSchemaSuite,org.apache.kyuubi.operation.tpcds.TPCDSDDLSuite -Dmaven.plugin.scalatest.exclude.tags="" test; fi + - if [[ "$TPCDS_TESTS" != "true" ]]; then mvn clean install $PROFILE -Dmaven.plugin.scalatest.exclude.tags=$EXCLUDE_TAGS -Dmaven.javadoc.skip=true -V ;fi after_success: - if [[ -z $EXCLUDE_TAGS ]]; then bash <(curl -s https://codecov.io/bash); fi diff --git a/kyuubi-common/src/test/java/org/apache/kyuubi/tags/ExtendedSQLTest.java b/kyuubi-common/src/test/java/org/apache/kyuubi/tags/ExtendedSQLTest.java new file mode 100644 index 000000000..d04104203 --- /dev/null +++ b/kyuubi-common/src/test/java/org/apache/kyuubi/tags/ExtendedSQLTest.java @@ -0,0 +1,30 @@ +/* + * 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.kyuubi.tags; + +import org.scalatest.TagAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@TagAnnotation +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +public @interface ExtendedSQLTest { } diff --git a/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSDDLSuite.scala b/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSDDLSuite.scala index 918319b3d..9ec159225 100644 --- a/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSDDLSuite.scala +++ b/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSDDLSuite.scala @@ -19,7 +19,9 @@ package org.apache.kyuubi.operation.tpcds import org.apache.kyuubi.config.KyuubiConf import org.apache.kyuubi.operation.{JDBCTestUtils, WithKyuubiServer} +import org.apache.kyuubi.tags.ExtendedSQLTest +@ExtendedSQLTest class TPCDSDDLSuite extends WithKyuubiServer with JDBCTestUtils with TPCDSHelper { override protected val conf: KyuubiConf = KyuubiConf() diff --git a/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSOutputSchemaSuite.scala b/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSOutputSchemaSuite.scala index 9b928ed1a..97d62fdcf 100644 --- a/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSOutputSchemaSuite.scala +++ b/kyuubi-main/src/test/scala/org/apache/kyuubi/operation/tpcds/TPCDSOutputSchemaSuite.scala @@ -22,6 +22,7 @@ import java.nio.file.{Files, Path, Paths} import org.apache.kyuubi.config.KyuubiConf import org.apache.kyuubi.operation.{JDBCTestUtils, WithKyuubiServer} +import org.apache.kyuubi.tags.ExtendedSQLTest // scalastyle:off line.size.limit /** @@ -36,6 +37,7 @@ import org.apache.kyuubi.operation.{JDBCTestUtils, WithKyuubiServer} * }}} */ // scalastyle:on line.size.limit +@ExtendedSQLTest class TPCDSOutputSchemaSuite extends WithKyuubiServer with JDBCTestUtils with TPCDSHelper { override protected val conf: KyuubiConf = KyuubiConf() override protected def jdbcUrl: String = getJdbcUrl @@ -103,7 +105,7 @@ class TPCDSOutputSchemaSuite extends WithKyuubiServer with JDBCTestUtils with TP }.toSeq.sortBy(q => getQueryIndex(q.getFileName.toString)) validQueries.foreach { q => - test(name + "-" + q.getFileName.toString) { + test(name + "/" + q.getFileName.toString) { q.toFile.listFiles().filter(_.getName.endsWith(".sql")).foreach { qf => val schemaFile = Paths.get( baseResourcePath.toFile.getAbsolutePath, diff --git a/pom.xml b/pom.xml index 062fbf404..66a2108c2 100644 --- a/pom.xml +++ b/pom.xml @@ -95,7 +95,8 @@ 4.3.0 2.22.0 2.0.0 - + org.apache.kyuubi.tags.ExtendedSQLTest + 0.8.6 3.2.4 3.2.0 @@ -1217,6 +1218,7 @@ localhost ${maven.plugin.scalatest.exclude.tags} + ${maven.plugin.scalatest.include.tags} @@ -1498,7 +1500,7 @@ spark-3.1 3.1.1 - org.apache.kyuubi.tags.DataLakeTest + org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DataLakeTest