From eceae0122362bdf2d23331aad11e64eb274cdab7 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Mon, 9 Dec 2024 11:59:37 +0100 Subject: [PATCH] Enable skip of finished tests --- external/run_all.sh | 62 ++++++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/external/run_all.sh b/external/run_all.sh index c201d473c6..36e3abdf95 100644 --- a/external/run_all.sh +++ b/external/run_all.sh @@ -31,6 +31,10 @@ fi if [ -z ${SKIP_GET:-} ] ; then SKIP_GET="true" fi +if [ -z ${SKIP_FINISHED:-} ] ; then + SKIP_FINISHED="true" +fi + # warning, all functions operate with global variables @@ -77,26 +81,36 @@ function cleanUnpackedJdk() { function runExternalTest() { echo $jdkName $image $externalTest $testCase local fileName="${finalPath}/${externalTest}:${testCase}" + if [ -e "${fileName}-PASSED" ] || [ -e "${fileName}-FAILED" ] || [ -e "${fileName}-ERROR" ] ; then + if [ "${SKIP_FINISHED}" == "true" ] ; then + echo "${fileName}-PASSED/FAILED/ERROR exists and SKIP_FINISHED is ${SKIP_FINISHED}, skipping " + return + fi + fi rm -f "${fileName}" echo "cat ${fileName}* for details" - export TEST_JDK_HOME="${jdk}" - export EXTRA_DOCKER_ARGS="-v $TEST_JDK_HOME:/opt/java/openjdk" ; - export BUILD_LIST=external/${externalTest} ; - if [ "${image}" == "DEFAULT" ] ; then - unset EXTERNAL_AQA_IMAGE; - else - export EXTERNAL_AQA_IMAGE="${image}"; - fi + set -x + export TEST_JDK_HOME="${jdk}" + export EXTRA_DOCKER_ARGS="-v $TEST_JDK_HOME:/opt/java/openjdk" ; + export BUILD_LIST=external/${externalTest} ; + if [ "${image}" == "DEFAULT" ] ; then + unset EXTERNAL_AQA_IMAGE; + else + export EXTERNAL_AQA_IMAGE="${image}"; + fi + set +x pushd "${EXTERNALS_DIR}/.." > /dev/null if [ ! "${SKIP_GET:-}" == "true" ] ; then sh ./get.sh fi SKIP_GET=true cd TKG - local cresult=0 - make compile > "${fileName}" 2>&1 || cresult=$? - local rresult=0 - make "_${testCase}" >> "${fileName}" 2>&1 || rresult=$? + set -x + local cresult=0 + make compile > "${fileName}" 2>&1 || cresult=$? + local rresult=0 + make "_${testCase}" >> "${fileName}" 2>&1 || rresult=$? + set +x echo "compilation: $cresult" >> "${fileName}" echo "runtime: $rresult" >> "${fileName}" if [ $cresult -gt 0 ] ; then @@ -112,23 +126,35 @@ function runExternalTest() { popd > /dev/null } -function serupResultsDir() { - rm -rf "${RESULTS_DIR}" - mkdir "${RESULTS_DIR}" +function setupResultsDir() { + if [ "${SKIP_FINISHED}" == "true" ] ; then + if [ ! -e "${RESULTS_DIR}" ] ; then + echo "SKIP_FINISHED is ${SKIP_FINISHED}, however ${RESULTS_DIR} do not exists." + exit 1 + else + echo "Already run tests in ${RESULTS_DIR} will be skipped:" + find "${RESULTS_DIR}" -type f | sort | grep -e "-\(PASSED\|ERROR\|FAILED\)" + echo "Non finished runs in ${RESULTS_DIR} will be rerun:" + find "${RESULTS_DIR}" -type f | sort | grep -ve "-\(PASSED\|ERROR\|FAILED\)" + fi + else + rm -rf "${RESULTS_DIR}" + mkdir "${RESULTS_DIR}" + fi RESULTS_DIR="$(cd "${RESULTS_DIR}" && pwd)" } -serupResultsDir +setupResultsDir checkIncludesExcludes for jdk in $(find "${JDKS_DIR}" -maxdepth 1 | sort -V ); do if useDirIfPossible ; then continue ; fi jdkName=$(basename "${jdk}") futureJdk="itWasDir" useTarballIfPossible - mkdir "${RESULTS_DIR}/${jdkName}" + mkdir -p "${RESULTS_DIR}/${jdkName}" for image in $IMAGES ; do finalPath="${RESULTS_DIR}/${jdkName}/$image" - mkdir "${finalPath}" + mkdir -p "${finalPath}" for playlist in $(find "${EXTERNALS_DIR}" | grep playlist.xml | sort | grep -e "${TEST_INCLUDE_LIST}" | grep -ve "${TEST_EXCLUDE_LIST}" ) ; do externalTest=$(basename $(dirname "${playlist}")) for testCaseTag in $(cat $playlist | grep -e "") ; do