Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astachowski committed Nov 22, 2024
1 parent ddf0f62 commit 5e5674d
Show file tree
Hide file tree
Showing 111 changed files with 38 additions and 142 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
JDBC_TEST_CATEGORY: ${{ matrix.category.suites }}
JDBC_TEST_SUITES: ${{ matrix.category.suites }}
ADDITIONAL_MAVEN_PROFILE: ${{ matrix.additionalMavenProfile }}
run: ci\\test_windows.bat

Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
JDBC_TEST_CATEGORY: ${{ matrix.category.suites }}
JDBC_TEST_SUITES: ${{ matrix.category.suites }}
ADDITIONAL_MAVEN_PROFILE: ${{ matrix.additionalMavenProfile }}
run: /usr/local/bin/bash ./ci/test_mac.sh

Expand All @@ -126,7 +126,7 @@ jobs:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
TARGET_DOCKER_TEST_IMAGE: ${{ matrix.image }}
JDBC_TEST_CATEGORY: ${{ matrix.category.suites }}
JDBC_TEST_SUITES: ${{ matrix.category.suites }}
ADDITIONAL_MAVEN_PROFILE: ${{ matrix.additionalMavenProfile }}
run: ./ci/test.sh

Expand All @@ -150,6 +150,6 @@ jobs:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.cloud }}
TARGET_DOCKER_TEST_IMAGE: ${{ matrix.image }}
JDBC_TEST_CATEGORY: ${{ matrix.category.suites }}
JDBC_TEST_SUITES: ${{ matrix.category.suites }}
is_old_driver: ${{ matrix.is_old_driver }}
run: ./ci/test.sh
4 changes: 2 additions & 2 deletions FIPS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
<version>${version.plugin.failsafe}</version>
Expand Down Expand Up @@ -750,7 +750,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
<version>${version.plugin.failsafe}</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.junit.jupiter.api.Test;


