Skip to content

Commit 2eac442

Browse files
authored
Merge pull request #46690 from nothingface0/fix_test_dqmgui_upload
[DQM] Modify DQMGUI upload test to only run in automated environments
2 parents bdf7b42 + fdd94e8 commit 2eac442

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

DQMServices/Demo/test/test_dqmgui_upload.sh

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,44 @@
77
set -x
88
set -e
99

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

0 commit comments

Comments
 (0)