Skip to content

Commit

Permalink
Added a check for the test
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar van Leeuwen committed Feb 2, 2024
1 parent d5fb876 commit c6a09ab
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions bot/check-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,33 @@ job_dir=${PWD}
job_out="slurm-${SLURM_JOB_ID}.out"
job_test_result_file="_bot_job${SLURM_JOB_ID}.test"

# ReFrame prints e.g.
#[----------] start processing checks
#[ RUN ] GROMACS_EESSI %benchmark_info=HECBioSim/Crambin %nb_impl=cpu %scale=2_nodes %module_name=GROMACS/2021.3-foss-2021a /d597cff4 @snellius:rome+default
#[ RUN ] GROMACS_EESSI %benchmark_info=HECBioSim/Crambin %nb_impl=cpu %scale=2_nodes %module_name=GROMACS/2021.3-foss-2021a /d597cff4 @snellius:genoa+default
#[ RUN ] GROMACS_EESSI %benchmark_info=HECBioSim/Crambin %nb_impl=cpu %scale=1_cpn_2_nodes %module_name=GROMACS/2021.3-foss-2021a /f4194106 @snellius:genoa+default
#[ FAIL ] (1/3) GROMACS_EESSI %benchmark_info=HECBioSim/Crambin %nb_impl=cpu %scale=2_nodes %module_name=GROMACS/2021.3-foss-2021a /d597cff4 @snellius:genoa+default
#==> test failed during 'sanity': test staged in '/scratch-shared/casparl/reframe_output/staging/snellius/genoa/default/GROMACS_EESSI_d597cff4'
#[ OK ] (2/3) GROMACS_EESSI %benchmark_info=HECBioSim/Crambin %nb_impl=cpu %scale=2_nodes %module_name=GROMACS/2021.3-foss-2021a /d597cff4 @snellius:rome+default
#P: perf: 8.441 ns/day (r:0, l:None, u:None)
#[ FAIL ] (3/3) GROMACS_EESSI %benchmark_info=HECBioSim/Crambin %nb_impl=cpu %scale=1_cpn_2_nodes %module_name=GROMACS/2021.3-foss-2021a /f4194106 @snellius:genoa+default
#==> test failed during 'sanity': test staged in '/scratch-shared/casparl/reframe_output/staging/snellius/genoa/default/GROMACS_EESSI_f4194106'
#[----------] all spawned checks have finished
#[ FAILED ] Ran 3/3 test case(s) from 2 check(s) (2 failure(s), 0 skipped, 0 aborted)

# We will grep for the last and final line, since this reflects the overall result
error_pattern="\[\s+FAILED\s+\]"
grep_out=$(grep "${error_pattern}" ${job_dir}/${job_out})
[[ $? -eq 0 ]] && ERROR=1 || ERROR=0

# Write the result to the job_test_result_file
echo "[TEST]" > ${job_test_result_file}
echo "comment_description = <em>(no tests yet)</em>" >> ${job_test_result_file}
echo "status = SUCCESS" >> ${job_test_result_file}
if [[ ${ERROR} -eq 1 ]]; then
echo "comment_description = Test suite failed: ${grep_out}" >> ${job_test_result_file}
echo "status = :cry: FAILURE" >> ${job_test_result_file}
else
echo "comment_description = <em>(no tests yet)</em>" >> ${job_test_result_file}
echo "status = SUCCESS" >> ${job_test_result_file}
fi

exit 0

0 comments on commit c6a09ab

Please sign in to comment.