Skip to content

Commit

Permalink
Added old driver tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astachowski committed Nov 7, 2024
1 parent a4a5d32 commit 29a7dec
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions TestOnly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,42 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<version>1.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-engine</artifactId>
<version>1.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-runner</artifactId>
<version>1.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-api</artifactId>
<version>1.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite-engine</artifactId>
<version>1.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ci/container/test_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,19 @@
import org.junit.jupiter.params.provider.Arguments;

public class SimpleFormatProvider extends SnowflakeArgumentsProvider {
private static List<Arguments> arguments =
Arrays.asList(Arguments.of("JSON"), Arguments.of("ARROW"));

public static void setSupportedFormats(List<Arguments> supportedFormats) {
arguments = supportedFormats;
}

public static void resetSupportedFormats() {
setSupportedFormats(Arrays.asList(Arguments.of("JSON"), Arguments.of("ARROW")));
}

@Override
protected List<Arguments> rawArguments(ExtensionContext context) {
return Arrays.asList(Arguments.of("JSON"), Arguments.of("ARROW"));
return arguments;
}
}
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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 {}
Original file line number Diff line number Diff line change
@@ -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{
}
Original file line number Diff line number Diff line change
@@ -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{
}
20 changes: 20 additions & 0 deletions src/test/java/net/snowflake/client/suites/OldDriverTestSuite.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -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{
}
Original file line number Diff line number Diff line change
@@ -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{
}
Original file line number Diff line number Diff line change
@@ -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 {
}
Original file line number Diff line number Diff line change
@@ -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{
}

0 comments on commit 29a7dec

Please sign in to comment.