[llvm-commits] [zorg] r147997 - in /zorg/trunk/lnt/lnt/server: db/testsuitedb.py ui/views.py
Daniel Dunbar
daniel at zuster.org
Wed Jan 11 17:27:37 PST 2012
Author: ddunbar
Date: Wed Jan 11 19:27:36 2012
New Revision: 147997
URL: http://llvm.org/viewvc/llvm-project?rev=147997&view=rev
Log:
[lnt/v0.4] lnt.server.db.testsuitedb: Add a field to v0.4 Run's to allow them to specify what simple/ style run ID they are matched to.
- This is part of an effort to allow us to migrate to using a v0.4 database without breaking any old URLs which have found their way into bug reports, etc.
- WIP for <rdar://problem/10665231> [lnt] Support old simple/ links in v0.4 schema
- I still don't know how I am going to go about populating this column (maybe just a batch job offline), but at least the DB has room for it.
- No support for handling graph links yet (which requires translating the options as well).
Modified:
zorg/trunk/lnt/lnt/server/db/testsuitedb.py
zorg/trunk/lnt/lnt/server/ui/views.py
Modified: zorg/trunk/lnt/lnt/server/db/testsuitedb.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/db/testsuitedb.py?rev=147997&r1=147996&r2=147997&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/db/testsuitedb.py (original)
+++ zorg/trunk/lnt/lnt/server/db/testsuitedb.py Wed Jan 11 19:27:36 2012
@@ -169,6 +169,7 @@
imported_from = Column("ImportedFrom", String(512))
start_time = Column("StartTime", DateTime)
end_time = Column("EndTime", DateTime)
+ simple_run_id = Column("SimpleRunID", Integer)
# The parameters blob is used to store any additional information
# reported by the run but not promoted into the machine record. Such
Modified: zorg/trunk/lnt/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/views.py?rev=147997&r1=147996&r2=147997&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/views.py (original)
+++ zorg/trunk/lnt/lnt/server/ui/views.py Wed Jan 11 19:27:36 2012
@@ -172,8 +172,12 @@
from lnt.db import perfdbsummary
from lnt.util import NTEmailReport
- at db_route("/simple/<tag>/")
+ at db_route("/simple/<tag>/", only_v3=False)
def simple_overview(tag):
+ # If this is a v0.4 database, redirect.
+ if g.db_info.db_version != '0.3':
+ return redirect(db_url_for("v4_overview", testsuite_name=tag))
+
db = request.get_db()
# Get the most recent runs in this tag, we just arbitrarily limit to looking
@@ -268,9 +272,32 @@
response.mimetype = "text/plain"
return response
- at db_route("/simple/<tag>/<int:id>")
- at db_route("/simple/<tag>/<int:id>/")
+ at db_route("/simple/<tag>/<int:id>/", only_v3=False)
def simple_run(tag, id):
+ # If this is a v0.4 database, redirect.
+ if g.db_info.db_version != '0.3':
+ # Attempt to find a V4 run which declares that it matches this simple
+ # run ID.
+
+ # Get the expected test suite.
+ db = request.get_db()
+ ts = db.testsuite[tag]
+
+ # Look for a matched run.
+ matched_run = ts.query(ts.Run).\
+ filter(ts.Run.simple_run_id == id).\
+ first()
+
+ # If we found one, redirect to it's report.
+ if matched_run is not None:
+ return redirect(db_url_for("v4_run", testsuite_name=tag,
+ id=matched_run.id))
+
+ # Otherwise, report an error.
+ return render_template("error.html", message="""\
+Unable to find a v0.4 run for this ID. Please use the native v0.4 URL interface
+(instead of the /simple/... URL schema).""")
+
db, run, run_summary, compare_to = get_simple_run_info(tag, id)
# Get additional summaries.
More information about the llvm-commits
mailing list