[llvm-commits] [LNT] r154561 - in /lnt/trunk/tests: SharedInputs/SmallInstance/ SharedInputs/SmallInstance/data/ SharedInputs/SmallInstance/data/lnt.db SharedInputs/SmallInstance/lnt.cfg SharedInputs/SmallInstance/lnt.wsgi server/ui/ server/ui/V4Pages.py

Daniel Dunbar daniel at zuster.org
Wed Apr 11 16:15:28 PDT 2012


Author: ddunbar
Date: Wed Apr 11 18:15:28 2012
New Revision: 154561

URL: http://llvm.org/viewvc/llvm-project?rev=154561&view=rev
Log:
[tests] Add some minimal testing that just verifies the main UI pages render correctly.

Added:
    lnt/trunk/tests/SharedInputs/SmallInstance/
    lnt/trunk/tests/SharedInputs/SmallInstance/data/
    lnt/trunk/tests/SharedInputs/SmallInstance/data/lnt.db
    lnt/trunk/tests/SharedInputs/SmallInstance/lnt.cfg
    lnt/trunk/tests/SharedInputs/SmallInstance/lnt.wsgi   (with props)
    lnt/trunk/tests/server/ui/
    lnt/trunk/tests/server/ui/V4Pages.py

Added: lnt/trunk/tests/SharedInputs/SmallInstance/data/lnt.db
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/SmallInstance/data/lnt.db?rev=154561&view=auto
==============================================================================
Binary files lnt/trunk/tests/SharedInputs/SmallInstance/data/lnt.db (added) and lnt/trunk/tests/SharedInputs/SmallInstance/data/lnt.db Wed Apr 11 18:15:28 2012 differ

Added: lnt/trunk/tests/SharedInputs/SmallInstance/lnt.cfg
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/SmallInstance/lnt.cfg?rev=154561&view=auto
==============================================================================
--- lnt/trunk/tests/SharedInputs/SmallInstance/lnt.cfg (added)
+++ lnt/trunk/tests/SharedInputs/SmallInstance/lnt.cfg Wed Apr 11 18:15:28 2012
@@ -0,0 +1,56 @@
+# LNT configuration file
+#
+# Paths are resolved relative to this file.
+
+# The configuration file version.
+config_version = (0, 1, 0)
+
+# Name to use for this installation. This appears in web page headers, for
+# example.
+name = 'LNT'
+
+# Path to the LNT server. This is required for use in emails where we need to
+# provide an absolute URL to the server.
+zorgURL = 'http://localhost/perf'
+
+# Temporary directory, for use by the web app. This must be writable by the user
+# the web app runs as.
+tmp_dir = 'lnt_tmp'
+
+# Database directory, for easily rerooting the entire set of databases. Database
+# paths are resolved relative to the config path + this path.
+db_dir = 'data'
+
+# Secret key for this server instance.
+secret_key = '540de6a499d57deecc880ce399a95de8b7bf43fb'
+
+# The list of available databases, and their properties. At a minimum, there
+# should be a 'default' entry for the default database.
+databases = {
+    'default' : { 'path' : 'lnt.db',
+                  'showGeneral' : 1,
+                  'showNightlytest' : 1,
+                  'showSimple' : 1,
+                  'db_version' : '0.4' },
+    }
+
+# The LNT email configuration.
+#
+# The 'to' field can be either a single email address, or a list of
+# (regular-expression, address) pairs. In the latter form, the machine name of
+# the submitted results is matched against the regular expressions to determine
+# which email address to use for the results.
+nt_emailer = {
+    'enabled' : False,
+    'host' : None,
+    'from' : None,
+
+    # This is a list of (filter-regexp, address) pairs -- it is evaluated in
+    # order based on the machine name. This can be used to dispatch different
+    # reports to different email address.
+    'to' : [(".*", None)],
+    }
+
+# Enable automatic restart using the wsgi_restart module; this should be off in
+# a production environment.
+wsgi_restart = False

Added: lnt/trunk/tests/SharedInputs/SmallInstance/lnt.wsgi
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/SharedInputs/SmallInstance/lnt.wsgi?rev=154561&view=auto
==============================================================================
--- lnt/trunk/tests/SharedInputs/SmallInstance/lnt.wsgi (added)
+++ lnt/trunk/tests/SharedInputs/SmallInstance/lnt.wsgi Wed Apr 11 18:15:28 2012
@@ -0,0 +1,11 @@
+#!/venv/lnt/bin/python
+# -*- Python -*-
+
+import lnt.server.ui.app
+
+application = lnt.server.ui.app.App.create_standalone(
+  '/Users/ddunbar/lnt/tests/SharedInputs/test-instance/lnt.cfg')
+
+if __name__ == "__main__":
+    import werkzeug
+    werkzeug.run_simple('localhost', 8000, application)

Propchange: lnt/trunk/tests/SharedInputs/SmallInstance/lnt.wsgi
------------------------------------------------------------------------------
    svn:executable = *

Added: lnt/trunk/tests/server/ui/V4Pages.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/V4Pages.py?rev=154561&view=auto
==============================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py (added)
+++ lnt/trunk/tests/server/ui/V4Pages.py Wed Apr 11 18:15:28 2012
@@ -0,0 +1,60 @@
+# Perform basic sanity checking of the V4 UI pages. Currently this really only
+# checks that we don't crash on any of them.
+#
+# RUN: python %s %{shared_inputs}/SmallInstance
+
+import logging
+import sys
+import tempfile
+
+import lnt.server.db.migrate
+import lnt.server.ui.app
+
+logging.basicConfig(level=logging.DEBUG)
+
+def main():
+    _,instance_path = sys.argv
+
+    # Create the application instance.
+    app = lnt.server.ui.app.App.create_standalone(instance_path)
+
+    # Create a test client.
+    client = app.test_client()
+
+    # Fetch the index page.
+    index = client.get('/')
+
+    # Fetch the index page.
+    resp = client.get('/')
+    assert resp.status_code == 200
+
+    # Get the V4 overview page.
+    resp = client.get('/v4/nts/')
+    assert resp.status_code == 200
+
+    # Get a machine overview page.
+    resp = client.get('/v4/nts/machine/1')
+    assert resp.status_code == 200
+
+    # Get the order summary page.
+    resp = client.get('/v4/nts/all_orders')
+    assert resp.status_code == 200
+
+    # Get an order page.
+    resp = client.get('/v4/nts/order/1')
+    assert resp.status_code == 200
+
+    # Get a run result page (and associated views).
+    resp = client.get('/v4/nts/1')
+    assert resp.status_code == 200
+    resp = client.get('/v4/nts/1/report')
+    assert resp.status_code == 200
+    resp = client.get('/v4/nts/1/text_report')
+    assert resp.status_code == 200
+
+    # Get a graph page.
+    resp = client.get('/v4/nts/1/graph?test.87=2')
+    assert resp.status_code == 200
+
+if __name__ == '__main__':
+    main()





More information about the llvm-commits mailing list