Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1693588 Upgrade to JUnit5 #1909

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
8956d3f
Initial upgrade
sfc-gh-astachowski Oct 4, 2024
fe34193
Formatting fix
sfc-gh-astachowski Oct 4, 2024
4788157
Formatting fix
sfc-gh-astachowski Oct 4, 2024
ed62767
Removed extra dependencies
sfc-gh-astachowski Oct 4, 2024
c219985
Changed temporary directories
sfc-gh-astachowski Oct 4, 2024
17c51ad
Add explicit dependency on junit4
sfc-gh-astachowski Oct 4, 2024
50ba1ca
Add test scope to junit4
sfc-gh-astachowski Oct 4, 2024
c6db3ef
Pom fix
sfc-gh-astachowski Oct 4, 2024
63eaf4b
Added junit5 to test only pom
sfc-gh-astachowski Oct 4, 2024
3dd6e40
Added junit5 engine and migrated Assumptions
sfc-gh-astachowski Oct 9, 2024
8a503d5
Formatting
sfc-gh-astachowski Oct 9, 2024
9d71987
Attempt to fix dependencies
sfc-gh-astachowski Oct 10, 2024
84a8c34
Attempt to fix dependencies
sfc-gh-astachowski Oct 10, 2024
4c72889
Removed junit4 entirely
sfc-gh-astachowski Oct 11, 2024
af01a07
Formatting
sfc-gh-astachowski Oct 11, 2024
7461ef5
Fixed FIPS folder
sfc-gh-astachowski Oct 11, 2024
f5d91f4
Further fixes to FIPS
sfc-gh-astachowski Oct 11, 2024
8dbb729
Fixed package names
sfc-gh-astachowski Oct 11, 2024
5e7a55e
Changed to static imports
sfc-gh-astachowski Oct 11, 2024
62864ef
Changed categories to tags
sfc-gh-astachowski Oct 11, 2024
1a1b111
Formatting
sfc-gh-astachowski Oct 11, 2024
b8add67
Added test suites (expected to fail on old driver at the moment)
sfc-gh-astachowski Oct 25, 2024
39d8383
Fips fix
sfc-gh-astachowski Oct 25, 2024
158dc3b
Added dependencies for local testing
sfc-gh-astachowski Oct 29, 2024
d210c0e
Merge branch 'master' into SNOW-1693588-upgrade-to-junit5
sfc-gh-astachowski Oct 29, 2024
b18e508
Merge with master
sfc-gh-astachowski Oct 29, 2024
c418979
Formatting
sfc-gh-astachowski Oct 29, 2024
bf3b1d0
Added explicit junit4 dependency
sfc-gh-astachowski Oct 29, 2024
b593608
Removed test category from pom
sfc-gh-astachowski Oct 29, 2024
68805e9
Added explicit surefire provider
sfc-gh-astachowski Oct 29, 2024
335828e
Changed prepared statement tests to parameterized
sfc-gh-astachowski Oct 31, 2024
5f578b2
Formatting
sfc-gh-astachowski Oct 31, 2024
4899819
Merge master
sfc-gh-astachowski Oct 31, 2024
31023c4
Formatting
sfc-gh-astachowski Oct 31, 2024
4a97907
Refactored result set serializable tests from inheritance to paramete…
sfc-gh-astachowski Nov 5, 2024
73ce0fd
Refactored callable statement tests to avoid running a test twice
sfc-gh-astachowski Nov 5, 2024
704f86f
Fixed assertions of array equality
sfc-gh-astachowski Nov 5, 2024
c9b15df
Changed asserting a properties value to setting and reverting it
sfc-gh-astachowski Nov 5, 2024
6295d2c
Removed a class to avoid duplicating tests with parent class, in whic…
sfc-gh-astachowski Nov 5, 2024
239f71c
Formatting
sfc-gh-astachowski Nov 5, 2024
f8156ee
Script changes
sfc-gh-astachowski Nov 5, 2024
aa592b1
Added restoring static values in Session Util Test
sfc-gh-astachowski Nov 5, 2024
cabb3af
Added restoring static values in Trust Manager Test
sfc-gh-astachowski Nov 5, 2024
b5f811c
Ignore GCP test on Github Actions
sfc-gh-astachowski Nov 6, 2024
e045c7e
Fixed testing script
sfc-gh-astachowski Nov 6, 2024
37b6d16
Fixed testing script
sfc-gh-astachowski Nov 6, 2024
4d99bf7
Added closing input streams to Arrow Result Set IT
sfc-gh-astachowski Nov 6, 2024
52252f2
Removed Result Set Arrow IT, as it's parent class has previously been…
sfc-gh-astachowski Nov 6, 2024
e9001e0
Temporarily disabled potentially problematic test
sfc-gh-astachowski Nov 6, 2024
ac43895
Formatting
sfc-gh-astachowski Nov 6, 2024
3d0a3b3
Temporarily disabled failing test
sfc-gh-astachowski Nov 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'}]
category: ['TestCategoryResultSet,TestCategoryStatement,TestCategoryLoader', 'TestCategoryOthers', 'TestCategoryArrow,TestCategoryConnection,TestCategoryCore,TestCategoryDiagnostic', 'TestCategoryFips']
category: ['ResultSetTestSuite,StatementTestSuite,LoaderTestSuite', 'OthersTestSuite', 'ArrowTestSuite,ConnectionTestSuite,CoreTestSuite,DiagnosticTestSuite', 'FipsTestSuite']
additionalMavenProfile: ['']
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
fail-fast: false
matrix:
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'}]
category: ['TestCategoryResultSet,TestCategoryStatement,TestCategoryLoader', 'TestCategoryOthers', 'TestCategoryArrow,TestCategoryConnection,TestCategoryCore,TestCategoryDiagnostic', 'TestCategoryFips']
category: ['ResultSetTestSuite,StatementTestSuite,LoaderTestSuite', 'OthersTestSuite', 'ArrowTestSuite,ConnectionTestSuite,CoreTestSuite,DiagnosticTestSuite', 'FipsTestSuite']
additionalMavenProfile: ['']
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
matrix:
image: [ 'jdbc-centos7-openjdk8', 'jdbc-centos7-openjdk11', 'jdbc-centos7-openjdk17', 'jdbc-centos7-openjdk21' ]
cloud: [ 'AWS', 'AZURE', 'GCP' ]
category: ['TestCategoryResultSet,TestCategoryStatement,TestCategoryLoader', 'TestCategoryOthers', 'TestCategoryArrow,TestCategoryConnection,TestCategoryCore,TestCategoryDiagnostic', 'TestCategoryFips']
category: ['ResultSetTestSuite,StatementTestSuite,LoaderTestSuite', 'OthersTestSuite', 'ArrowTestSuite,ConnectionTestSuite,CoreTestSuite,DiagnosticTestSuite', 'FipsTestSuite']
additionalMavenProfile: ['', '-Dthin-jar']
steps:
- uses: actions/checkout@v1
Expand All @@ -129,7 +129,7 @@ jobs:
matrix:
image: [ 'jdbc-centos7-openjdk8' ]
cloud: [ 'AWS' ]
category: ['TestCategoryOthers', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryCore,TestCategoryLoader,TestCategoryResultSet']
category: ['OthersTestSuite', 'ConnectionTestSuite,StatementTestSuite', 'CoreTestSuite,LoaderTestSuite,ResultSetTestSuite']
is_old_driver: ['true']
steps:
- uses: actions/checkout@v1
Expand Down
14 changes: 14 additions & 0 deletions FIPS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,13 @@
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
</dependency>
</dependencies>
<version>${version.plugin.failsafe}</version>
<configuration>
<argLine>
Expand Down Expand Up @@ -715,6 +722,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
</dependency>
</dependencies>
<version>${version.plugin.failsafe}</version>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
import java.util.TimeZone;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Rule;

/** Base test class with common constants, data structures and methods */
public class AbstractDriverIT {
// This is required to use ConditionalIgnore annotation.
@Rule public ConditionalIgnoreRule rule = new ConditionalIgnoreRule();

public static final String DRIVER_CLASS = "net.snowflake.client.jdbc.SnowflakeDriver";
public static final String DRIVER_CLASS_COM = "com.snowflake.client.jdbc.SnowflakeDriver";
Expand Down
125 changes: 0 additions & 125 deletions FIPS/src/test/java/net/snowflake/client/ConditionalIgnoreRule.java

This file was deleted.

12 changes: 12 additions & 0 deletions FIPS/src/test/java/net/snowflake/client/DontRunOnGCP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledIfEnvironmentVariable(named = "CLOUD_PROVIDER", matches = "(?i)GCP(?-i)")
public @interface DontRunOnGCP {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package net.snowflake.client;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@DisabledIfEnvironmentVariable(named = "GITHUB_ACTIONS", matches = ".*")
public @interface DontRunOnGithubActions {}
12 changes: 0 additions & 12 deletions FIPS/src/test/java/net/snowflake/client/RunningOnGCP.java

This file was deleted.

This file was deleted.

Empty file.
4 changes: 2 additions & 2 deletions FIPS/src/test/java/net/snowflake/client/TestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.snowflake.client.core.SFException;
import net.snowflake.client.log.SFLogger;
import net.snowflake.client.log.SFLoggerFactory;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;

public class TestUtil {
private static final SFLogger logger = SFLoggerFactory.getLogger(TestUtil.class);
Expand All @@ -22,7 +22,7 @@ public class TestUtil {
public static void assertSFException(int errorCode, TestRunInterface testCode) {
try {
testCode.run();
Assert.fail();
Assertions.fail();
} catch (SFException e) {
assertThat(e.getVendorCode(), is(errorCode));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.snowflake.client.category;

import org.junit.platform.suite.api.IncludeTags;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.junit.platform.suite.api.ExcludePackages;
import org.junit.platform.suite.api.IncludeClassNamePatterns;
import org.junit.platform.suite.api.SelectPackages;
import org.junit.platform.suite.api.Suite;
import org.junit.platform.suite.api.SuiteDisplayName;

@Suite
@SuiteDisplayName("Testowanie")
@SelectPackages("net.snowflake.client")
@ExcludePackages("net.snowflake.client.suites")
@IncludeClassNamePatterns(".+")
public class FipsTestSuite {
}

This file was deleted.

Loading
Loading