Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TESTING bot PR254 with EESSI/SWL PR467 (Run test suite based on pr366) #69

Open
wants to merge 166 commits into
base: 2023.06-software.eessi.io
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
6cc2e3e
first version of bot/test.sh script
truib Oct 14, 2023
9a32dc6
scripts to run tests after a build job has finished
truib Oct 15, 2023
17cfd02
small adjustments to test script
truib Oct 15, 2023
0f3646e
Second attempt at having the bot run the test suite, now based on Tho…
Feb 5, 2024
e8c91eb
Merge upstream into old feature branch based on pr366
Feb 5, 2024
34fca15
Make a very simple change to an easystack file so we are able to trig…
Feb 5, 2024
3faae9d
Make scripts executable
Feb 6, 2024
081e2b1
Check for existence of SLURM output first
Feb 6, 2024
9b6fa73
Clarify return messages from the bot
Feb 6, 2024
cb48b36
Use EESSI_SOFTWARE_PATH instead of EASYBUILD_INSTALLPATH to set the m…
Feb 6, 2024
d1a0219
Do git clone in a seperate script, so that that can be run in the pre…
Feb 6, 2024
86d5d3d
Should use the one from current dir
Feb 6, 2024
7861aec
Remove quotes, see if that helps
Feb 6, 2024
a7b5ee1
Apparently, we need to remove curly braces too
Feb 6, 2024
f50e463
Make sure this actually gets reported as failure, as the ReFrame runt…
Feb 6, 2024
f67df9b
Fix the actual issue: make sure that two arguments are interpreted se…
Feb 6, 2024
3394851
See if we can make check-test formatting more fancy
Feb 6, 2024
8e5682a
Replace the env var for the result file
Feb 6, 2024
6cf0cf9
Add missing functions
Feb 6, 2024
7fe24e1
Remove artefacts from reporting
Feb 6, 2024
afc309a
Add a reason for the failure
Feb 6, 2024
b84e487
Fixed missing bracket
Feb 6, 2024
ef7bc01
Add reporting of the ReFrame result
Feb 6, 2024
867681a
Add missing bracket. Again
Feb 6, 2024
47e30ca
Add some echo for debugging
Feb 6, 2024
1bdadf8
more debugging output
Feb 6, 2024
5152f5e
Lets try some nicer formatting with headers etc. See if this actually…
Feb 6, 2024
ea38c66
Inverse check, it was incorrect
Feb 6, 2024
8edb6ff
Remove debugging output
Feb 6, 2024
26bd2cb
Correct the regex pattern to account for the fact that the slurm outp…
Feb 6, 2024
416b72d
Corrected typo
Feb 6, 2024
1990093
Trigger failure in the workflow on purpose, to show what that looks like
Feb 6, 2024
4b98856
Change order of checking error codes. If the ReFrame tests ran and we…
Feb 6, 2024
0f26142
Make sure we don't overwrite the grepped result from failures
Feb 7, 2024
94e0bb5
Fix plural/singular typo
Feb 7, 2024
9e7ac1c
Be a bit more expressive about what we are doing
Feb 7, 2024
3a52bde
Change to dedicated config file for testing by the bot in the build job
Feb 7, 2024
159e384
Make it verbose, see if we can see why autodetect fails
Feb 7, 2024
b92044e
Add ReFrame config template. Not that four template variables need to…
Feb 7, 2024
02b0e31
Use template config file and make replacements based on lscpu
Feb 7, 2024
58c4cfa
Fix incorrect variable name
Feb 7, 2024
2fc121e
Missing comma
Feb 7, 2024
db08f4f
Corrected typo
Feb 7, 2024
6b3a6cc
Remove verbose flags
Feb 7, 2024
a70b4f1
Pick name without spaces, to avoid issues with directories
Feb 7, 2024
ce24e6d
Pick more meaningful name for SLURM variable, namely SLURM_OUTPUT_FOUND
Feb 8, 2024
9881c2a
Correct erroneous status
Feb 8, 2024
1446055
Rename CoDeList variable to comment_details_list
Feb 8, 2024
f80c0eb
Remove commented section, it is not relevant
Feb 8, 2024
ff5baac
Update run_tests.sh
casparvl Feb 8, 2024
4adae18
Fix mistake in replacing SLURM with SLURM_OUTPUT_FOUND
Feb 8, 2024
848e387
Merge branch 'run_test_suite_based_on_pr366' of github.com:casparvl/s…
Feb 8, 2024
9e6955f
Change name of the template for the ReFrame config file to make clear…
Feb 8, 2024
08a7fd8
Fix typo in variable
Feb 8, 2024
8b5bde5
No longer needed
Feb 8, 2024
5d383eb
Added header, rephrased some comments
Feb 8, 2024
cdf7971
Fix headers
Feb 8, 2024
79a9ad3
Load default ReFrame version
Feb 8, 2024
2f280e4
Point to docs for ReFrame config
Feb 8, 2024
e5d60b9
Fix silly mistake: I was overwriting the ReFrame config file with eve…
Feb 8, 2024
b5c60cc
See if @boegel is correct and if we don't actually need ANY software …
Feb 8, 2024
7fc04d8
{2023.06}[foss/2022b] ImageMagick v7.1.0-53
truib Feb 11, 2024
69d6d2e
Add escape character to star, so that the regex pattern prints correc…
Feb 14, 2024
8491f9f
Always use LMOD_RC file, and make sure loading CUDA apps always works…
ocaisa Feb 15, 2024
2dd048e
Add the list(SCALES.keys()) feature (though technically we could limi…
Feb 15, 2024
0492b9e
Try the original regex patterns, capturing spaces more specifically, …
Feb 15, 2024
0f6dc76
Update eessi-2023.06-eb-4.9.0-2022b.yml
Neves-P Feb 16, 2024
3bac711
Add waLBerla v6.1 foss2022b
Neves-P Feb 16, 2024
d6e4cec
add missing ':' for waLBerla entry
boegel Feb 17, 2024
b860c5b
Merge pull request #478 from Neves-P/2023.06-software.eessi.io-waLBer…
bedroge Feb 19, 2024
ec61759
Remove manual setup of MODULEPATH etc, and source the regular EESSI i…
Feb 19, 2024
f3f9721
{2023.06}[foss/2023b] WSClean 3.4 + DP3 6.0
Feb 20, 2024
f8cd2aa
Remove AOFlagger (Lua is no longer part of filter-deps)
Feb 20, 2024
eafbb6b
Include easyblocks from pr 3088 to fix Python path
Feb 20, 2024
df089de
Fix typo
Feb 20, 2024
2ec41e1
List dependencies first
Feb 21, 2024
d0ba0b7
fix typo in IDG version
bedroge Feb 21, 2024
5d797a9
Include Armadillo-12.8.0-foss-2023b.eb
Feb 21, 2024
a55826d
Revert "Include Armadillo-12.8.0-foss-2023b.eb"
Feb 21, 2024
f63a4d8
Include Armadillo-12.8.0-foss-2023b.eb
Feb 21, 2024
7a0aceb
Include arpack-ng-3.9.0-foss-2023b.eb
Feb 21, 2024
5c546ea
Disable 'vectorize' toolchain option for casacore 3.5.0 on aarch64/ne…
Feb 22, 2024
5b822a3
Remove empty line
Feb 22, 2024
8892437
Cleanup code
Feb 22, 2024
3dcf5fa
add WRF-4.4.1-foss-2022b-dmpar.eb
bedroge Feb 22, 2024
129d66b
Merge pull request #480 from bedroge/wrf_4.4.1_2022b
boegel Feb 23, 2024
4e5f2db
Retrieve cpu_target from EESSI env vars
t1mk1k Feb 23, 2024
3544073
Specify print message for skipping non-neoverse_v1
Feb 23, 2024
0aea4b4
Create toolchainopts dict if it does not exist
Feb 26, 2024
07296d3
Enable lax vector conversion for DP3
Feb 27, 2024
793e9f8
{2023.06}[foss/2023a] dask v2023.9.2
Feb 28, 2024
68a766f
fixed info
Feb 28, 2024
3cdf803
removed the hook and added --from-pr
Feb 28, 2024
1170818
Temporary fix for CI by pinning archspec version
ocaisa Feb 29, 2024
eb5d57e
Merge pull request #482 from ocaisa/fix_ci
boegel Feb 29, 2024
d7ae0de
Merge branch '2023.06-software.eessi.io' of gh-nessi:EESSI/software-l…
Feb 29, 2024
cf77056
remove-blanks
TopRichard Feb 29, 2024
887e102
Update easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.0-20…
ocaisa Feb 29, 2024
938e52e
Update easystacks/software.eessi.io/2023.06/eessi-2023.06-eb-4.9.0-20…
ocaisa Feb 29, 2024
301ab59
Make check_missing_installations.sh check against develop branch of E…
ocaisa Feb 29, 2024
93d1d7d
Use filename rather than full path
ocaisa Feb 29, 2024
f6259dc
export envvar
ocaisa Feb 29, 2024
34f3be0
Merge pull request #481 from TopRichard/eessi-2023.06-dask/9.2-foss/2…
ocaisa Mar 1, 2024
5e7c6bb
Merge pull request #486 from ocaisa/tweak_check_missing
boegel Mar 1, 2024
78ba8d8
Adding OSU microbenchmarks with GPU support for 2023a, and one withou…
Mar 1, 2024
1fd1609
'which' is not working in the container, command -v is
Mar 1, 2024
3141789
Workaround for 'PSM3 can't open nic unit' error
Mar 1, 2024
a28e5ee
Merge pull request #487 from casparvl/osu_gpu
ocaisa Mar 1, 2024
efbeb56
Use LMOD_CONFIG_DIR instead of LMOD_RC to allow user overrides of wha…
Mar 4, 2024
590cabd
Combine functions into a single function, before registering this as …
Mar 5, 2024
0de249e
Look for site-specific lmodrc file in host_injections. If present, se…
Mar 5, 2024
c1840dd
Next the local lmodrc within the versioned directory, e.g. /cvmfs/sof…
Mar 6, 2024
df4140a
Update init/eessi_environment_variables
ocaisa Mar 6, 2024
78e582b
Update init/eessi_environment_variables
ocaisa Mar 6, 2024
77c9723
Update init/eessi_environment_variables
ocaisa Mar 6, 2024
276a64c
{2023.06}[gompi/2023b] CDO v2.2.2
Mar 7, 2024
4c22e55
Merge pull request #492 from TopRichard/eessi-2023.06-CDO/2.2.2-gompi…
ocaisa Mar 7, 2024
e33938f
Revert changes in eessi_environment_variables. Limit this PR to the b…
Mar 7, 2024
8dc4d2a
Merge pull request #490 from casparvl/change_lmodrc_setup
ocaisa Mar 7, 2024
45022b6
Allow for open PRs when checking missing installations in build script
ocaisa Mar 8, 2024
723fce8
Check for unmerged EasyConfig output pattern
Mar 9, 2024
5cd559e
Merge branch 'tweak_missing_installs' into improve_error_on_unmerged_pr
Mar 9, 2024
f4f2776
First, try without --from-pr. If that fails, try with --from-pr, but …
Mar 9, 2024
b789108
Add CFITSIO as a test example, see if we can get a clear error messag…
Mar 9, 2024
d178a8f
Added clarifying comment
Mar 9, 2024
9123c9c
Correct mistake: I meant to _move_ the awk part, not duplicate it
Mar 9, 2024
7e44223
Now actually check against the exit code of the pipe...
Mar 9, 2024
da749a1
Make seperate exit code for the run that allows --from-pr
Mar 9, 2024
86d8a36
Remove ineffective DP3 hook
Mar 11, 2024
790756b
Merge upstream changes into branch
Mar 11, 2024
f8816ac
{2023.06}[2023a] JupyterNotebook v7.0.2
boegel Mar 11, 2024
a8c2883
Correct typo
casparvl Mar 11, 2024
6553e29
Skip the if-condition also if pr_exceptions is empty. There is no poi…
Mar 11, 2024
8990e37
Merge branch 'improve_error_on_unmerged_pr' of github.com:casparvl/so…
Mar 11, 2024
8fc3fc4
Merge pull request #495 from boegel/2023.06-software.eessi.io_Jupyter…
bedroge Mar 12, 2024
6fee4c9
Merge pull request #479 from t1mk1k/new_pr_wsclean_dp3_2023b
ocaisa Mar 12, 2024
0343684
{2023.06}[foss/2023b] python-casacore 3.5.2 + libspatialindex 1.9.3
Mar 12, 2024
af55c71
Merge branch '2023.06-software.eessi.io' into 2023.06-software-imagem…
bedroge Mar 12, 2024
3e43b06
add ImageMagick-7.1.1-15-GCCcore-12.3.0.eb
bedroge Mar 12, 2024
75735ac
Merge pull request #470 from trz42/2023.06-software-imagemagick-foss-…
boegel Mar 12, 2024
25917ba
Merge pull request #498 from bedroge/imagemagick_2023a
boegel Mar 12, 2024
0295571
Use PR that sets LD_LIBRARY_PATH for python-casacore
Mar 12, 2024
222d929
Merge pull request #497 from t1mk1k/new_pr_python_casacore_libspatial…
bedroge Mar 12, 2024
bc84aec
Merge pull request #475 from ocaisa/always_lmod_rc
boegel Mar 13, 2024
b52db4b
Merge branch '2023.06-software.eessi.io' into improve_error_on_unmerg…
boegel Mar 13, 2024
c08831e
Update bot/check-build.sh
ocaisa Mar 13, 2024
992b11d
Remove PR to trigger comment
ocaisa Mar 13, 2024
8d6493e
Trigger on any non-zero exit code
ocaisa Mar 13, 2024
1dee560
Merge pull request #494 from casparvl/improve_error_on_unmerged_pr
boegel Mar 13, 2024
0fdbd3a
Add Z3 with new module name
ocaisa Mar 14, 2024
dd75723
Merge pull request #502 from EESSI/ocaisa-patch-6
bedroge Mar 14, 2024
d097189
{2023.06}[2023a] PyOpenGL 3.1.7
boegel Mar 14, 2024
8245aff
add from-pr=20007
bedroge Mar 14, 2024
06a0413
Merge pull request #503 from boegel/2023.06-software.eessi.io_2023a_P…
bedroge Mar 15, 2024
af58e1a
{2023.06}[2023a] ipympl 0.9.3
boegel Mar 15, 2024
a12b9a3
fix check_missing_installations.sh when unmerged PR is used
boegel Mar 15, 2024
20c5c98
Merge pull request #506 from boegel/2023.06-software.eessi.io_fix-che…
ocaisa Mar 15, 2024
f4e1656
Merge branch '2023.06-software.eessi.io' into 2023.06-software.eessi.…
boegel Mar 15, 2024
974181d
Merge pull request #505 from boegel/2023.06-software.eessi.io_ipympl
bedroge Mar 16, 2024
536d323
Merge branch '2023.06-software.eessi.io' into run_test_suite_based_on…
casparvl Mar 22, 2024
330db7a
also dump status to test result file
boegel Mar 26, 2024
f3c6207
add Caspar as author in `bot/test.sh` script
boegel Mar 26, 2024
13072df
use read-only mode to access software installations via container
boegel Mar 26, 2024
1fa323a
fix typo: build -> test
boegel Mar 26, 2024
8d05473
disable CPU auto-detection in template ReFrame configuration script u…
boegel Mar 26, 2024
c53f578
pass down --generic to script used for running test suite, so tests a…
boegel Mar 26, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: install Python packages
run: |
pip install archspec
pip install archspec==0.2.2

- name: test eessi_software_subdir.py script
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: install Python packages
run: |
pip install archspec pytest
pip install archspec==0.2.2 pytest

- name: unit tests for eessi_software_subdir_for_host.py script
run:
Expand Down
2 changes: 1 addition & 1 deletion EESSI-install-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ else
copy_build_log "${eb_last_log}" "${build_logs_dir}"
fi

$TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file}
$TOPDIR/check_missing_installations.sh ${TOPDIR}/${easystack_file} ${TOPDIR}/${pr_diff}
else
fatal_error "Easystack file ${easystack_file} not found!"
fi
Expand Down
144 changes: 92 additions & 52 deletions bot/check-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ job_dir=${PWD}
job_out="slurm-${SLURM_JOB_ID}.out"
[[ ${VERBOSE} -ne 0 ]] && echo ">> searching for job output file(s) matching '"${job_out}"'"
if [[ -f ${job_out} ]]; then
SLURM=1
SLURM_OUTPUT_FOUND=1
[[ ${VERBOSE} -ne 0 ]] && echo " found slurm output file '"${job_out}"'"
else
SLURM=0
SLURM_OUTPUT_FOUND=0
[[ ${VERBOSE} -ne 0 ]] && echo " Slurm output file '"${job_out}"' NOT found"
fi

