diff options
author | Nacho Silla <nsilla@redhat.com> | 2024-12-19 11:01:22 +0100 |
---|---|---|
committer | Nacho Silla <nsilla@redhat.com> | 2024-12-19 11:38:12 +0100 |
commit | ad13e0044112cb6a635fd8cc13960b71f0bc673c (patch) | |
tree | 15cc56cf82fa879b6fdeb0f1ff03e34a829864a3 | |
parent | e94f8a93d6ccf237df12c9b1a4de5721e5cf4b9e (diff) |
test-runner extends the list of tags instead of overriding it
For every pipeline stage it runs, the test-runner script sets the
dci_tags variable to a list including the "debug" tag and the change ID.
This is a problem with custom tags are provided from the command line or
the CR description, since the tags set by test-runner will override the
custom ones.
This change allows test-runner to extend the list of custom tags, if it
exists, instead of replacing it.
Change-Id: I47a8f96de5f267fedc627ee0c91d5af881ed6043
-rwxr-xr-x | tools/test-runner | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/test-runner b/tools/test-runner index 970536cf..eb44d152 100755 --- a/tools/test-runner +++ b/tools/test-runner @@ -558,7 +558,18 @@ for NAME in $OCP_NAMES $CNF_NAMES; do if [ -n "$CONF" ] && [ "$CONF" != null ]; then QUEUE_OPT="$NAME:configuration=$DCI_QUEUE" fi - ALL_TAGS="$ALL_TAGS $NAME:$TAGS $NAME:url=$URL $NAME:$GIT_REPOS $QUEUE_OPT $NAME:ansible_extravars=dci_change_dir:$PWD" + + EXTENDED_TAGS=$TAGS + for ARG in ${ARGS[@]} + do + if [[ $ARG == "$NAME:ansible_extravars=dci_tags:"* ]] + then + CUSTOM_TAGS=$(echo $ARG | sed -e "s/$NAME:ansible_extravars=dci_tags://g") + EXTENDED_TAGS="$TAGS,$CUSTOM_TAGS" + fi + done + + ALL_TAGS="$ALL_TAGS $NAME:$EXTENDED_TAGS $NAME:url=$URL $NAME:$GIT_REPOS $QUEUE_OPT $NAME:ansible_extravars=dci_change_dir:$PWD" if [ -x "$PWD/.venv/bin/python3" ]; then ALL_TAGS="$ALL_TAGS $NAME:ansible_extravars=ansible_playbook_python:$PWD/.venv/bin/python3" fi |