diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 01cf75b54..f5f27de55 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -129,7 +129,7 @@ jobs: matrix: image: [ 'jdbc-centos7-openjdk8' ] cloud: [ 'AWS' ] - category: ['OthersTestSuite', 'ConnectionTestSuite,StatementTestSuite', 'CoreTestSuite,LoaderTestSuite,ResultSetTestSuite'] + category: ['OthersOldDriverTestSuite', 'ConnectionOldDriverTestSuite,StatementOldDriverTestSuite', 'CoreOldDriverTestSuite,LoaderOldDriverTestSuite,ResultSetOldDriverTestSuite'] is_old_driver: ['true'] steps: - uses: actions/checkout@v1 diff --git a/TestOnly/pom.xml b/TestOnly/pom.xml index f20916ac9..4a418d603 100644 --- a/TestOnly/pom.xml +++ b/TestOnly/pom.xml @@ -58,6 +58,42 @@ ${junit.version} test + + org.junit.platform + junit-platform-suite + 1.11.1 + test + + + org.junit.platform + junit-platform-engine + 1.11.1 + test + + + org.junit.platform + junit-platform-runner + 1.11.1 + test + + + org.junit.platform + junit-platform-suite-api + 1.11.1 + test + + + org.junit.platform + junit-platform-suite-engine + 1.11.1 + test + + + org.junit.platform + junit-platform-launcher + 1.11.1 + test + org.hamcrest hamcrest diff --git a/ci/container/test_component.sh b/ci/container/test_component.sh index cb5e95899..e1e42c3f3 100755 --- a/ci/container/test_component.sh +++ b/ci/container/test_component.sh @@ -83,7 +83,7 @@ if [[ "$is_old_driver" == "true" ]]; then $MVNW_EXE -DjenkinsIT \ -Djava.io.tmpdir=$WORKSPACE \ -Djacoco.skip.instrument=false \ - -Dtest=UnitTestSuite,"$JDBC_TEST_CATEGORY" \ + -Dtest=UnitOldDriverTestSuite,"$JDBC_TEST_CATEGORY" \ -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \ verify \ --batch-mode --show-version diff --git a/src/test/java/net/snowflake/client/providers/SimpleFormatProvider.java b/src/test/java/net/snowflake/client/providers/SimpleFormatProvider.java index 3fe7adbea..a7dd46b45 100644 --- a/src/test/java/net/snowflake/client/providers/SimpleFormatProvider.java +++ b/src/test/java/net/snowflake/client/providers/SimpleFormatProvider.java @@ -6,8 +6,19 @@ import org.junit.jupiter.params.provider.Arguments; public class SimpleFormatProvider extends SnowflakeArgumentsProvider { + private static List arguments = + Arrays.asList(Arguments.of("JSON"), Arguments.of("ARROW")); + + public static void setSupportedFormats(List supportedFormats) { + arguments = supportedFormats; + } + + public static void resetSupportedFormats() { + setSupportedFormats(Arrays.asList(Arguments.of("JSON"), Arguments.of("ARROW"))); + } + @Override protected List rawArguments(ExtensionContext context) { - return Arrays.asList(Arguments.of("JSON"), Arguments.of("ARROW")); + return arguments; } } diff --git a/src/test/java/net/snowflake/client/suites/ConnectionOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/ConnectionOldDriverTestSuite.java new file mode 100644 index 000000000..29f54eb95 --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/ConnectionOldDriverTestSuite.java @@ -0,0 +1,8 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.IncludeTags; + +@IncludeTags(TestTags.CONNECTION) +public class ConnectionOldDriverTestSuite extends OldDriverTestSuite { +} diff --git a/src/test/java/net/snowflake/client/suites/CoreOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/CoreOldDriverTestSuite.java new file mode 100644 index 000000000..dfcb4bd67 --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/CoreOldDriverTestSuite.java @@ -0,0 +1,7 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.IncludeTags; + +@IncludeTags(TestTags.CORE) +public class CoreOldDriverTestSuite extends OldDriverTestSuite {} diff --git a/src/test/java/net/snowflake/client/suites/DiagnosticOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/DiagnosticOldDriverTestSuite.java new file mode 100644 index 000000000..a38f6616d --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/DiagnosticOldDriverTestSuite.java @@ -0,0 +1,8 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.IncludeTags; + +@IncludeTags(TestTags.DIAGNOSTIC) +public class DiagnosticOldDriverTestSuite extends OldDriverTestSuite{ +} diff --git a/src/test/java/net/snowflake/client/suites/LoaderOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/LoaderOldDriverTestSuite.java new file mode 100644 index 000000000..41eb2996e --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/LoaderOldDriverTestSuite.java @@ -0,0 +1,8 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.IncludeTags; + +@IncludeTags(TestTags.LOADER) +public class LoaderOldDriverTestSuite extends OldDriverTestSuite{ +} diff --git a/src/test/java/net/snowflake/client/suites/OldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/OldDriverTestSuite.java new file mode 100644 index 000000000..466a6f36f --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/OldDriverTestSuite.java @@ -0,0 +1,20 @@ +package net.snowflake.client.suites; + +import java.util.Arrays; +import net.snowflake.client.providers.SimpleFormatProvider; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.platform.suite.api.AfterSuite; +import org.junit.platform.suite.api.BeforeSuite; + +@BaseTestSuite +public abstract class OldDriverTestSuite { + @BeforeSuite + public static void beforeAll() { + SimpleFormatProvider.setSupportedFormats(Arrays.asList(Arguments.of("JSON"))); + } + + @AfterSuite + public static void afterAll() { + SimpleFormatProvider.resetSupportedFormats(); + } +} diff --git a/src/test/java/net/snowflake/client/suites/OthersOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/OthersOldDriverTestSuite.java new file mode 100644 index 000000000..89eec0feb --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/OthersOldDriverTestSuite.java @@ -0,0 +1,8 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.IncludeTags; + +@IncludeTags(TestTags.OTHERS) +public class OthersOldDriverTestSuite extends OldDriverTestSuite{ +} diff --git a/src/test/java/net/snowflake/client/suites/ResultSetOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/ResultSetOldDriverTestSuite.java new file mode 100644 index 000000000..8a255a256 --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/ResultSetOldDriverTestSuite.java @@ -0,0 +1,8 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.IncludeTags; + +@IncludeTags(TestTags.RESULT_SET) +public class ResultSetOldDriverTestSuite extends OldDriverTestSuite{ +} diff --git a/src/test/java/net/snowflake/client/suites/StatementOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/StatementOldDriverTestSuite.java new file mode 100644 index 000000000..edeb76496 --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/StatementOldDriverTestSuite.java @@ -0,0 +1,8 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.IncludeTags; + +@IncludeTags(TestTags.STATEMENT) +public class StatementOldDriverTestSuite extends OldDriverTestSuite { +} diff --git a/src/test/java/net/snowflake/client/suites/UnitOldDriverTestSuite.java b/src/test/java/net/snowflake/client/suites/UnitOldDriverTestSuite.java new file mode 100644 index 000000000..2939c91ec --- /dev/null +++ b/src/test/java/net/snowflake/client/suites/UnitOldDriverTestSuite.java @@ -0,0 +1,17 @@ +package net.snowflake.client.suites; + +import net.snowflake.client.category.TestTags; +import org.junit.platform.suite.api.ExcludeTags; + +@ExcludeTags({ + TestTags.CORE, + TestTags.ARROW, + TestTags.DIAGNOSTIC, + TestTags.CONNECTION, + TestTags.LOADER, + TestTags.OTHERS, + TestTags.RESULT_SET, + TestTags.STATEMENT +}) +public class UnitOldDriverTestSuite extends OldDriverTestSuite{ +}