ERROR=-1
if [[ ${SLURM} -eq 1 ]]; then
if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_error='ERROR: '
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_error}")
[[ $? -eq 0 ]] && ERROR=1 || ERROR=0
Expand All @@ -116,7 +116,7 @@ if [[ ${SLURM} -eq 1 ]]; then
fi

FAILED=-1
if [[ ${SLURM} -eq 1 ]]; then
if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_failed='FAILED: '
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_failed}")
[[ $? -eq 0 ]] && FAILED=1 || FAILED=0
Expand All @@ -126,7 +126,7 @@ if [[ ${SLURM} -eq 1 ]]; then
fi

MISSING=-1
if [[ ${SLURM} -eq 1 ]]; then
if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_req_missing=' required modules missing:'
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_req_missing}")
[[ $? -eq 0 ]] && MISSING=1 || MISSING=0
Expand All @@ -136,7 +136,7 @@ if [[ ${SLURM} -eq 1 ]]; then
fi

NO_MISSING=-1
if [[ ${SLURM} -eq 1 ]]; then
if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_no_missing='No missing installations'
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_no_missing}")
[[ $? -eq 0 ]] && NO_MISSING=1 || NO_MISSING=0
Expand All @@ -147,7 +147,7 @@ fi

TGZ=-1
TARBALL=
if [[ ${SLURM} -eq 1 ]]; then
if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
GP_tgz_created="\.tar\.gz created!"
grep_out=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${GP_tgz_created}" | sort -u)
if [[ $? -eq 0 ]]; then
Expand All @@ -169,9 +169,27 @@ fi
[[ ${VERBOSE} -ne 0 ]] && echo " NO_MISSING.: $([[ $NO_MISSING -eq 1 ]] && echo 'yes' || echo 'no') (yes)"
[[ ${VERBOSE} -ne 0 ]] && echo " TGZ_CREATED: $([[ $TGZ -eq 1 ]] && echo 'yes' || echo 'no') (yes)"

