Skip to content

Commit

Permalink
Enable skip of finished tests
Browse files Browse the repository at this point in the history
  • Loading branch information
judovana committed Dec 9, 2024
1 parent 22dd1d4 commit eceae01
Showing 1 changed file with 44 additions and 18 deletions.
62 changes: 44 additions & 18 deletions external/run_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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 "<testCaseName>") ; do
Expand Down

0 comments on commit eceae01

Please sign in to comment.