[Fuego] [PATCH 02/11] testsuite version: record the testsuite version

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Tue Sep 25 06:58:43 UTC 2018


For tarballs we use an md5sum hash value, and for git
we use the current commit ID.

Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
---
 engine/scripts/functions.sh     | 11 ++++++++++-
 engine/scripts/parser/common.py |  4 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
index 05bdbc1..21a4b00 100755
--- a/engine/scripts/functions.sh
+++ b/engine/scripts/functions.sh
@@ -379,6 +379,15 @@ function pre_build {
     else
         abort_job "Rebuild flag $Rebuild is not recognized."
     fi
+
+    # Record the version of the test source
+    if [ -e fuego_tarball_src_md5sum ]; then
+        TESTSUITE_VERSION=$(cat fuego_tarball_src_md5sum | awk '{ print $1 }')
+    elif [ -d ".git" ]; then
+        TESTSUITE_VERSION=$(git log -1 --format="%H")
+    fi
+    export TESTSUITE_VERSION
+    echo "Testsuite version: $TESTSUITE_VERSION"
 }
 
 function build {
@@ -710,7 +719,7 @@ function make_pre_run_file {
         "test_plan": "$TESTPLAN",
         "test_spec": "$TESTSPEC",
         "timestamp": "$BUILD_TIMESTAMP",
-	"testsuite_version": "unknown",
+        "testsuite_version": "$TESTSUITE_VERSION",
 	"toolchain:": "$TOOLCHAIN",
         "workspace": "$WORKSPACE"
     },
diff --git a/engine/scripts/parser/common.py b/engine/scripts/parser/common.py
index c218190..b93a874 100644
--- a/engine/scripts/parser/common.py
+++ b/engine/scripts/parser/common.py
@@ -59,7 +59,7 @@ env_list = ['FUEGO_RW', 'FUEGO_RO', 'FUEGO_CORE', 'NODE_NAME', 'TESTDIR',
         'TESTSPEC', 'BUILD_NUMBER', 'BUILD_ID', 'BUILD_TIMESTAMP',
         'TOOLCHAIN', 'FWVER', 'LOGDIR', 'FUEGO_START_TIME', 'Reboot',
         'Rebuild', 'Target_PreCleanup', 'WORKSPACE', 'JOB_NAME',
-        'FUEGO_VERSION', 'FUEGO_CORE_VERSION'
+        'FUEGO_VERSION', 'FUEGO_CORE_VERSION', 'TESTSUITE_VERSION'
         ]
 
 # add certain environment variables to this module
@@ -456,7 +456,7 @@ def prepare_run_data(results, criteria_data):
         "metadata":{
             "fuego_version":FUEGO_VERSION,
             "fuego_core_version":FUEGO_CORE_VERSION,
-            "testsuite_version":"v1.1-805adb0", #FIXTHIS
+            "testsuite_version":TESTSUITE_VERSION,
             "host_name":FUEGO_HOST,
             "board":NODE_NAME,
             "compiled_on":"docker", #FIXTHIS
-- 
2.7.4



More information about the Fuego mailing list