Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

13 changes: 11 additions & 2 deletions containersQa/testlib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
}

Expand Down
2 changes: 1 addition & 1 deletion run-folder-as-tests
50 changes: 49 additions & 1 deletion run_containerqa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
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