Commit cedb1572 authored by Daniel Brown's avatar Daniel Brown
Browse files

setting defaults in test class more appropriately. Commits are started oldest...

setting defaults in test class more appropriately. Commits are started oldest first now when selecting multiple ones from the list
parent a9a659b1
......@@ -23,27 +23,26 @@ class DiffException(Exception):
self.outfile = outfile
class FinesseTestProcess(Thread):
queue_time = None
status = ""
built = False
total_kats = 0
done_kats = 0
git_commit = ""
test_id = -1
finished_test = False
diff_rel_eps = 1e-12
running_kat = ""
running_suite = ""
cancelling = False
errorOccurred = None
diffFound = False
diffing = False
def __init__(self, TEST_DIR, BASE_DIR, test_commit,
run_fast=False, kats=[], test_id="0",
git_bin="",emails="", nobuild=False,*args, **kqwargs):
self.queue_time = None
self.status = ""
self.built = False
self.total_kats = 0
self.done_kats = 0
self.git_commit = ""
self.test_id = -1
self.finished_test = False
self.diff_rel_eps = 1e-12
self.running_kat = ""
self.running_suite = ""
self.cancelling = False
self.errorOccurred = None
self.diffFound = False
self.diffing = False
Thread.__init__(self)
self.git_commit = test_commit
......@@ -125,8 +124,6 @@ class FinesseTestProcess(Thread):
self.built = False
BUILD_PATH = os.path.join(self.BASE_DIR, "build")
print "NOBUILD", self.nobuild
# Firstly we need to build the latest version of finesse
if not self.nobuild:
......
......@@ -373,7 +373,7 @@
list = $("#commit_list");
data = JSON.stringify({"git_commit": list.val(), "kats":kats, "nobuild":$('#chkNoBuild').is(':checked')});
data = JSON.stringify({"git_commit": list.val().reverse(), "kats":kats, "nobuild":$('#chkNoBuild').is(':checked')});
$.ajax({
type: "POST",
......
......@@ -15,22 +15,55 @@
<pre>{{ excp_message }}</pre>
<pre>{{ excp_traceback }}</pre>
<h3>Kat result summary</h3>
<h4>Results</h4>
<table id="tblResults">
<h3>Files that were ERROR</h3>
<table id="tblResultsERR">
<thead>
<td>Suite</td>
<td>Kat</td>
<td>Max Rel. Difference</td>
<td>View stderr/stdout</td>
<td>View .kat</td>
<td>View .out</td>
<td>View ref</td>
<td>View Diff</td>
<td>View History
</thead>
{% for suite in kats.keys() %}
{% for item in kats[suite] %}
{% for suite in kats_err.keys() %}
{% for item in kats_err[suite] %}
<tr>
<td>{{ suite }}</td>
<td>{{item[0]}}</td>
<td>{{item[1]}}</td>
{% if item[2][0].strip() %}
<td><a target="_blank" href="/finesse/view/exception/{{view_test_id}}/{{suite}}/{{item[0]}}/">Error</a></td>
{% else%}
<td><a target="_blank" href="/finesse/view/exception/{{view_test_id}}/{{suite}}/{{item[0]}}/">Error</a></td>
{% endif %}
<td><a target="_blank" href="/finesse/kat/{{suite}}/{{item[0]}}">Kat</a></td>
<td><a target="_blank" href="/finesse/out/{{view_test_id}}/{{suite}}/{{item[0]}}">Out</a></td>
<td><a target="_blank" href="/finesse/ref/{{suite}}/{{item[0]}}">Ref</a></td>
<td><a target="_blank" href="/finesse/view/{{view_test_id}}/diff/{{suite}}/{{item[0]}}">Diff</a></td>
<td><a target="_blank" href="/finesse/kat_history/{{suite}}/{{item[0]}}">History</a></td>
</tr>
{% endfor %}
{% endfor %}
</table>
<br/>
<br/>
<h3>Files that were OK</h3>
<table id="tblResultsOK">
<thead>
<td>Suite</td>
<td>Kat</td>
<td>Max Rel. Difference</td>
<td>View .kat</td>
<td>View .out</td>
<td>View ref</td>
<td>View Diff</td>
<td>View History
</thead>
{% for suite in kats_ok.keys() %}
{% for item in kats_ok[suite] %}
<tr>
<td>{{ suite }}</td>
<td>{{item[0]}}</td>
......@@ -44,7 +77,6 @@
{% endfor %}
{% endfor %}
</table>
</div>
</body>
<script type="text/JavaScript" src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
......@@ -72,13 +104,29 @@
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
} );
gtable = $('#tblResults').dataTable({
gtable = $('#tblResultsOK').dataTable({
"iDisplayLength":250,
"aLengthMenu": [[-1], ['All']],
"aoColumns": [
null,
null,
{ "sType": "numeric" },
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false}
]
} );
gtable = $('#tblResultsERR').dataTable({
"iDisplayLength":250,
"aLengthMenu": [[-1], ['All']],
"aoColumns": [
null,
null,
{ "sType": "numeric" },
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
......
......@@ -144,15 +144,23 @@ class FinesseProcessWatcher(Thread):
runexception = (str(err.err), str(err.out));
else:
runexception = ("","")
#check if any errors
v = self.process_to_watch.output_differences[suite][kat.replace(".kat",".out")]
if len(v) > 0:
error = True
else:
error = False
kats_run.append(dict(suite = suite,
kat = kat,
max_diff = float(max_diff),
runexception = runexception))
runexception = runexception,
error=error))
out = utils.git(["log",str(self.process_to_watch.get_version()),"-1",'--pretty="%ai"'],cwd=os.path.join(app.instance_path,"finesse_src"))
commit_date = out[0].replace("\\","").replace('"','').replace("\n","")
try:
doc = db.get('kattest', key, with_doc=True)["doc"]
......@@ -695,6 +703,30 @@ def finesse_view_diff(view_test_id, suite, kat):
return difflib.HtmlDiff().make_file(ref,out,REF_FILE,OUT_FILE,context=False)
@app.route('/finesse/view/exception/<view_test_id>/<suite>/<kat>/', methods=["GET"])
def finesse_view_exception(view_test_id,suite,kat):
view_test_id = int(view_test_id)
doc = db.get('testid',view_test_id,with_doc=True)
doc = doc["doc"]
response = None
if "kats_run" in doc:
for run in doc["kats_run"]:
if run["kat"] == kat:
print "\n\n".join(run["runexception"])
response = make_response("\n\n".join(run["runexception"]))
if response is None:
response = make_response("No error message")
response.headers["Content-type"] = "text/plain"
return response
@app.route('/finesse/view/<view_test_id>/', methods=["GET"])
def finesse_view(view_test_id):
......@@ -705,15 +737,24 @@ def finesse_view(view_test_id):
doc = db.get('testid',view_test_id,with_doc=True)
doc = doc["doc"]
kats = {}
kats_err = {}
kats_ok = {}
if "kats_run" in doc:
for run in doc["kats_run"]:
suite = run["suite"]
if not suite in kats:
kats[suite] = []
kats[suite].append((run["kat"], run["max_diff"], run["runexception"]))
if run["error"]:
if not suite in kats_err:
kats_err[suite] = []
kats_err[suite].append((run["kat"], run["max_diff"], run["runexception"]))
else:
if not suite in kats_ok:
kats_ok[suite] = []
kats_ok[suite].append((run["kat"], run["max_diff"], run["runexception"]))
else:
kats = {}
......@@ -734,7 +775,8 @@ def finesse_view(view_test_id):
view_test_id = str(view_test_id),
excp_traceback=traceback,
excp_message=message,
kats = kats)
kats_ok = kats_ok,
kats_err = kats_err)
#except RecordNotFound:
# pass
......@@ -809,6 +851,7 @@ def checkLatestCommits():
if done_all and len(commits_not_tested) == 0 and len(commits) > 0:
latest_commit_id_tested = commits[0]
elif len(commits_not_tested) > 0:
kats = dict()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment