[LNT] r278905 - Merge branch 'feature/console'
Chris Matthews via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 16 23:06:16 PDT 2016
Author: cmatthews
Date: Wed Aug 17 01:06:16 2016
New Revision: 278905
URL: http://llvm.org/viewvc/llvm-project?rev=278905&view=rev
Log:
Merge branch 'feature/console'
Added:
lnt/trunk/lnt/server/db/migrations/new_suite.py
Modified:
lnt/trunk/lnt/lnttool/main.py
Modified: lnt/trunk/lnt/lnttool/main.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/main.py?rev=278905&r1=278904&r2=278905&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/main.py (original)
+++ lnt/trunk/lnt/lnttool/main.py Wed Aug 17 01:06:16 2016
@@ -18,6 +18,8 @@ from lnt import testing
from lnt.testing.util.commands import note, warning, error, fatal, LOGGER_NAME
import lnt.testing.profile.profile as profile
+import code
+
def action_runserver(name, args):
"""start a new development server"""
@@ -52,6 +54,8 @@ view the results.\
default=None)
parser.add_option("", "--profiler", dest="profiler", default=False,
action="store_true", help="enable WSGI profiler")
+ parser.add_option("", "--shell", dest="shell", default=False,
+ action="store_true", help="Load in shell.")
parser.add_option("", "--show-sql", dest="show_sql", default=False,
action="store_true", help="show all SQL queries")
parser.add_option("", "--threaded", dest="threaded", default=False,
@@ -97,7 +101,18 @@ view the results.\
app.wsgi_app = werkzeug.contrib.profiler.ProfilerMiddleware(
app.wsgi_app, stream = open(opts.profiler_file, 'w'),
profile_dir = opts.profiler_dir)
- app.run(opts.hostname, opts.port,
+ if opts.shell:
+ from flask import current_app
+ from flask import g
+ ctx = app.test_request_context()
+ ctx.push()
+
+ vars = globals().copy()
+ vars.update(locals())
+ shell = code.InteractiveConsole(vars)
+ shell.interact()
+ else:
+ app.run(opts.hostname, opts.port,
use_reloader = opts.reloader,
use_debugger = opts.debugger,
threaded = opts.threaded,
Added: lnt/trunk/lnt/server/db/migrations/new_suite.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrations/new_suite.py?rev=278905&view=auto
==============================================================================
--- lnt/trunk/lnt/server/db/migrations/new_suite.py (added)
+++ lnt/trunk/lnt/server/db/migrations/new_suite.py Wed Aug 17 01:06:16 2016
@@ -0,0 +1,19 @@
+from . import upgrade_0_to_1
+from . import upgrade_2_to_3
+from . import upgrade_7_to_8
+from . import upgrade_8_to_9
+
+
+def init_new_testsuite(engine, session, name):
+ """When all the metadata fields are setup for a suite, call this
+ to provision the tables."""
+ # We only need to do the test-suite agnostic upgrades,
+ # most of the upgrades target nts or compile only.
+ upgrade_0_to_1.initialize_testsuite(engine, session, name)
+ session.commit()
+ upgrade_2_to_3.upgrade_testsuite(engine, session, name)
+ session.commit()
+ upgrade_7_to_8.upgrade_testsuite(engine, session, name)
+ session.commit()
+ upgrade_8_to_9.upgrade_testsuite(engine, session, name)
+ session.commit()
More information about the llvm-commits
mailing list