diff --git a/.github/workflows/End2EndTest.yml b/.github/workflows/End2EndTest.yml index 8b492a6fc..56b2aa0ce 100644 --- a/.github/workflows/End2EndTest.yml +++ b/.github/workflows/End2EndTest.yml @@ -68,21 +68,24 @@ jobs: continue-on-error: false run: mvn -DghActionsIT verify --batch-mode build-e2e-jar-test: - name: E2E JAR Test - ${{ matrix.java }}, Cloud ${{ matrix.snowflake_cloud }} + name: E2E JAR Test - Cloud ${{ matrix.snowflake_cloud }} runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - java: [ 8 ] snowflake_cloud: [ 'AWS', 'AZURE', 'GCP' ] steps: - name: Checkout Code uses: actions/checkout@v2 - - name: Install Java ${{ matrix.java }} - uses: actions/setup-java@v2 + - name: Install Java + uses: actions/setup-java@v4 with: distribution: temurin - java-version: ${{ matrix.java }} + java-version: | # Install all LTS java versions, the last mentioned one here will be the default + 21 + 17 + 11 + 8 cache: maven - name: Decrypt profile.json for Cloud ${{ matrix.snowflake_cloud }} env: diff --git a/e2e-jar-test/run_e2e_jar_test.sh b/e2e-jar-test/run_e2e_jar_test.sh index e5e9b5c55..5af5d8253 100755 --- a/e2e-jar-test/run_e2e_jar_test.sh +++ b/e2e-jar-test/run_e2e_jar_test.sh @@ -14,9 +14,9 @@ sdk_repo_dir="${maven_repo_dir}/net/snowflake/snowflake-ingest-sdk" cp profile.json e2e-jar-test/standard cp profile.json e2e-jar-test/fips -################### -# TEST SHADED JAR # -################### +echo "###################" +echo "# TEST SHADED JAR #" +echo "###################" # Remove the SDK from local maven repository rm -fr $sdk_repo_dir @@ -25,37 +25,78 @@ rm -fr $sdk_repo_dir project_version=$(./scripts/get_project_info_from_pom.py pom.xml version) ./scripts/update_project_version.py public_pom.xml $project_version > generated_public_pom.xml -# Build shaded SDK +# Build shaded SDK always with Java 8 +echo "Building shaded SDK" mvn clean package -DskipTests=true --batch-mode --show-version # Install shaded SDK JARs into local maven repository mvn install:install-file -Dfile=target/snowflake-ingest-sdk.jar -DpomFile=generated_public_pom.xml -# Run e2e tests -(cd e2e-jar-test && mvn clean verify -pl standard -am) +# Run e2e tests with all supported LTS Java versions +cd e2e-jar-test -##################### -# TEST UNSHADED JAR # -##################### +echo "Testing shaded JAR with Java 8" +mvn --show-version clean verify -pl standard -am # Test with Java 8 + +echo "Testing shaded JAR with Java 11" +JAVA_HOME="${JAVA_HOME_11_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 11 + +echo "Testing shaded JAR with Java 17" +JAVA_HOME="${JAVA_HOME_17_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 17 + +echo "Testing shaded JAR with Java 21" +JAVA_HOME="${JAVA_HOME_21_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 21 +cd .. + +echo "#####################" +echo "# TEST UNSHADED JAR #" +echo "#####################" # Remove the SDK from local maven repository rm -r $sdk_repo_dir -# Install unshaded SDK into local maven repository +# Install unshaded SDK into local maven repository with Java 8 +echo "Building unshaded SDK" mvn clean install -Dnot-shadeDep -DskipTests=true --batch-mode --show-version -# Run e2e tests -(cd e2e-jar-test && mvn clean verify -pl standard -am) +# Run e2e tests with all supported LTS Java versions +cd e2e-jar-test + +echo "Testing unshaded JAR with Java 8" +mvn --show-version clean verify -pl standard -am # Test with Java 8 + +echo "Testing unshaded JAR with Java 11" +JAVA_HOME="${JAVA_HOME_11_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 11 -############# -# TEST FIPS # -############# +echo "Testing unshaded JAR with Java 17" +JAVA_HOME="${JAVA_HOME_17_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 17 +echo "Testing unshaded JAR with Java 21" +JAVA_HOME="${JAVA_HOME_21_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 21 +cd .. + +echo "##############" +echo "# TEST FIPS #" +echo "##############" # Remove the SDK from local maven repository rm -r $sdk_repo_dir -# Install unshaded SDK into local maven repository +# Install unshaded SDK into local maven repository with Java +echo "Building unshaded SDK for FIPS" mvn clean install -Dnot-shadeDep -DskipTests=true --batch-mode --show-version -# Run e2e tests on the FIPS module -(cd e2e-jar-test && mvn clean verify -pl fips -am) \ No newline at end of file +# Run e2e tests on the FIPS module with all supported LTS Java versions +cd e2e-jar-test + +echo "Testing FIPS JAR with Java 8" +mvn --show-version clean verify -pl standard -am # Test with Java 8 + +echo "Testing FIPS JAR with Java 11" +JAVA_HOME="${JAVA_HOME_11_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 11 + +echo "Testing FIPS JAR with Java 17" +JAVA_HOME="${JAVA_HOME_17_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 17 + +echo "Testing FIPS JAR with Java 21" +JAVA_HOME="${JAVA_HOME_21_X64}" mvn --show-version clean verify -pl standard -am # Test with Java 21 +cd .. diff --git a/pom.xml b/pom.xml index aed43ee3d..d8dd1d2e6 100644 --- a/pom.xml +++ b/pom.xml @@ -60,6 +60,7 @@ 9.37.3 3.1 1.13.1 + 2.0.9 UTF-8 3.19.6 net.snowflake.ingest.internal @@ -517,19 +518,19 @@ org.powermock powermock-api-mockito2 - 2.0.2 + ${powermock.version} test org.powermock powermock-core - 2.0.2 + ${powermock.version} test org.powermock powermock-module-junit4 - 2.0.2 + ${powermock.version} test @@ -556,6 +557,11 @@ + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.0 + maven-deploy-plugin @@ -596,7 +602,12 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19.1 + 3.2.5 + + + org.codehaus.mojo + exec-maven-plugin + 3.2.0 org.jacoco @@ -689,7 +700,6 @@ org.apache.maven.plugins maven-dependency-plugin - 3.3.0 analyze @@ -782,7 +792,6 @@ org.apache.maven.plugins maven-surefire-plugin - 2.19.1 **/TestSimpleIngestLocal.java @@ -917,14 +926,22 @@ - org.apache.maven.plugins maven-dependency-plugin + + + + list + + generate-resources + + runtime + ${license.processing.dependencyListFile} + + + copy-dependencies @@ -941,28 +958,6 @@ - - - org.apache.maven.plugins - maven-dependency-plugin - 3.6.0 - - runtime - ${license.processing.dependencyListFile} - - - - - list - - generate-resources - - - - org.apache.maven.plugins