From c28daf3e37f38ec570b70f33e9ce18a8e6b24f61 Mon Sep 17 00:00:00 2001
From: Martin Klozik <martinx.klozik@intel.com>
Date: Tue, 19 Jan 2016 11:27:22 +0000
Subject: [PATCH] ci: show TC results inside Jenkins job console output

It is required to show detailed result figures together
with OK/FAILED status. CI script has been modified
to show formatted results from test report MD files.

Change-Id: I9e3724c5aac517dc493f0cf57fc8292434c0bfe8
JIRA: VSPERF-184
Signed-off-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
---
 ci/build-vsperf.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ci/build-vsperf.sh b/ci/build-vsperf.sh
index 7c847673..e08dd357 100755
--- a/ci/build-vsperf.sh
+++ b/ci/build-vsperf.sh
@@ -149,6 +149,18 @@ function execute_vsperf() {
     else
         print_results "/${RES_DIR}"
     fi
+
+    # show detailed result figures
+    for md_file in $(grep '\.md"$' $LOG_FILE | cut -d'"' -f2); do
+        # TC resut file header
+        echo -e "\n-------------------------------------------------------------------"
+        echo -e " $md_file"
+        echo -e "-------------------------------------------------------------------\n"
+        # TC details
+        sed -n '/^- Test ID/,/Bidirectional/{/Packet size/b;p;/Bidirectional/q};/Results\/Metrics Collected/,/Statistics collected/{/^$/p;/^|/p}' $md_file
+        # TC results
+        sed -n '/Results\/Metrics Collected/,/Statistics collected/{/^$/p;/^|/p}' $md_file | grep -v "Unknown" | cat -s
+    done
 }
 
 #
-- 
2.16.6