aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/bash/function/common.sh
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2023-12-13 17:17:27 +0100
committerVratko Polak <vrpolak@cisco.com>2023-12-13 17:17:27 +0100
commit153c9e1215f27ad166df0ce4bd2541d9f37a7afa (patch)
treee11edc3b7d4e80916c28d8b962b1db739731a2e2 /resources/libraries/bash/function/common.sh
parent8e06304165ccf50418027f65605b237eaf14aca7 (diff)
feat(bisect): introduce scripts for VPP bisecting
+ Parsing common with per-patch job is moved to a library. Ticket: CSIT-1618 Change-Id: I185bea084a29e6a37ef94e9da42b192a6a81fc17 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/bash/function/common.sh')
-rw-r--r--resources/libraries/bash/function/common.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh
index 44149ca6e1..c2b169f550 100644
--- a/resources/libraries/bash/function/common.sh
+++ b/resources/libraries/bash/function/common.sh
@@ -290,7 +290,7 @@ function compose_robot_arguments () {
*"device"*)
ROBOT_ARGS+=("--suite" "tests.${DUT}.device")
;;
- *"perf"*)
+ *"perf"* | *"bisect"*)
ROBOT_ARGS+=("--suite" "tests.${DUT}.perf")
;;
*)
@@ -557,6 +557,8 @@ function get_test_tag_string () {
# Variables set:
# - TEST_TAG_STRING - The string following trigger word in gerrit comment.
# May be empty, or even not set on event types not adding comment.
+ # - GIT_BISECT_FROM - If bisecttest, the commit hash to bisect from.
+ # Else not set.
# Variables exported optionally:
# - GRAPH_NODE_VARIANT - Node variant to test with, set if found in trigger.
@@ -566,6 +568,10 @@ function get_test_tag_string () {
if [[ "${GERRIT_EVENT_TYPE-}" == "comment-added" ]]; then
case "${TEST_CODE}" in
+ # Order matters, bisect job contains "perf" in its name.
+ *"bisect"*)
+ trigger="bisecttest"
+ ;;
*"device"*)
trigger="devicetest"
;;
@@ -591,6 +597,18 @@ function get_test_tag_string () {
comment=$(fgrep "${trigger}" <<< "${comment}" || true)
TEST_TAG_STRING=$("${cmd[@]}" <<< "${comment}" || true)
fi
+ if [[ "${trigger}" == "bisecttest" ]]; then
+ # Intentionally without quotes, so spaces delimit elements.
+ test_tag_array=(${TEST_TAG_STRING}) || die "How could this fail?"
+ # First "argument" of bisecttest is a commit hash.
+ GIT_BISECT_FROM="${test_tag_array[0]}" || {
+ die "Bisect job requires commit hash."
+ }
+ # Update the tag string (tag expressions only, no commit hash).
+ TEST_TAG_STRING="${test_tag_array[@]:1}" || {
+ die "Bisect job needs a single test, no default."
+ }
+ fi
if [[ -n "${TEST_TAG_STRING-}" ]]; then
test_tag_array=(${TEST_TAG_STRING})
if [[ "${test_tag_array[0]}" == "icl" ]]; then