diff --git a/pykat/testing/test.py b/pykat/testing/test.py index 6439f3dbca2ea2a54e7dcda7a9a5649797a7811d..851331ddb0e2f0d9495d51066adb78016a7e10ae 100644 --- a/pykat/testing/test.py +++ b/pykat/testing/test.py @@ -387,7 +387,6 @@ class FinesseTestProcess(Thread): def run(self): try: - raise Exception("Test exception") self.startFinesseTest() except Exception as ex: diff --git a/pykat/testing/web/database_indices.py b/pykat/testing/web/database_indices.py index ad9c46f1ae85fa7826464262ab186b03aea6bebc..943d5cf6460defbed5f6b97f249565d25cf0bb8b 100644 --- a/pykat/testing/web/database_indices.py +++ b/pykat/testing/web/database_indices.py @@ -1,5 +1,5 @@ from CodernityDB.tree_index import TreeBasedIndex - +from CodernityDB.hash_index import HashIndex from hashlib import md5 class TestIDIndex(TreeBasedIndex): @@ -15,5 +15,21 @@ class TestIDIndex(TreeBasedIndex): else: return None + def make_key(self, key): + return key + +class SrcCommitIndex(HashIndex): + + def __init__(self, *args, **kwargs): + kwargs['key_format'] = '40s' + super(TestIDIndex, self).__init__(*args, **kwargs) + + def make_key_value(self, data): + if data['t'] == 'test': + key = int(data['git_commit']) + return key, None + else: + return None + def make_key(self, key): return key \ No newline at end of file diff --git a/pykat/testing/web/templates/finesse_test.html b/pykat/testing/web/templates/finesse_test.html index 92fd4d2a7630331d5649c89b8cfbb1ca60ca195a..3b9b540d34ac95003605ce45ef7fa921e425943e 100644 --- a/pykat/testing/web/templates/finesse_test.html +++ b/pykat/testing/web/templates/finesse_test.html @@ -148,6 +148,7 @@ "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { console.log(oData["test_id"]); var a = $('<input type="button" style="margin: 0" value="View report"></input>').click(function () { + window.location = "/finesse/view/" + oData["test_id"] + "/" }); var b = $('<input type="button" style="margin: 0" value="Rerun test"></input>').click( function () { diff --git a/pykat/testing/web/web_interface.py b/pykat/testing/web/web_interface.py index 3b461f6e9b8daa90d1c5d44247ac39442ee88209..8c7ca0880109e6cf57c95923417aeb09fcdaf9f5 100644 --- a/pykat/testing/web/web_interface.py +++ b/pykat/testing/web/web_interface.py @@ -15,8 +15,8 @@ from pykat.testing.web import app from CodernityDB.database_thread_safe import ThreadSafeDatabase from CodernityDB.database import RecordNotFound -from hashlib import md5 -from pykat.testing.web.database_indices import TestIDIndex + +from pykat.testing.web.database_indices import TestIDIndex, SrcCommitIndex import os, sys @@ -52,6 +52,7 @@ if db.exists(): else: db.create() db.add_index(TestIDIndex(db.path, 'testid')) + db.add_index(SrcCommitIndex(db.path, 'src_commit')) print "loading web interface" @@ -330,14 +331,15 @@ def finesse_get_log(count,branch): for e in log_entries: vals = e.split(" ",1) + vals[0] = vals[0].strip() - if len(vals[0]) > 8: + if len(vals[0]) == 40: if len(vals) > 1: message = vals[1] else: message = "[no commit message]" - log2send.append({'commit':vals[0][0:8], 'message':message}) + log2send.append({'commit':vals[0], 'message':message}) return jsonify(logs=log2send)