diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c88d610..74c9ed7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -32,17 +32,23 @@ jobs: run: | podman --version podman run --rm -it ${{matrix.jdkimage}} bash --version + podman run --rm -it ${{matrix.jdkimage}} java --version + podman run --rm -it ${{matrix.jdkimage}} cat /etc/redhat-release - name: RFaS run: | ls -l git submodule update --init --recursive --rebase --force ls -l run-folder-as-tests -# - name: Run -# run: JNI_FAIL=true RFAT_RERUNS=2 bash ./run.sh "${JAVA_HOME}" -# - name: Upload results -# if: ${{ always() }} -# uses: actions/upload-artifact@v4 -# with: -# name: "linux-jtreg-jdk${{ matrix.jdkver}}" -# path: "test.*.tar.gz" + a=$(ls run-folder-as-tests | wc -l) + echo "total $a" + test $a -gt 3 + - name: Run + run: | + CQA_FAIL=false BLACKLIST="101.*" RFAT_RERUNS=2 bash ./run_containerqa.sh --container-image=${{matrix.jdkimage}} + - name: Upload results + if: ${{ always() }} + uses: actions/upload-artifact@v4 + with: + name: "linux-jtreg-jdk${{ matrix.jdkver}}" + path: "test.*.tar.gz" diff --git a/containersQa/testlib.bash b/containersQa/testlib.bash index 4c0d988..ade3099 100644 --- a/containersQa/testlib.bash +++ b/containersQa/testlib.bash @@ -48,7 +48,12 @@ function processArguments() { else echo "OpenJDK Container Image not found on Brew. Check that images exists." echo "Failed Image: $ARG_JDK" - exit 1 + if [ "$REMOTE_NORMAL_CONTAINER" = "true" ] ; then + echo "using directly $ARG_JDK" + FORCED_ARG_HASH="${ARG_JDK}" + else + exit 1 + fi fi if [[ -z $ARG_REPORT_DIR ]] ; then @@ -172,7 +177,11 @@ function cleanContainerQaPropertiesFile() { } function getHashFromImageId() { - HASH=`$PD_PROVIDER inspect $JDK_CONTAINER_IMAGE --format "{{.Id}}"` + if [ -z "${FORCED_ARG_HASH}" ] ; then + HASH=`$PD_PROVIDER inspect $JDK_CONTAINER_IMAGE --format "{{.Id}}"` + else + HASH="${FORCED_ARG_HASH}" + fi echo "The Image under test's ID is: $HASH" } diff --git a/run-folder-as-tests b/run-folder-as-tests index 07c4321..80b2151 160000 --- a/run-folder-as-tests +++ b/run-folder-as-tests @@ -1 +1 @@ -Subproject commit 07c4321fb3cb2308b591df2e6f5b0755bb3619c3 +Subproject commit 80b2151eec52bd84ba18744f20304f64577d5414 diff --git a/run_containerqa.sh b/run_containerqa.sh index 65cc6d6..3ea15d5 100644 --- a/run_containerqa.sh +++ b/run_containerqa.sh @@ -53,5 +53,53 @@ do esac done +if [ -z "$CONTAINER_VERSION" ] ; then + print_help >&2 +fi +if [ -n "$ARG_REPORT_DIR" ] ; then + if [ ! -e "$ARG_REPORT_DIR" ] ; then + echo "$ARG_REPORT_DIR do not exists" + exit 2 + fi +fi + echo "Ensure that the run-folder-as-tests sub-repo is properly pulled down." -echo "Ensure Podman is installed on the host under tests." \ No newline at end of file +echo "Ensure Podman is installed on the host under tests." +echo "See test.yaml file if in doubts" + + +TIME=$(date +%s) +jtWork="test.${TIME}/jdk/work" +jtReport="test.${TIME}/jdk/report" +mkdir -p $jtWork +mkdir -p $jtReport +export SCRATCH_DISK="`pwd`/$jtWork" +export WORKSPACE="`pwd`/$jtReport" +SUITE_FOLDER="containersQa" +REMOTE_NORMAL_CONTAINER=true bash ${SCRIPT_DIR}/run-folder-as-tests/run-folder-as-tests.sh ${SCRIPT_DIR}/${SUITE_FOLDER} ${CONTAINER_VERSION} | tee test.${TIME}/tests.log + +toPack="${jtReport} test.${TIME}/tests.log" +if [ "x$JNI_PACK_WORK" == "xtrue" ] ; then +toPack="$toPack ${jtWork}"; +fi +tar -czf test.${TIME}.tar.gz $toPack || echo "Packing of results tarball failed" +if ! [ -f test.${TIME}/tests.log ] ; then + echo "Missing tests.log!" 1>&2 + exit 1 +fi + +if [ -n "$ARG_REPORT_DIR" ] ; then + if [ -e "$ARG_REPORT_DIR" ] ; then + mv -v test.${TIME}.* "$ARG_REPORT_DIR" + fi +fi + +# results should be in log, if not, it means suite was not run +grep -Eqi -e '^passed' -e '^(failed|error)' -e '^Ignored' test.${TIME}/tests.log || exit 2 + +if [ "x$CQA_FAIL" == "xtrue" ] ; then + if grep -Eq -e '^Failed: [1-9]' test.${TIME}/tests.log ; then + exit 1 + fi +fi +