Skip to content

Commit

Permalink
move log comp to check action and promote to error
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeichlersmith committed Sep 14, 2023
1 parent ffe10bc commit df20863
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
26 changes: 24 additions & 2 deletions .github/actions/check/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source ${GITHUB_ACTION_PATH}/../common.sh

__main__() {
local _archive="$1"
local rc=0

local _failed_plots=($(tar -tf ${_archive} | grep "fail/.*.pdf"))
if [[ ${#_failed_plots[@]} -gt 0 ]]; then
Expand All @@ -20,10 +21,31 @@ __main__() {
echo $(basename ${p})
done
end_group
return 1
rc=1
fi

return 0
# unpack the logs so we can compare them
tar xzf ${_archive} gold.log output.log

if ! diff gold.log output.log > log.diff; then
# do not error out (don't set rc here) if diff is non-zero, the timestamps printed out
# by some processors prevent a full text diff so we do the character
# count check below to look for big changes
warn Text Differences Between Logs
start_group diff gold.log output.log
cat log.diff
end_group
fi

# check character count of logs
ngold=$(wc --chars gold.log | cut -f 1 -d ' ')
nnew=$(wc --chars output.log | cut -f 1 -d ' ')
if (( ngold != nnew )); then
error "Different character counts in logs for ${_sample}"
rc=1
fi

return ${rc}
}

__main__ $@
11 changes: 0 additions & 11 deletions .github/actions/validate/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,6 @@ __main__() {

# print log diff into output directory
cp -t ${_sample_dir}/plots gold.log output.log || return $?
# do not error out if diff is non-zero, the timestamps printed out
# by some processors prevent a full text diff so we do the character
# count check below to look for big changes
diff gold.log output.log > ${_sample_dir}/plots/log.diff || true

# check character count of logs
ngold=$(wc --chars gold.log | cut -f 1 -d ' ')
nnew=$(wc --chars output.log | cut -f 1 -d ' ')
if (( ngold != nnew )); then
warn "Different character counts in logs for ${_sample}"
fi

# compare.py puts plots into the plots/ directory
# Package them up for upload
Expand Down

0 comments on commit df20863

Please sign in to comment.