Commit 6ab2a901 authored by Daniel Brown's avatar Daniel Brown
Browse files

changing layout and fixing which files have error

parent cedb1572
......@@ -262,7 +262,9 @@ class FinesseTestProcess(Thread):
OUT_FILE = os.path.join(SUITE_PATH,basename + ".out")
shutil.move(OUT_FILE, SUITE_OUTPUT_DIR)
LOG_FILE = os.path.join(SUITE_PATH,basename + ".log")
shutil.move(LOG_FILE, SUITE_OUTPUT_DIR)
except utils.RunException as e:
print "STDERR: " + e.out
......@@ -334,14 +336,14 @@ class FinesseTestProcess(Thread):
# store the rows which are different
ix = np.where(rel_diff >= self.diff_rel_eps)[0][0]
self.output_differences[suite][out] = (ref_arr[ix],
self.output_differences[suite][out] = (True,
ref_arr[ix],
out_arr[ix],
np.max(rel_diff))
else:
max = np.max(rel_diff)
self.output_differences[suite][out] = ([],
[],
self.output_differences[suite][out] = (False,
max)
self.done_kats += 1
......@@ -373,10 +375,15 @@ class FinesseTestProcess(Thread):
for k in self.output_differences[suite].keys():
isError = True
f.write(k + ":\n")
f.write(" ref: " + str(self.output_differences[suite][k][0]) + "\n")
f.write(" out: " + str(self.output_differences[suite][k][1]) + "\n")
f.write(" Max relative difference: " + str(self.output_differences[suite][k][2]) + "\n")
if self.output_differences[suite][k][0]:
f.write(" Differences larger than " + str(self.diff_rel_eps) + "\n")
f.write(" ref: " + str(self.output_differences[suite][k][1]) + "\n")
f.write(" out: " + str(self.output_differences[suite][k][2]) + "\n")
f.write(" Max relative difference: " + str(self.output_differences[suite][k][3]) + "\n")
else:
f.write(" Differences smaller than " + str(self.diff_rel_eps) + "\n")
f.write(" Max relative difference: " + str(self.output_differences[suite][k][1]) + "\n")
f.write("\n\n" + str(len(self.output_differences[suite].keys())) + " errors in suite " + suite)
for k in self.kat_run_exceptions[suite].keys():
isError = True
......
......@@ -21,10 +21,10 @@
<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 log</td>
<td>View Diff</td>
<td>View History
</thead>
......@@ -34,14 +34,10 @@
<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/log/{{view_test_id}}/{{suite}}/{{item[0]}}">Log</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>
......@@ -59,6 +55,7 @@
<td>View .kat</td>
<td>View .out</td>
<td>View ref</td>
<td>View log</td>
<td>View Diff</td>
<td>View History
</thead>
......@@ -71,6 +68,7 @@
<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/log/{{view_test_id}}/{{suite}}/{{item[0]}}">Log</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>
......@@ -115,6 +113,7 @@
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false},
{"bSearchable": false, "bSortable": false}
]
} );
......
......@@ -135,7 +135,11 @@ class FinesseProcessWatcher(Thread):
out = kat.replace(".kat",".out")
if out in self.process_to_watch.output_differences[suite]:
max_diff = self.process_to_watch.output_differences[suite][out][2]
print "asdasd", self.process_to_watch.output_differences[suite][out]
if self.process_to_watch.output_differences[suite][out][0]:
max_diff = self.process_to_watch.output_differences[suite][out][3]
else:
max_diff = self.process_to_watch.output_differences[suite][out][1]
else:
max_diff = float('NaN')
......@@ -143,20 +147,16 @@ class FinesseProcessWatcher(Thread):
err = self.process_to_watch.kat_run_exceptions[suite][kat];
runexception = (str(err.err), str(err.out));
else:
runexception = ("","")
runexception = None
#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
vals = self.process_to_watch.output_differences[suite][kat.replace(".kat",".out")]
kats_run.append(dict(suite = suite,
kat = kat,
max_diff = float(max_diff),
runexception = runexception,
error=error))
error=vals[0]))
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","")
......@@ -658,6 +658,21 @@ def finesse_view_ref(suite, out):
response.headers["Content-type"] = "text/plain"
return response
@app.route('/finesse/log/<test_id>/<suite>/<kat>', methods=["GET"])
def finesse_view_log(test_id,suite, kat):
log = str(kat).replace(".kat",".log")
OUT_FILE = os.path.join(app.instance_path,"tests",str(test_id),"outputs",suite,log)
if os.path.exists(OUT_FILE):
contents = open(OUT_FILE).read()
else:
contents = "log file not found"
response = make_response(contents)
response.headers["Content-type"] = "text/plain"
return response
@app.route('/finesse/kat_history/<suite>/<kat>', methods=["GET"])
def finesse_view_kat_history(suite, kat):
......@@ -712,12 +727,14 @@ def finesse_view_exception(view_test_id,suite,kat):
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"]))
print run["runexception"]
print "\n\n".join(str(run["runexception"]))
response = make_response("\n\n".join(str(run["runexception"])))
else:
print "NOTHING"
if response is None:
response = make_response("No error message")
......@@ -744,7 +761,7 @@ def finesse_view(view_test_id):
for run in doc["kats_run"]:
suite = run["suite"]
print "RUN ERROR",run["error"]
if run["error"]:
if not suite in kats_err:
kats_err[suite] = []
......
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