# Here, we try to do some additional analysis on the output file
# to see if we can print a more clear 'reason' for the failure
# For now, we only analyse unmerged EasyConfigs as potential cause, but we can easily add checks for other
# specific scenarios below

# Check for the pattern being added here by check_missing_installations.sh to the output to
# see if EasyConfigs might have been unmerged, and that's causing a failure
UNMERGED_EASYCONFIG=-1
if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]]; then
gp_unmerged="are you sure all PRs referenced have been merged in EasyBuild"
grep_unmerged=$(grep -v "^>> searching for " ${job_dir}/${job_out} | grep "${gp_unmerged}")
[[ $? -eq 0 ]] && UNMERGED_EASYCONFIG=1 || UNMERGED_EASYCONFIG=0
# have to be careful to not add searched for pattern into slurm out file
[[ ${VERBOSE} -ne 0 ]] && echo ">> searching for '"${gp_unmerged}"'"
[[ ${VERBOSE} -ne 0 ]] && echo "${grep_unmerged}"
fi

job_result_file=_bot_job${SLURM_JOB_ID}.result

if [[ ${SLURM} -eq 1 ]] && \
# Default reason:
if [[ ${SLURM_OUTPUT_FOUND} -eq 1 ]] && \
[[ ${ERROR} -eq 0 ]] && \
[[ ${FAILED} -eq 0 ]] && \
[[ ${MISSING} -eq 0 ]] && \
Expand All @@ -180,10 +198,17 @@ if [[ ${SLURM} -eq 1 ]] && \
[[ ! -z ${TARBALL} ]]; then
# SUCCESS
status="SUCCESS"
reason=""
summary=":grin: SUCCESS"
elif [[ ${UNMERGED_EASYCONFIG} -eq 1 ]]; then
status="FAILURE"
reason="EasyConfig not found during missing installation check. Are you sure all PRs referenced have been merged in EasyBuild?"
summary=":cry: FAILURE"
else
# FAILURE
status="FAILURE"
# General failure, we don't know a more specific reason
reason=""
summary=":cry: FAILURE"
fi

