Commit c76b4202 authored by Dan Guest's avatar Dan Guest Committed by Samuel Van Stroud
Browse files

Simplify test script and add minimal test

Adds a test for the ca-based minimal dumper. Also some restructuring in test
script, which was probably a bit overcomplicated.
parent 69df9a1f
......@@ -3,7 +3,7 @@
set -Eeu
print-usage() {
echo "usage: $0 [-h] [-d <dir>] (pflow|trackjets|eventloop|hbb|gnn)" 1>&2
echo "usage: $0 [-h] [-d <dir>] (pflow|trackjets|eventloop|hbb|gnn|minimal)" 1>&2
}
usage() {
......@@ -59,6 +59,7 @@ declare -A CONFIGS=(
[gnn]=${CFG_DIR}/single-b-tag/EMPFlowGNN.json
[eventloop]=${CFG_DIR}/single-b-tag/EMPFlow.json
[hbb]=${CFG_DIR}/hbb/2020_ftag5dev.json
[minimal]=${CFG_DIR}/single-b-tag/minimal.json
)
declare -A DATAFILES=(
[pflow]=22.2.X/2021-05-09T2101/DAOD_PHYSVAL.small.pool.root
......@@ -66,16 +67,8 @@ declare -A DATAFILES=(
[gnn]=22.2.X/2021-05-09T2101/DAOD_PHYSVAL.small.pool.root
[eventloop]=22.2.X/2021-05-09T2101/DAOD_PHYSVAL.small.pool.root
[hbb]=22.2.X/2021-05-09T2101/DAOD_PHYSVAL.small.pool.root
[minimal]=22.2.X/2021-05-09T2101/DAOD_PHYSVAL.small.pool.root
)
declare -A TESTS=(
[pflow]=single-b
[trackjets]=single-b
[gnn]=single-b
[eventloop]=eventloop
[hbb]=hbb
)
# if we're using AthAnalysis (or athena) we don't use eventloop
if command -v ca-dump-single-btag > /dev/null
then
......@@ -83,9 +76,20 @@ then
else
EVENTLOOP_COMMAND=el-dump-single-btag
fi
declare -A TESTS=(
[pflow]=dump-single-btag
[trackjets]=dump-single-btag
[gnn]=dump-single-btag
[eventloop]=${EVENTLOOP_COMMAND}
[hbb]=dump-hbb
[minimal]=ca-dump-minimal-btag
)
# define variables used later on
############################################
# Check that all the modes / paths exist
############################################
#
if [[ ! ${CONFIGS[$MODE]+x} ]]; then usage; fi
CFG=${CONFIGS[$MODE]}
......@@ -93,26 +97,15 @@ if [[ ! ${DATAFILES[$MODE]+x} ]]; then usage; fi
DOWNLOAD_PATH=${DATAFILES[$MODE]}
FILE=${DOWNLOAD_PATH##*/}
if [[ ! ${TESTS[$MODE]+x} ]]; then usage; fi
RUN=${TESTS[$MODE]}
# run scripts based on mode
function single-b {
local CMD="dump-single-btag $FILE -c $CFG"
# define run script
function run-test {
local CMD="$RUN $FILE -c $CFG"
echo "running ${CMD}"
${CMD}
}
function eventloop {
local CMD="${EVENTLOOP_COMMAND} $FILE -c $CFG"
echo "running ${CMD}"
${CMD}
}
function hbb {
local CMD="dump-hbb $FILE -c $CFG"
echo "running ${CMD}"
${CMD}
}
if [[ ! ${TESTS[$MODE]+x} ]]; then usage; fi
RUN=${TESTS[$MODE]}
#############################################
# now start doing stuff
......@@ -138,7 +131,8 @@ if [[ ! -f ${FILE} ]] ; then
curl -s ${DATA_URL}/${DOWNLOAD_PATH} > ${FILE}
fi
${RUN}
# now run the test
run-test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment