Publish results for Tizen 3.0 in separate file 38/108738/3
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 16 Nov 2016 13:52:45 +0000 (14:52 +0100)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Wed, 1 Feb 2017 16:36:45 +0000 (17:36 +0100)
Use separate view for 3.0-common

Database update is required. Delete it or run:
    . tsp/common.sh
    sqlite3 "${DBPATH}" -batch < tsp/results-schema.sql

Change-Id: I092cd46f9b53f539e8be1ef3038c5eb01c001cf2
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tsp/common.sh
tsp/jobs/publish.sh
tsp/results-schema.sql
tsp/scripts/publish.py

index 50146ea..81b8e66 100755 (executable)
@@ -41,6 +41,7 @@ SNAPSHOT_WS_DOWNLOAD_NEW="${WS_DOWNLOAD}/new_snapshot"
 DBNAME="results.db3"
 DBPATH="${WS_PUBLISH}/${DBNAME}"
 WWW_PUBLISH="${WS_PUBLISH}/current_status.html"
+WWW_3_PUBLISH="${WS_PUBLISH}/current_status_3.html"
 
 TMP_POLL="/tmp/tl-master-poll"
 TMP_MASTER="/tmp/tl-master"
index d48ff4c..ea9b1a0 100755 (executable)
@@ -169,3 +169,12 @@ update_db "$SR" "$AVOCADO_TAG" "$BUILD_NR" "$TARGET"
     "${TSP_DIR}/scripts/publish.py" "${DBPATH}"
     cat "${TSP_DIR}/html_tail"
 } > "${WWW_PUBLISH}"
+
+# Publish to www_3
+{
+    cat "${TSP_DIR}/html_head"
+    lockfile-create --use-pid "${DBPATH}"
+    "${TSP_DIR}/scripts/publish.py" --tizen3 "${DBPATH}"
+    lockfile-remove "${DBPATH}"
+    cat "${TSP_DIR}/html_tail"
+} > "${WWW_3_PUBLISH}"
index eee7268..7b40105 100644 (file)
@@ -29,3 +29,17 @@ CREATE VIEW IF NOT EXISTS currentstatus AS
     INNER JOIN result ON result.rid = test.trid
     ORDER BY SR DESC
 ;
+
+CREATE VIEW IF NOT EXISTS currentstatus3 AS
+    SELECT
+        test.tnumber AS "SR",
+        test.tdate AS "Date",
+        test.tbuildnr AS "Build nr",
+        device.dname AS "Device",
+        result.rname AS "Status"
+    FROM test
+    INNER JOIN device ON test.tdid = device.did
+    INNER JOIN result ON result.rid = test.trid
+    WHERE SR LIKE "%3.0-common%"
+    ORDER BY SR DESC
+;
index 89c2efb..38e51b5 100755 (executable)
@@ -71,13 +71,14 @@ def print_view(dbpath, tizen3):
     conn = sqlite3.connect(dbpath)
     column_names = ["SR", "Date", "\"Build nr\"", "Device", "Status"]
     print_head(column_names)
-    testresults = conn.execute("SELECT " + ', '.join(column_names) + " FROM currentstatus;")
+    if tizen3:
+        testresults = conn.execute("SELECT " + ', '.join(column_names) + " FROM currentstatus3;")
+    else:
+        testresults = conn.execute("SELECT " + ', '.join(column_names) + " FROM currentstatus;")
     col = COLORS[0]
     prev_sr = ''
     for row in testresults:
         sr=row[0]
-        if tizen3 and not '-3.0-' in sr:
-            continue
         if not sr == prev_sr:
             prev_sr = sr
             col = next_color(col)
@@ -92,7 +93,7 @@ def parse_arguments():
 
     parser.add_argument("-3", "--tizen3",
             action="store_true", dest="tizen3",
-            help='Print results for Tizen 3.0 only')
+            help='Print results for Tizen 3.0-common only')
 
     args = parser.parse_args()