Skip to content

Commit

Permalink
clearer printout of the outpus in test_unitSubmitPVsplit
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Nov 17, 2024
1 parent ebed28f commit db24ba3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ def batchScriptCERN(theCMSSW_BASE, cfgdir, runindex, eosdir, lumiToRun, key, con
cd $LXBATCH_DIR
cp -pr {CFGDIR}/PrimaryVertexResolution_{KEY}_{runindex}_cfg.py .
cmsRun PrimaryVertexResolution_{KEY}_{runindex}_cfg.py TrackCollection={TRKS} GlobalTag={GT} lumi={LUMITORUN} {REC} {EXT} >& log_{KEY}_run{runindex}.out
ls -lh .
# Print the contents of the current directory using $PWD and echo
echo "Contents of the current directory ($PWD):"
echo "$(ls -lh "$PWD")"
""".format(CMSSW_BASE_DIR=theCMSSW_BASE,
CFGDIR=cfgdir,
runindex=runindex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,17 @@ cd "${testdir}/testExecution" || exit 1
# Execute the script and handle errors
$PWD/"${scriptName}" || die "Failure running PVSplit script" $?

# Dump to screen the content of the log file
cat log*.out
# Dump to screen the content of the log file(s) with clear headers
log_files=(log*.out)
if [[ ${#log_files[@]} -gt 0 ]]; then
echo "Displaying content of log files:"
for log_file in "${log_files[@]}"; do
echo "========================================"
echo "Content of $log_file:"
echo "========================================"
cat "$log_file"
echo # Add an extra blank line for separation
done
else
echo "No log files found matching 'log*.out'."
fi

0 comments on commit db24ba3

Please sign in to comment.