Skip to content

Commit

Permalink
Add test groups
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pbulawa committed Oct 1, 2024
1 parent 7bc72ca commit e5e99f8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 13 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ jobs:

test-windows:
needs: build
name: ${{ matrix.runConfig.cloud }} Windows java ${{ matrix.runConfig.javaVersion }}
name: ${{ matrix.runConfig.cloud }} Windows java ${{ matrix.runConfig.javaVersion }} tests ${{ matrix.runConfig.testGroups }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
runConfig: [ {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'} ]
runConfig: [
{ cloud: 'GCP', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AWS', javaVersion: '21', testGroups: 'UNIT,STANDARD,HYBRID' }
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -62,16 +66,21 @@ jobs:
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
TEST_GROUPS: ${{ matrix.runConfig.testGroups }}
run: ci\\test_windows.bat

test-mac:
needs: build
name: ${{ matrix.runConfig.cloud }} Mac java ${{ matrix.runConfig.javaVersion }}
name: ${{ matrix.runConfig.cloud }} Mac java ${{ matrix.runConfig.javaVersion }} tests ${{ matrix.runConfig.testGroups }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
runConfig: [ {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'} ]
runConfig: [
{ cloud: 'GCP', javaVersion: '11', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AZURE', javaVersion: '17', testGroups: 'UNIT,STANDARD' },
{ cloud: 'AWS', javaVersion: '21', testGroups: 'UNIT,STANDARD,HYBRID' }
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -90,16 +99,21 @@ jobs:
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
run: /usr/local/bin/bash ./ci/test.sh
TEST_GROUPS: ${{ matrix.runConfig.testGroups }}
run: bash ./ci/test.sh

test-linux:
needs: build
name: ${{ matrix.runConfig.cloud }} Linux java ${{ matrix.runConfig.javaVersion }}
name: ${{ matrix.runConfig.cloud }} Linux java ${{ matrix.runConfig.javaVersion }} tests ${{ matrix.runConfig.testGroups }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
runConfig: [ { cloud: 'GCP', javaVersion: '11' }, { cloud: 'AZURE', javaVersion: '17' }, { cloud: 'AWS', javaVersion: '21' } ]
runConfig: [
{ cloud: 'GCP', javaVersion: '11', testGroups: 'UNIT,STANDARD'},
{cloud: 'AZURE', javaVersion: '17', testGroups: 'UNIT,STANDARD'},
{cloud: 'AWS', javaVersion: '21', testGroups: 'UNIT,STANDARD,HYBRID'}
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -115,4 +129,5 @@ jobs:
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
CLOUD_PROVIDER: ${{ matrix.runConfig.cloud }}
TEST_GROUPS: ${{ matrix.runConfig.testGroups }}
run: ./ci/test.sh
Binary file modified .github/workflows/parameters_azure.json.gpg
Binary file not shown.
2 changes: 1 addition & 1 deletion ci/container/build_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ HIBERNATE_ROOT=$(cd "${THIS_DIR}/../../" && pwd)

cd "$HIBERNATE_ROOT"
rm -f lib/*.jar
mvn clean install --batch-mode --show-version -DskipTests
mvn clean install --batch-mode --show-version -DtestGroups=UNIT
1 change: 1 addition & 0 deletions ci/container/test_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ $MVNW_EXE -Djava.io.tmpdir="$WORKSPACE" \
-Djacoco.skip.instrument=false \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
verify \
-DtestGroups="$TEST_GROUPS" \
--batch-mode --show-version
2 changes: 1 addition & 1 deletion ci/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Test Hibernate for Mac
# Test Hibernate for Linux/Mac
#

set -o pipefail
Expand Down
6 changes: 2 additions & 4 deletions ci/test_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ echo "[INFO] CLIENT_KNOWN_SSM_FILE_PATH=%CLIENT_KNOWN_SSM_FILE_PATH%"
REM To close log analyze, just set ENABLE_CLIENT_LOG_ANALYZE to not "true", e.g. "false".
set ENABLE_CLIENT_LOG_ANALYZE=true

REM The new complex password we use for jenkins test
set SNOWFLAKE_TEST_PASSWORD_NEW="ThisIsRandomPassword123!"

set LOG_PROPERTY_FILE=%GITHUB_WORKSPACE%\src\test\resources\logging.properties

echo "[INFO] LOG_PROPERTY_FILE=%LOG_PROPERTY_FILE%"
Expand Down Expand Up @@ -98,11 +95,12 @@ 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

echo "[INFO] Run Hibernate tests"
echo [INFO] Run Hibernate tests
cmd /c %MVNW_EXE% -B -Djava.io.tmpdir=%GITHUB_WORKSPACE% ^
-Djacoco.skip.instrument=false ^
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn ^
verify ^
-DtestGroups=%TEST_GROUPS% ^
--batch-mode --show-version > log.txt & type log.txt
echo "[INFO] Check for test execution status"
find /i /c "BUILD FAILURE" log.txt > NUL
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<groups>${testGroups}</groups>
<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-opens=java.base/sun.util.calendar=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>
<groups>${testGroups}</groups>
<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-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED</argLine>
</configuration>
</plugin>
Expand Down

0 comments on commit e5e99f8

Please sign in to comment.