make graph node variant can be configured from gerrit trigger
[csit.git] / resources / libraries / bash / function / common.sh
index 3d59506..f724e53 100644 (file)
@@ -524,6 +524,19 @@ function get_test_tag_string () {
         cmd=("grep" "-oP" '\S*'"${trigger}"'\S*\s\K.+$') || die "Unset trigger?"
         # On parsing error, TEST_TAG_STRING probably stays empty.
         TEST_TAG_STRING=$("${cmd[@]}" <<< "${comment}") || true
+        if [[ -n "${TEST_TAG_STRING-}" ]]; then
+            test_tag_array=(${TEST_TAG_STRING})
+            if [[ "${test_tag_array[0]}" == "icl" ]]; then
+                export GRAPH_NODE_VARIANT="icl"
+                TEST_TAG_STRING="${test_tag_array[@]:1}" || true
+            elif [[ "${test_tag_array[0]}" == "skx" ]]; then
+                export GRAPH_NODE_VARIANT="skx"
+                TEST_TAG_STRING="${test_tag_array[@]:1}" || true
+            elif [[ "${test_tag_array[0]}" == "hsw" ]]; then
+                export GRAPH_NODE_VARIANT="hsw"
+                TEST_TAG_STRING="${test_tag_array[@]:1}" || true
+            fi
+        fi
     fi
 }
 
@@ -784,8 +797,11 @@ function select_tags () {
                 eval ${sed_nics_sub_cmd}) || die
             ;;
         *"report-iterative"* )
+            test_sets=(${TEST_TAG_STRING//:/ })
+            # Run only one test set per run
+            report_file=${test_sets[0]}.md
             readarray -t test_tag_array <<< $(sed 's/ //g' \
-                ${tfd}/report_iterative/${DUT}-${NODENESS}-${FLAVOR}.md |
+                ${tfd}/report_iterative/${NODENESS}-${FLAVOR}/${report_file} |
                 eval ${sed_nics_sub_cmd}) || die
             ;;
         *"report-coverage"* )