Skip to content

Commit

Permalink
SNOW-937198 Use OpenJDK 11 and 17 images in Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus committed Nov 15, 2023
1 parent 6136684 commit 35903e4
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ jobs:
name: ${{ matrix.cloud }} JDBC ${{ matrix.category }} on ${{ matrix.image }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: [ 'jdbc-centos6-default' ]
image: [ 'jdbc-centos6-default', 'jdbc-centos7-openjdk8', 'jdbc-centos7-openjdk11', 'jdbc-centos7-openjdk17' ]
cloud: [ 'AWS' ]
category: ['TestCategoryResultSet,TestCategoryOthers,TestCategoryLoader', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryArrow,TestCategoryCore', 'TestCategoryFips']
steps:
Expand All @@ -54,6 +55,7 @@ jobs:
name: Old JDBC ${{ matrix.category }} on ${{ matrix.image }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image: [ 'jdbc-centos6-default' ]
cloud: [ 'AWS' ]
Expand Down
40 changes: 40 additions & 0 deletions FIPS/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,46 @@
</plugins>
</build>
</profile>
<profile>
<id>java-9</id>
<activation>
<jdk>(9,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
--add-exports=java.base/sun.security.internal.spec=ALL-UNNAMED
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
--add-exports=java.base/sun.security.internal.spec=ALL-UNNAMED
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jenkinsIT</id>
<activation>
Expand Down
6 changes: 3 additions & 3 deletions ci/image/Dockerfile.jdbc-centos7-openjdk-test
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ FROM jdbc-centos7-openjdk-base AS jdbc-centos7-openjdk-yum
# Java
RUN yum -y install $JDK_PACKAGE

RUN echo export JAVA_HOME=$(dirname $(dirname $(readlink $(readlink $(which javac))))) >> /home/user/.bashrc
RUN sed -i /usr/local/bin/entrypoint.sh -e '/^exec/i export JAVA_HOME='$(dirname $(dirname $(readlink $(readlink $(which javac)))))

RUN cd /root && \
mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
Expand All @@ -79,8 +79,8 @@ FROM jdbc-centos7-openjdk-base AS jdbc-centos7-openjdk17
RUN curl -o - https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz | tar xfz - -C /opt && \
ln -s /opt/jdk-17.0.2 /opt/jdk-17

RUN echo export JAVA_HOME=/opt/jdk-17 >> /home/user/.bashrc
RUN echo export PATH=\$JAVA_HOME/bin:\$PATH >> /home/user/.bashrc
RUN sed -i /usr/local/bin/entrypoint.sh -e '/^exec/i export JAVA_HOME=/opt/jdk-17'
RUN sed -i /usr/local/bin/entrypoint.sh -e '/^exec/i export PATH=$JAVA_HOME/bin:$PATH'

RUN export JAVA_HOME=/opt/jdk-17 && \
cd /root && \
Expand Down
3 changes: 0 additions & 3 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
#
# Test JDBC
#

echo JAVA_HOME=$JAVA_HOME

set -o pipefail
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
JDBC_ROOT="$(cd "${THIS_DIR}/.." && pwd)"
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<jacoco.skip.instrument>true</jacoco.skip.instrument>
<jna.version>5.13.0</jna.version>
<jsoup.version>1.15.3</jsoup.version>
<mockito.version>3.5.6</mockito.version>
<mockito.version>4.11.0</mockito.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<relocationBase>net/snowflake/client/jdbc/internal</relocationBase>
Expand Down Expand Up @@ -502,7 +502,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.5.6</version>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -1396,13 +1396,13 @@
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>--add-opens=java.base/java.nio=ALL-UNNAMED</argLine>
<argLine>--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>--add-opens=java.base/java.nio=ALL-UNNAMED</argLine>
<argLine>--add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -1732,4 +1732,4 @@
</build>
</profile>
</profiles>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void testForwardedHeaders() throws Throwable {
// After login, the only invocation to http should have been with the new
// headers.
// No calls should have happened without additional headers.
mockedHttpUtil.verify(times(1), httpCalledWithHeaders);
mockedHttpUtil.verify(httpCalledWithHeaders, times(1));
}
}

Expand Down Expand Up @@ -226,7 +226,7 @@ public void testForwardInflightCtx() throws Throwable {
// After login, the only invocation to http should have been with the new
// headers.
// No calls should have happened without additional headers.
mockedHttpUtil.verify(times(1), httpCalledWithHeaders);
mockedHttpUtil.verify(httpCalledWithHeaders, times(1));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/net/snowflake/client/core/StmtUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void testForwardedHeaders() throws Throwable {
// After login, the only invocation to http should have been with the new
// headers.
// No calls should have happened without additional headers.
mockedHttpUtil.verify(times(1), httpCalledWithHeaders);
mockedHttpUtil.verify(httpCalledWithHeaders, times(1));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.snowflake.client.core.SFTrustManager;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

Expand Down Expand Up @@ -392,6 +393,8 @@ public void testOCSPResponder403FailClosed() {

/** Test Certificate Expired. Will fail in both FAIL_OPEN and FAIL_CLOSED. */
@Test
@Ignore("Issuer of root CA expired")
// https://support.sectigo.com/articles/Knowledge/Sectigo-AddTrust-External-CA-Root-Expiring-May-30-2020
public void testExpiredCert() {
try {
DriverManager.getConnection(
Expand Down

0 comments on commit 35903e4

Please sign in to comment.