Expand Down Expand Up @@ -253,14 +278,6 @@ fi
# </details>
###

# construct and write complete PR comment details: implements third alternative
comment_template="<details>__SUMMARY_FMT__<dl>__DETAILS_FMT____ARTEFACTS_FMT__</dl></details>"
comment_summary_fmt="<summary>__SUMMARY__ _(click triangle for details)_</summary>"
comment_details_fmt="<dt>_Details_</dt><dd>__DETAILS_LIST__</dd>"
comment_success_item_fmt=":white_check_mark: __ITEM__"
comment_failure_item_fmt=":x: __ITEM__"
comment_artefacts_fmt="<dt>_Artefacts_</dt><dd>__ARTEFACTS_LIST__</dd>"
comment_artefact_details_fmt="<details>__ARTEFACT_SUMMARY____ARTEFACT_DETAILS__</details>"

function print_br_item() {
format="${1}"
Expand Down Expand Up @@ -332,42 +349,66 @@ echo -n "comment_description = " >> ${job_result_file}
# - __DETAILS_FMT__ -> variable $comment_details
# - __ARTEFACTS_FMT__ -> variable $comment_artefacts

# construct and write complete PR comment details: implements third alternative
comment_template="<details>__SUMMARY_FMT__<dl>__REASON_FMT____DETAILS_FMT____ARTEFACTS_FMT__</dl></details>"
comment_success_item_fmt=":white_check_mark: __ITEM__"
comment_failure_item_fmt=":x: __ITEM__"

# Initialize comment_description
comment_description=${comment_template}

# Now, start replacing template items one by one
# Replace the summary template (__SUMMARY_FMT__)
comment_summary_fmt="<summary>__SUMMARY__ _(click triangle for details)_</summary>"
comment_summary="${comment_summary_fmt/__SUMMARY__/${summary}}"
comment_description=${comment_template/__SUMMARY_FMT__/${comment_summary}}

# Only add if there is a reason (e.g. no reason for successful runs)
if [[ ! -z ${reason} ]]; then
comment_reason_fmt="<dt>_Reason_</dt><dd>__REASONS__</dd>"
reason_details="${comment_reason_fmt/__REASONS__/${reason}}"
comment_description=${comment_description/__REASON_FMT__/${reason_details}}
else
comment_description=${comment_description/__REASON_FMT__/""}
fi

# first construct comment_details_list, abbreviated CoDeList
# Replace the details template (__DETAILS_FMT__)
# first construct comment_details_list, abbreviated comment_details_list
# then use it to set comment_details
CoDeList=""
comment_details_list=""

success_msg="job output file <code>${job_out}</code>"
failure_msg="no job output file <code>${job_out}</code>"
CoDeList=${CoDeList}$(add_detail ${SLURM} 1 "${success_msg}" "${failure_msg}")
comment_details_list=${comment_details_list}$(add_detail ${SLURM_OUTPUT_FOUND} 1 "${success_msg}" "${failure_msg}")

success_msg="no message matching <code>${GP_error}</code>"
failure_msg="found message matching <code>${GP_error}</code>"
CoDeList=${CoDeList}$(add_detail ${ERROR} 0 "${success_msg}" "${failure_msg}")
comment_details_list=${comment_details_list}$(add_detail ${ERROR} 0 "${success_msg}" "${failure_msg}")

success_msg="no message matching <code>${GP_failed}</code>"
failure_msg="found message matching <code>${GP_failed}</code>"
CoDeList=${CoDeList}$(add_detail ${FAILED} 0 "${success_msg}" "${failure_msg}")
comment_details_list=${comment_details_list}$(add_detail ${FAILED} 0 "${success_msg}" "${failure_msg}")

success_msg="no message matching <code>${GP_req_missing}</code>"
failure_msg="found message matching <code>${GP_req_missing}</code>"
CoDeList=${CoDeList}$(add_detail ${MISSING} 0 "${success_msg}" "${failure_msg}")
comment_details_list=${comment_details_list}$(add_detail ${MISSING} 0 "${success_msg}" "${failure_msg}")

success_msg="found message(s) matching <code>${GP_no_missing}</code>"
failure_msg="no message matching <code>${GP_no_missing}</code>"
CoDeList=${CoDeList}$(add_detail ${NO_MISSING} 1 "${success_msg}" "${failure_msg}")
comment_details_list=${comment_details_list}$(add_detail ${NO_MISSING} 1 "${success_msg}" "${failure_msg}")

success_msg="found message matching <code>${GP_tgz_created}</code>"
failure_msg="no message matching <code>${GP_tgz_created}</code>"
CoDeList=${CoDeList}$(add_detail ${TGZ} 1 "${success_msg}" "${failure_msg}")

comment_details="${comment_details_fmt/__DETAILS_LIST__/${CoDeList}}"
comment_details_list=${comment_details_list}$(add_detail ${TGZ} 1 "${success_msg}" "${failure_msg}")

# Now, do the actual replacement of __DETAILS_FMT__
comment_details_fmt="<dt>_Details_</dt><dd>__DETAILS_LIST__</dd>"
comment_details="${comment_details_fmt/__DETAILS_LIST__/${comment_details_list}}"
comment_description=${comment_description/__DETAILS_FMT__/${comment_details}}

# first construct comment_artefacts_list, abbreviated CoArList
# first construct comment_artefacts_list
# then use it to set comment_artefacts
CoArList=""
comment_artifacts_list=""

# TARBALL should only contain a single tarball
if [[ ! -z ${TARBALL} ]]; then
Expand Down Expand Up @@ -427,50 +468,49 @@ if [[ ! -z ${TARBALL} ]]; then
software_pkgs=$(echo "${software_entries}" | sed -e "s@${prefix}/software/@@" | awk -F/ '{if (NR >= 2) {print $1 "/" $2}}' | sort -u)

artefact_summary="<summary>$(print_code_item '__ITEM__' ${TARBALL})</summary>"
CoArList=""
CoArList="${CoArList}$(print_br_item2 'size: __ITEM__ MiB (__ITEM2__ bytes)' ${size_mib} ${size})"
CoArList="${CoArList}$(print_br_item 'entries: __ITEM__' ${entries})"
CoArList="${CoArList}$(print_br_item 'modules under ___ITEM___' ${prefix}/modules/all)"
CoArList="${CoArList}<pre>"
comment_artifacts_list=""
comment_artifacts_list="${comment_artifacts_list}$(print_br_item2 'size: __ITEM__ MiB (__ITEM2__ bytes)' ${size_mib} ${size})"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'entries: __ITEM__' ${entries})"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'modules under ___ITEM___' ${prefix}/modules/all)"
comment_artifacts_list="${comment_artifacts_list}<pre>"
if [[ ! -z ${modules} ]]; then
while IFS= read -r mod ; do
CoArList="${CoArList}$(print_br_item '<code>__ITEM__</code>' ${mod})"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item '<code>__ITEM__</code>' ${mod})"
done <<< "${modules}"
else
CoArList="${CoArList}$(print_br_item '__ITEM__' 'no module files in tarball')"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__' 'no module files in tarball')"
fi
CoArList="${CoArList}</pre>"
CoArList="${CoArList}$(print_br_item 'software under ___ITEM___' ${prefix}/software)"
CoArList="${CoArList}<pre>"
comment_artifacts_list="${comment_artifacts_list}</pre>"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'software under ___ITEM___' ${prefix}/software)"
comment_artifacts_list="${comment_artifacts_list}<pre>"
if [[ ! -z ${software_pkgs} ]]; then
while IFS= read -r sw_pkg ; do
CoArList="${CoArList}$(print_br_item '<code>__ITEM__</code>' ${sw_pkg})"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item '<code>__ITEM__</code>' ${sw_pkg})"
done <<< "${software_pkgs}"
else
CoArList="${CoArList}$(print_br_item '__ITEM__' 'no software packages in tarball')"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__' 'no software packages in tarball')"
fi
CoArList="${CoArList}</pre>"
CoArList="${CoArList}$(print_br_item 'other under ___ITEM___' ${prefix})"
CoArList="${CoArList}<pre>"
comment_artifacts_list="${comment_artifacts_list}</pre>"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item 'other under ___ITEM___' ${prefix})"
comment_artifacts_list="${comment_artifacts_list}<pre>"
if [[ ! -z ${other_shortened} ]]; then
while IFS= read -r other ; do
CoArList="${CoArList}$(print_br_item '<code>__ITEM__</code>' ${other})"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item '<code>__ITEM__</code>' ${other})"
done <<< "${other_shortened}"
else
CoArList="${CoArList}$(print_br_item '__ITEM__' 'no other files in tarball')"
comment_artifacts_list="${comment_artifacts_list}$(print_br_item '__ITEM__' 'no other files in tarball')"
fi
CoArList="${CoArList}</pre>"
comment_artifacts_list="${comment_artifacts_list}</pre>"
else
CoArList="${CoArList}$(print_dd_item 'No artefacts were created or found.' '')"
comment_artifacts_list="${comment_artifacts_list}$(print_dd_item 'No artefacts were created or found.' '')"
fi

comment_artefact_details_fmt="<details>__ARTEFACT_SUMMARY____ARTEFACT_DETAILS__</details>"
comment_artefacts_details="${comment_artefact_details_fmt/__ARTEFACT_SUMMARY__/${artefact_summary}}"
comment_artefacts_details="${comment_artefacts_details/__ARTEFACT_DETAILS__/${CoArList}}"
comment_artefacts="${comment_artefacts_fmt/__ARTEFACTS_LIST__/${comment_artefacts_details}}"
comment_artefacts_details="${comment_artefacts_details/__ARTEFACT_DETAILS__/${comment_artifacts_list}}"

# now put all pieces together creating comment_details from comment_template
comment_description=${comment_template/__SUMMARY_FMT__/${comment_summary}}
comment_description=${comment_description/__DETAILS_FMT__/${comment_details}}
comment_artefacts_fmt="<dt>_Artefacts_</dt><dd>__ARTEFACTS_LIST__</dd>"
comment_artefacts="${comment_artefacts_fmt/__ARTEFACTS_LIST__/${comment_artefacts_details}}"
comment_description=${comment_description/__ARTEFACTS_FMT__/${comment_artefacts}}

echo "${comment_description}" >> ${job_result_file}
Expand Down
Loading