[LNT] r236331 - print a handy link to the results after LNT submits
Chris Matthews
cmatthews5 at apple.com
Fri May 1 11:48:05 PDT 2015
Author: cmatthews
Date: Fri May 1 13:48:05 2015
New Revision: 236331
URL: http://llvm.org/viewvc/llvm-project?rev=236331&view=rev
Log:
print a handy link to the results after LNT submits
It is really handy to be able to go right to a run result from the
console. Have the server prepare a link and print it on finish.
Modified:
lnt/trunk/lnt/lnttool/main.py
lnt/trunk/lnt/server/ui/views.py
lnt/trunk/lnt/tests/compile.py
lnt/trunk/lnt/util/ImportData.py
Modified: lnt/trunk/lnt/lnttool/main.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/main.py?rev=236331&r1=236330&r2=236331&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/main.py (original)
+++ lnt/trunk/lnt/lnttool/main.py Fri May 1 13:48:05 2015
@@ -152,7 +152,9 @@ def action_runtest(name, args):
except KeyError:
parser.error('invalid test name %r' % test_name)
- test_instance.run_test('%s %s' % (name, test_name), args)
+ server_results = test_instance.run_test('%s %s' % (name, test_name), args)
+ print "Results available at:", server_results['result_url']
+
def action_showtests(name, args):
"""show the available built-in tests"""
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=236331&r1=236330&r2=236331&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Fri May 1 13:48:05 2015
@@ -118,6 +118,10 @@ def submit_run():
result = lnt.util.ImportData.import_and_report(
current_app.old_config, g.db_name, db, path, '<auto>', commit)
+ # It is nice to have a full URL to the run, so fixup the request URL
+ # here were we know more about the flask instance.
+ result['result_url'] = request.url_root + result['result_url']
+
return flask.jsonify(**result)
return render_template("submit_run.html")
Modified: lnt/trunk/lnt/tests/compile.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/tests/compile.py?rev=236331&r1=236330&r2=236331&view=diff
==============================================================================
--- lnt/trunk/lnt/tests/compile.py (original)
+++ lnt/trunk/lnt/tests/compile.py Fri May 1 13:48:05 2015
@@ -1034,9 +1034,10 @@ class CompileTest(builtintest.BuiltinTes
if opts.output is not None:
self.print_report(report, opts.output)
- self.submit(lnt_report_path, opts)
+ server_report = self.submit(lnt_report_path, opts)
+
+ return server_report
- return report
def create_instance():
return CompileTest()
Modified: lnt/trunk/lnt/util/ImportData.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/util/ImportData.py?rev=236331&r1=236330&r2=236331&view=diff
==============================================================================
--- lnt/trunk/lnt/util/ImportData.py (original)
+++ lnt/trunk/lnt/util/ImportData.py Fri May 1 13:48:05 2015
@@ -92,7 +92,11 @@ def import_and_report(config, db_name, d
if config:
report_url = "%s/db_%s/" % (config.zorgURL, db_name)
else:
- report_url = 'localhost'
+ report_url = "localhost"
+ # Add a handy relative link to the submitted run.
+ ts_name = data['Run']['Info'].get('tag')
+ result['result_url'] = "db_{}/v4/{}/{}".format(db_name, ts_name, run.id)
+
if not disable_report:
NTEmailReport.emailReport(result, db, run, report_url,
email_config, toAddress, success, commit)
More information about the llvm-commits
mailing list