//@Category(TestCategoryFips.class)
@Tag("fips")
public class ConnectionFipsIT extends AbstractDriverIT {
private static final String JCE_PROVIDER_BOUNCY_CASTLE_FIPS = "BCFIPS";
Expand Down
9 changes: 5 additions & 4 deletions TestOnly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<jacoco.skip.instrument>true</jacoco.skip.instrument>
<jna.version>5.13.0</jna.version>
<junit.version>5.11.1</junit.version>
<surefire.version>3.5.1</surefire.version>
<mockito.version>3.5.6</mockito.version>
<shadeBase>net.snowflake.client.jdbc.internal</shadeBase>
</properties>
Expand Down Expand Up @@ -423,10 +424,10 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${surefire.version}</version>
</dependency>
</dependencies>
<version>3.5.1</version>
<version>${surefire.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -435,10 +436,10 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${surefire.version}</version>
</dependency>
</dependencies>
<version>3.5.1</version>
<version>${surefire.version}</version>
</plugin>
</plugins>
</build>
Expand Down
8 changes: 4 additions & 4 deletions ci/container/test_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ if [[ "$is_old_driver" == "true" ]]; then
$MVNW_EXE -DjenkinsIT \
-Djava.io.tmpdir=$WORKSPACE \
-Djacoco.skip.instrument=false \
-DintegrationTestSuites="$JDBC_TEST_CATEGORY" \
-DintegrationTestSuites="$JDBC_TEST_SUITES" \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
verify \
--batch-mode --show-version
popd >& /dev/null
elif [[ "$JDBC_TEST_CATEGORY" == "FipsTestSuite" ]]; then
elif [[ "$JDBC_TEST_SUITES" == "FipsTestSuite" ]]; then
pushd FIPS >& /dev/null
echo "[INFO] Run Fips tests"
$MVNW_EXE -DjenkinsIT \
Expand All @@ -101,11 +101,11 @@ elif [[ "$JDBC_TEST_CATEGORY" == "FipsTestSuite" ]]; then
--batch-mode --show-version
popd >& /dev/null
else
echo "[INFO] Run $JDBC_TEST_CATEGORY tests"
echo "[INFO] Run $JDBC_TEST_SUITES tests"
$MVNW_EXE -DjenkinsIT \
-Djava.io.tmpdir=$WORKSPACE \
-Djacoco.skip.instrument=false \
-DintegrationTestSuites="$JDBC_TEST_CATEGORY" \
-DintegrationTestSuites="$JDBC_TEST_SUITES" \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dnot-self-contained-jar $ADDITIONAL_MAVEN_PROFILE \
verify \
Expand Down
6 changes: 3 additions & 3 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ else
exit 2
fi

if [[ -z "$JDBC_TEST_CATEGORY" ]]; then
echo "[ERROR] Set JDBC_TEST_CATEGORY to the JDBC test category."
if [[ -z "$JDBC_TEST_SUITES" ]]; then
echo "[ERROR] Set JDBC_TEST_SUITES to the JDBC test category."
find $THIS_DIR/../src/test/java -type f -exec grep -E "^import net.snowflake.client.category" {} \; | sort | uniq | awk -F. '{print $NF}' | awk -F\; '{print $1}'
exit 2
fi
Expand All @@ -56,7 +56,7 @@ for name in "${!TARGET_TEST_IMAGES[@]}"; do
-e RUNNER_TRACKING_ID \
-e JOB_NAME \
-e BUILD_NUMBER \
-e JDBC_TEST_CATEGORY \
-e JDBC_TEST_SUITES \
-e ADDITIONAL_MAVEN_PROFILE \
-e CLOUD_PROVIDER \
-e is_old_driver \
Expand Down
6 changes: 3 additions & 3 deletions ci/test_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ echo "MAVEN OPTIONS %MAVEN_OPTS%"
REM Avoid connection timeout on plugin dependency fetch or fail-fast when dependency cannot be fetched
cmd /c %MVNW_EXE% --batch-mode --show-version dependency:go-offline

if "%JDBC_TEST_CATEGORY%"=="FipsTestSuite" (
if "%JDBC_TEST_SUITES%"=="FipsTestSuite" (
pushd FIPS
echo "[INFO] Run Fips tests"
cmd /c %MVNW_EXE% -B -DjenkinsIT ^
Expand All @@ -133,11 +133,11 @@ if "%JDBC_TEST_CATEGORY%"=="FipsTestSuite" (
)
popd
) else (
echo "[INFO] Run %JDBC_TEST_CATEGORY% tests"
echo "[INFO] Run %JDBC_TEST_SUITES% tests"
cmd /c %MVNW_EXE% -B -DjenkinsIT ^
-Djava.io.tmpdir=%GITHUB_WORKSPACE% ^
-Djacoco.skip.instrument=false ^
-DintegrationTestSuites="%JDBC_TEST_CATEGORY%" ^
-DintegrationTestSuites="%JDBC_TEST_SUITES%" ^
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn ^
-Dnot-self-contained-jar %ADDITIONAL_MAVEN_PROFILE% ^
verify ^
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
</plugin>
Expand Down Expand Up @@ -157,7 +157,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
</plugin>
Expand Down Expand Up @@ -1185,7 +1185,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
<executions>
Expand Down Expand Up @@ -1343,7 +1343,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
<executions>
Expand Down Expand Up @@ -1395,7 +1395,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
<executions>
Expand Down Expand Up @@ -1441,7 +1441,7 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>3.5.1</version>
<version>${version.plugin.surefire}</version>
</dependency>
</dependencies>
<executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
@Retention(RetentionPolicy.RUNTIME)
@EnabledIfEnvironmentVariable(named = "SNOWFLAKE_TEST_ACCOUNT", matches = "testaccount")
@DisabledIfEnvironmentVariable(named = "GITHUB_ACTIONS", matches = ".*")
public @interface RunOnTestaccount {}
public @interface RunOnTestaccountNotOnGithubActions {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

// @Category(TestCategoryCore.class)
@Tag(TestTags.CORE)
public class IncidentUtilLatestIT extends BaseJDBCTest {
@TempDir private File tmpFolder;
Expand Down Expand Up @@ -50,8 +49,8 @@ public void testDumpVmMetrics() throws IOException {
EventUtil.getDumpPathPrefix() + "/" + INC_DUMP_FILE_NAME + incidentId + INC_DUMP_FILE_EXT;

// Read back the file contents
try (FileInputStream fis = new FileInputStream(targetVMFileLocation)) {
GZIPInputStream gzip = new GZIPInputStream(fis);
try (FileInputStream fis = new FileInputStream(targetVMFileLocation);
GZIPInputStream gzip = new GZIPInputStream(fis)) {
StringWriter sWriter = new StringWriter();
IOUtils.copy(gzip, sWriter, "UTF-8");
String output = sWriter.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext context) th
}
}

// @Parameterized.Parameters(
// name = "For host {0} cache server fetch url should be {1} and retry url {2}")

@ParameterizedTest(name = "For host {0} cache server fetch url should be {1} and retry url {2}")
@ArgumentsSource(URLProvider.class)
public void shouldChooseOcspCacheServerUrls(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

// @Category(TestCategoryArrow.class)
@Tag(TestTags.ARROW)
public class SFArrowResultSetIT extends BaseJDBCWithSharedConnectionIT {
private Random random = new Random();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.junit.jupiter.params.provider.ArgumentsProvider;
import org.junit.jupiter.params.provider.ArgumentsSource;

// @Category(TestCategoryCore.class)
@Tag(TestTags.CORE)
public class SFTrustManagerIT extends BaseJDBCTest {
private static final SFLogger logger = SFLoggerFactory.getLogger(SFTrustManagerIT.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.junit.jupiter.api.io.TempDir;
import org.mockito.MockedStatic;

// @Category(TestCategoryCore.class)
@Tag(TestTags.CORE)
public class SFTrustManagerMockitoMockLatestIT {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.mockito.MockedStatic.Verification;
import org.mockito.Mockito;

// @Category(TestCategoryCore.class)
@Tag(TestTags.CORE)
public class SessionUtilLatestIT extends BaseJDBCTest {

Expand Down
1 change: 0 additions & 1 deletion src/test/java/net/snowflake/client/core/StmtUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.mockito.MockedStatic.Verification;
import org.mockito.Mockito;

// @Category(TestCategoryCore.class)
@Tag(TestTags.CORE)
public class StmtUtilTest extends BaseJDBCTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static net.snowflake.client.jdbc.SnowflakeUtil.systemGetProperty;
import static org.awaitility.Awaitility.await;
import static org.junit.jupiter.api.Assertions.assertEquals;
// import static org.junit.jupiter.api.Assumptions.assumeNoException;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

// @Category(TestCategoryOthers.class)
@Tag(TestTags.OTHERS)
public class BindUploaderIT extends BaseJDBCTest {
BindUploader bindUploader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* tests still is not applicable. If it is applicable, move tests to BindUploaderIT so that both the
* latest and oldest supported driver run the tests.
*/
// @Category(TestCategoryOthers.class)
@Tag(TestTags.OTHERS)
public class BindUploaderLatestIT extends BaseJDBCTest {
BindUploader bindUploader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;

// @Category(TestCategoryResultSet.class)
@Tag(TestTags.RESULT_SET)
public class BindingAndInsertingStructuredTypesLatestIT extends BaseJDBCTest {
public Connection init(ResultSetFormatType queryResultFormat) throws SQLException {
Expand Down
1 change: 0 additions & 1 deletion src/test/java/net/snowflake/client/jdbc/BindingDataIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.junit.jupiter.params.provider.ValueSource;

/** Integration tests for binding variable */
// @Category(TestCategoryOthers.class)
@Tag(TestTags.OTHERS)
public class BindingDataIT extends BaseJDBCWithSharedConnectionIT {
static TimeZone timeZone;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* to examine if the tests still are not applicable. If it is applicable, move tests to
* BindingDataIT so that both the latest and oldest supported driver run the tests.
*/
// @Category(TestCategoryOthers.class)
@Tag(TestTags.OTHERS)
public class BindingDataLatestIT extends AbstractDriverIT {
TimeZone origTz = TimeZone.getDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;

// @Category(TestCategoryStatement.class)
@Tag(TestTags.STATEMENT)
public class CallableStatementIT extends CallableStatementITBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;

// @Category(TestCategoryStatement.class)
@Tag(TestTags.STATEMENT)
public class CallableStatementLatestIT extends CallableStatementITBase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

// @Category(TestCategoryOthers.class)
@Tag(TestTags.OTHERS)
public class ChunkDownloaderS3RetryUrlLatestIT extends AbstractDriverIT {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
/**
* @author azhan attempts to test the CLIENT_MEMORY_LIMIT working in multi-threading
*/
// @Category(TestCategoryOthers.class)
@Tag(TestTags.OTHERS)
public class ClientMemoryLimitParallelIT extends BaseJDBCWithSharedConnectionIT {
private static Logger LOGGER =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

// @Category(TestCategoryConnection.class)
@Tag(TestTags.CONNECTION)
public class ConnectionAlreadyClosedIT extends BaseJDBCTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;

// @Category(TestCategoryConnection.class)
@Tag(TestTags.CONNECTION)
public class ConnectionFeatureNotSupportedIT extends BaseJDBCTest {
@Test
Expand Down
Loading

0 comments on commit 5e5674d

Please sign in to comment.