Skip to content
Snippets Groups Projects
Commit 0f377337 authored by Daniel Brown's avatar Daniel Brown
Browse files

more interface updates, remove purposefuly added exception

parent 0b86f68b
No related branches found
No related tags found
No related merge requests found
...@@ -387,7 +387,6 @@ class FinesseTestProcess(Thread): ...@@ -387,7 +387,6 @@ class FinesseTestProcess(Thread):
def run(self): def run(self):
try: try:
raise Exception("Test exception")
self.startFinesseTest() self.startFinesseTest()
except Exception as ex: except Exception as ex:
......
from CodernityDB.tree_index import TreeBasedIndex from CodernityDB.tree_index import TreeBasedIndex
from CodernityDB.hash_index import HashIndex
from hashlib import md5 from hashlib import md5
class TestIDIndex(TreeBasedIndex): class TestIDIndex(TreeBasedIndex):
...@@ -17,3 +17,19 @@ class TestIDIndex(TreeBasedIndex): ...@@ -17,3 +17,19 @@ class TestIDIndex(TreeBasedIndex):
def make_key(self, key): def make_key(self, key):
return 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
...@@ -148,6 +148,7 @@ ...@@ -148,6 +148,7 @@
"fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
console.log(oData["test_id"]); console.log(oData["test_id"]);
var a = $('<input type="button" style="margin: 0" value="View report"></input>').click(function () { 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 () { var b = $('<input type="button" style="margin: 0" value="Rerun test"></input>').click( function () {
......
...@@ -15,8 +15,8 @@ from pykat.testing.web import app ...@@ -15,8 +15,8 @@ from pykat.testing.web import app
from CodernityDB.database_thread_safe import ThreadSafeDatabase from CodernityDB.database_thread_safe import ThreadSafeDatabase
from CodernityDB.database import RecordNotFound 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 import os, sys
...@@ -52,6 +52,7 @@ if db.exists(): ...@@ -52,6 +52,7 @@ if db.exists():
else: else:
db.create() db.create()
db.add_index(TestIDIndex(db.path, 'testid')) db.add_index(TestIDIndex(db.path, 'testid'))
db.add_index(SrcCommitIndex(db.path, 'src_commit'))
print "loading web interface" print "loading web interface"
...@@ -330,14 +331,15 @@ def finesse_get_log(count,branch): ...@@ -330,14 +331,15 @@ def finesse_get_log(count,branch):
for e in log_entries: for e in log_entries:
vals = e.split(" ",1) vals = e.split(" ",1)
vals[0] = vals[0].strip()
if len(vals[0]) > 8: if len(vals[0]) == 40:
if len(vals) > 1: if len(vals) > 1:
message = vals[1] message = vals[1]
else: else:
message = "[no commit message]" message = "[no commit message]"
log2send.append({'commit':vals[0][0:8], 'message':message}) log2send.append({'commit':vals[0], 'message':message})
return jsonify(logs=log2send) return jsonify(logs=log2send)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment