From 10aca5552314d6e5c9226f3c6d0107861c38c693 Mon Sep 17 00:00:00 2001 From: rmartinc Date: Mon, 14 Oct 2024 12:48:07 +0200 Subject: [PATCH] Run all maven commands inside the ubi docker container Closes #33881 Signed-off-by: rmartinc --- .github/scripts/run-fips-it.sh | 18 +++++++ .github/workflows/ci.yml | 98 +++++++++++++++------------------- 2 files changed, 62 insertions(+), 54 deletions(-) diff --git a/.github/scripts/run-fips-it.sh b/.github/scripts/run-fips-it.sh index 0d17f90b007..48c46c96944 100755 --- a/.github/scripts/run-fips-it.sh +++ b/.github/scripts/run-fips-it.sh @@ -16,5 +16,23 @@ echo "Tests: $TESTS" export JAVA_HOME=/etc/alternatives/java_sdk_21 set -o pipefail +# Build adapter distributions +./mvnw install -DskipTests -f distribution/pom.xml +if [ $? -ne 0 ]; then + exit 1 +fi + +# Build app servers +./mvnw install -DskipTests -Pbuild-app-servers -f testsuite/integration-arquillian/servers/app-server/pom.xml +if [ $? -ne 0 ]; then + exit 1 +fi + +# Prepare Quarkus distribution with BCFIPS +./mvnw install -e -pl testsuite/integration-arquillian/servers/auth-server/quarkus -Pauth-server-quarkus,auth-server-fips140-2 +if [ $? -ne 0 ]; then + exit 1 +fi + # Profile app-server-wildfly needs to be explicitly set for FIPS tests ./mvnw test -Dsurefire.rerunFailingTestsCount=$SUREFIRE_RERUN_FAILING_COUNT -nsu -B -Pauth-server-quarkus,auth-server-fips140-2,app-server-wildfly -Dcom.redhat.fips=false $STRICT_OPTIONS -Dtest=$TESTS -pl testsuite/integration-arquillian/tests/base 2>&1 | misc/log/trimmer.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cafa5a577da..c1022d05633 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -704,59 +704,49 @@ jobs: with: job-id: fips-unit-tests -# fips-integration-tests: -# name: FIPS IT -# needs: build -# runs-on: ubuntu-latest -# timeout-minutes: 45 -# strategy: -# matrix: -# mode: [non-strict, strict] -# fail-fast: false -# steps: -# - uses: actions/checkout@v4 -# -# - name: Fake fips -# run: | -# cd .github/fake_fips -# make -# sudo insmod fake_fips.ko -# -# - id: integration-test-setup -# name: Integration test setup -# uses: ./.github/actions/integration-test-setup -# with: -# jdk-version: 21 -# -# - name: Build adapter distributions -# run: ./mvnw install -DskipTests -f distribution/pom.xml -# -# - name: Build app servers -# run: ./mvnw install -DskipTests -Pbuild-app-servers -f testsuite/integration-arquillian/servers/app-server/pom.xml -# -# -# - name: Prepare Quarkus distribution with BCFIPS -# run: ./mvnw install -e -pl testsuite/integration-arquillian/servers/auth-server/quarkus -Pauth-server-quarkus,auth-server-fips140-2 -# -# - name: Run base tests -# run: docker run --rm --workdir /github/workspace -e "SUREFIRE_RERUN_FAILING_COUNT" -v "${{ github.workspace }}":"/github/workspace" -v "$HOME/.m2":"/root/.m2" registry.access.redhat.com/ubi8/ubi:latest .github/scripts/run-fips-it.sh ${{ matrix.mode }} -# -# - name: Upload JVM Heapdumps -# if: always() -# uses: ./.github/actions/upload-heapdumps -# -# - uses: ./.github/actions/upload-flaky-tests -# name: Upload flaky tests -# env: -# GH_TOKEN: ${{ github.token }} -# with: -# job-name: FIPS IT -# -# - name: Surefire reports -# if: always() -# uses: ./.github/actions/archive-surefire-reports -# with: -# job-id: fips-integration-tests-${{ matrix.mode }} + fips-integration-tests: + name: FIPS IT + needs: build + runs-on: ubuntu-latest + timeout-minutes: 45 + strategy: + matrix: + mode: [non-strict, strict] + fail-fast: false + steps: + - uses: actions/checkout@v4 + + - name: Fake fips + run: | + cd .github/fake_fips + make + sudo insmod fake_fips.ko + + - id: integration-test-setup + name: Integration test setup + uses: ./.github/actions/integration-test-setup + with: + jdk-version: 21 + + - name: Run base tests + run: docker run --rm --workdir /github/workspace -e "SUREFIRE_RERUN_FAILING_COUNT" -v "${{ github.workspace }}":"/github/workspace" -v "$HOME/.m2":"/root/.m2" registry.access.redhat.com/ubi8/ubi:latest .github/scripts/run-fips-it.sh ${{ matrix.mode }} + + - name: Upload JVM Heapdumps + if: always() + uses: ./.github/actions/upload-heapdumps + + - uses: ./.github/actions/upload-flaky-tests + name: Upload flaky tests + env: + GH_TOKEN: ${{ github.token }} + with: + job-name: FIPS IT + + - name: Surefire reports + if: always() + uses: ./.github/actions/archive-surefire-reports + with: + job-id: fips-integration-tests-${{ matrix.mode }} forms-integration-tests: name: Forms IT @@ -975,7 +965,7 @@ jobs: - store-model-tests - clustering-integration-tests - fips-unit-tests -# - fips-integration-tests + - fips-integration-tests - forms-integration-tests - webauthn-integration-tests - sssd-unit-tests