Skip to content

Commit

Permalink
Modify DQMGUI upload test to only run in automated environments
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nothingface0 committed Nov 13, 2024
1 parent 813b7cf commit fee2caf
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion DQMServices/Demo/test/test_dqmgui_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,34 @@
set -x
set -e

force=0

function usage(){
echo "Usage: $0 [--help] [--force]"
exit 0
}
# Parse args, if any.
while [[ "$#" -gt 0 ]]; do
case $1 in
--force) force=1; shift ;;
--help) usage; shift;;
*) echo "Unknown parameter passed: $1"; usage; exit 1 ;;
esac
done

# Don't run the test unless it's run by the bot for PRs or IBs.
# The user may force it by adding --force
if [ -z "$CMSBOT_CI_TESTS" ] && [ "$force" -ne 1 ]; then
echo "Non-automated test environment, skipping test."
exit 0
fi

DEV_DQMGUI_URL="https://cmsweb.cern.ch/dqm/dev"
# Create a unique fake "Era", so that different executions of this test
# produce differently named files. This is required, because this test might pass
# if it's checking a file that was successfully uploaded during a previous
# instance of the same test.
UNIQUE_ERA_ID=$(date -u +%Y%m%d%M%S%N)
UNIQUE_ERA_ID=$(date -u +%Y%m%d%H%M%S%N)
OLD_FILENAME=DQM_V0001_R000000001__Harvesting__DQMTests__DQMIO.root
NEW_FILENAME=${OLD_FILENAME/DQMTests/DQMTests${UNIQUE_ERA_ID}}

Expand Down

0 comments on commit fee2caf

Please sign in to comment.