Skip to content

Commit

Permalink
rename PR short name dirs to long names to match the baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Dec 1, 2022
1 parent f1c9f68 commit 2236f1d
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions pr_testing/run-pr-comparisons
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,14 @@ if ! grep 'stepList=stepList' $CMSSW_RELEASE_BASE/${MATRIX_READER} >/dev/null 2>
#PR tests might have latest short name changes
if grep 'stepList=stepList' $CMSSW_BASE/${MATRIX_READER} >/dev/null 2>&1 ; then
#PR tests generated short relval names change
#Create long to short symlinks for root & logs files and update mapping file
mv $WORKSPACE/data/$COMPARISON_RELEASE $WORKSPACE/data/${COMPARISON_RELEASE}-long
cp $WORKSPACE/$MAPPING_FILE $WORKSPACE/$MAPPING_FILE.orig
mkdir $WORKSPACE/data/${COMPARISON_RELEASE}
for wf_dir in $(ls $WORKSPACE/data/${COMPARISON_RELEASE}-long) ; do
if [ ! -e $WORKSPACE/data/${COMPARISON_RELEASE}-long/${wf_dir}/cmdLog ] ; then
ln -sf ../${COMPARISON_RELEASE}-long/${wf_dir} $WORKSPACE/data/${COMPARISON_RELEASE}/${wf_dir}
continue
fi
#Move PR short names to long names and rename log fils
for wf_dir in $(ls $WORKSPACE/data/PR-${PR_NUM}) ; do
[ ! -e $WORKSPACE/data/PR-${PR_NUM}/${wf_dir}/cmdLog ] || continue
wf=$(echo $wf_dir | cut -d_ -f1)
long_name=$(echo $wf_dir | cut -d_ -f2-)
short_name=$(ls -d $WORKSPACE/data/PR-${PR_NUM}/${wf}_*/cmdLog | sed "s|.*/${wf}_||;s|/cmdLog||")
[ "${short_name}" = "" ] && exit 1
nwf_dir="${wf}_${short_name}"
ln -sf ../${COMPARISON_RELEASE}-long/${wf_dir} $WORKSPACE/data/${COMPARISON_RELEASE}/${nwf_dir}
sed -i -e "s|${wf_dir}/|${nwf_dir}/|" $WORKSPACE/$MAPPING_FILE
short_name=$(echo $wf_dir | cut -d_ -f2-)
long_name=$(ls -d $WORKSPACE/data/$COMPARISON_RELEASE/${wf}_*/cmdLog | sed "s|.*/${wf}_||;s|/cmdLog||")
nwf_dir="${wf}_${long_name}"
mv $WORKSPACE/data/PR-${PR_NUM}/${wf_dir} $WORKSPACE/data/PR-${PR_NUM}/${nwf_dir}
#create symlinks for log files
for log in $(ls $WORKSPACE/data/PR-${PR_NUM}/${nwf_dir}/step*_${short_name}.log) ; do
mv $log $WORKSPACE/data/PR-${PR_NUM}/${nwf_dir}/$(basename $log | cut -d_ -f1)_${long_name}.log
Expand Down

0 comments on commit 2236f1d

Please sign in to comment.