Skip to content

Commit fee2caf

Browse files
committed
Modify DQMGUI upload test to only run in automated environments
I.e., when the cmsbot is running the test for PRs or IBs, where `CMSBOT_CI_TESTS` is set. - Also fix the timestamp of the renamed file to include the hour, which was missing before, it will help with debugging. - Added a `--help` argument, just in case. See also: cms-sw#46682
1 parent 813b7cf commit fee2caf

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

DQMServices/Demo/test/test_dqmgui_upload.sh

+23-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,34 @@
77
set -x
88
set -e
99

10+
force=0
11+
12+
function usage(){
13+
echo "Usage: $0 [--help] [--force]"
14+
exit 0
15+
}
16+
# Parse args, if any.
17+
while [[ "$#" -gt 0 ]]; do
18+
case $1 in
19+
--force) force=1; shift ;;
20+
--help) usage; shift;;
21+
*) echo "Unknown parameter passed: $1"; usage; exit 1 ;;
22+
esac
23+
done
24+
25+
# Don't run the test unless it's run by the bot for PRs or IBs.
26+
# The user may force it by adding --force
27+
if [ -z "$CMSBOT_CI_TESTS" ] && [ "$force" -ne 1 ]; then
28+
echo "Non-automated test environment, skipping test."
29+
exit 0
30+
fi
31+
1032
DEV_DQMGUI_URL="https://cmsweb.cern.ch/dqm/dev"
1133
# Create a unique fake "Era", so that different executions of this test
1234
# produce differently named files. This is required, because this test might pass
1335
# if it's checking a file that was successfully uploaded during a previous
1436
# instance of the same test.
15-
UNIQUE_ERA_ID=$(date -u +%Y%m%d%M%S%N)
37+
UNIQUE_ERA_ID=$(date -u +%Y%m%d%H%M%S%N)
1638
OLD_FILENAME=DQM_V0001_R000000001__Harvesting__DQMTests__DQMIO.root
1739
NEW_FILENAME=${OLD_FILENAME/DQMTests/DQMTests${UNIQUE_ERA_ID}}
1840

0 commit comments

Comments
 (0)