From 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Thu, 2 Jun 2011 12:07:03 +0100 Subject: Merge WebKit at r84325: Initial merge by git. Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b --- Tools/RebaselineQueueServer/app.yaml | 11 ++ Tools/RebaselineQueueServer/handlers/__init__.py | 1 + .../RebaselineQueueServer/handlers/builderqueue.py | 95 +++++++++++ Tools/RebaselineQueueServer/handlers/pages.py | 47 ++++++ Tools/RebaselineQueueServer/index.yaml | 11 ++ Tools/RebaselineQueueServer/main.py | 56 +++++++ Tools/RebaselineQueueServer/model/__init__.py | 1 + Tools/RebaselineQueueServer/model/queueentry.py | 63 ++++++++ .../static/builder-frame-empty.html | 10 ++ Tools/RebaselineQueueServer/static/styles.css | 71 +++++++++ .../templates/builder-picker.html | 74 +++++++++ .../templates/builder-queue-edit.html | 176 +++++++++++++++++++++ .../templates/builder-queue-list.html | 23 +++ Tools/RebaselineQueueServer/templates/home.html | 28 ++++ 14 files changed, 667 insertions(+) create mode 100755 Tools/RebaselineQueueServer/app.yaml create mode 100644 Tools/RebaselineQueueServer/handlers/__init__.py create mode 100644 Tools/RebaselineQueueServer/handlers/builderqueue.py create mode 100644 Tools/RebaselineQueueServer/handlers/pages.py create mode 100755 Tools/RebaselineQueueServer/index.yaml create mode 100755 Tools/RebaselineQueueServer/main.py create mode 100644 Tools/RebaselineQueueServer/model/__init__.py create mode 100644 Tools/RebaselineQueueServer/model/queueentry.py create mode 100644 Tools/RebaselineQueueServer/static/builder-frame-empty.html create mode 100644 Tools/RebaselineQueueServer/static/styles.css create mode 100644 Tools/RebaselineQueueServer/templates/builder-picker.html create mode 100644 Tools/RebaselineQueueServer/templates/builder-queue-edit.html create mode 100644 Tools/RebaselineQueueServer/templates/builder-queue-list.html create mode 100644 Tools/RebaselineQueueServer/templates/home.html (limited to 'Tools/RebaselineQueueServer') diff --git a/Tools/RebaselineQueueServer/app.yaml b/Tools/RebaselineQueueServer/app.yaml new file mode 100755 index 0000000..c425cfd --- /dev/null +++ b/Tools/RebaselineQueueServer/app.yaml @@ -0,0 +1,11 @@ +application: rebaseline-queue +version: 1 +runtime: python +api_version: 1 + +handlers: +- url: /static + static_dir: static + +- url: .* + script: main.py diff --git a/Tools/RebaselineQueueServer/handlers/__init__.py b/Tools/RebaselineQueueServer/handlers/__init__.py new file mode 100644 index 0000000..ef65bee --- /dev/null +++ b/Tools/RebaselineQueueServer/handlers/__init__.py @@ -0,0 +1 @@ +# Required for Python to search this directory for module files diff --git a/Tools/RebaselineQueueServer/handlers/builderqueue.py b/Tools/RebaselineQueueServer/handlers/builderqueue.py new file mode 100644 index 0000000..c84e07b --- /dev/null +++ b/Tools/RebaselineQueueServer/handlers/builderqueue.py @@ -0,0 +1,95 @@ +# Copyright (C) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from urllib import unquote_plus + +from google.appengine.ext import webapp +from google.appengine.ext.webapp import template +from django.utils import simplejson + +from model.queueentry import QueueEntry + + +class QueueHandler(webapp.RequestHandler): + def get(self, builder_name): + self._get(unquote_plus(builder_name)) + + def post(self, builder_name): + self._post(unquote_plus(builder_name)) + + def _queued_test_names(self, builder_name): + return [entry.test for entry in QueueEntry.entries_for_builder(builder_name)] + + def _queue_list_url(self, builder_name): + return '/builder/%s/queue' % builder_name + + +class QueueEdit(QueueHandler): + def _get(self, builder_name): + test_names = self._queued_test_names(builder_name) + self.response.out.write( + template.render("templates/builder-queue-edit.html", { + 'builder_name': builder_name, + 'queued_test_names': simplejson.dumps(test_names), + })) + + +class QueueAdd(QueueHandler): + def _post(self, builder_name): + current_tests = set(self._queued_test_names(builder_name)) + tests = set(self.request.get_all('test')).difference(current_tests) + + for test in tests: + QueueEntry.add(builder_name, test) + + self.redirect(self._queue_list_url(builder_name)) + + +class QueueRemove(QueueHandler): + def _post(self, builder_name): + tests = self.request.get_all('test') + + for test in tests: + QueueEntry.remove(builder_name, test) + + self.redirect(self._queue_list_url(builder_name)) + + +class QueueHtml(QueueHandler): + def _get(self, builder_name): + self.response.out.write( + template.render("templates/builder-queue-list.html", { + 'builder_name': builder_name, + 'entries': QueueEntry.entries_for_builder(builder_name), + })) + + +class QueueJson(QueueHandler): + def _get(self, builder_name): + queue_json = {'tests': self._queued_test_names(builder_name)} + self.response.out.write(simplejson.dumps(queue_json)) diff --git a/Tools/RebaselineQueueServer/handlers/pages.py b/Tools/RebaselineQueueServer/handlers/pages.py new file mode 100644 index 0000000..8fcf2e3 --- /dev/null +++ b/Tools/RebaselineQueueServer/handlers/pages.py @@ -0,0 +1,47 @@ +# Copyright (C) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from google.appengine.ext import webapp +from google.appengine.ext.webapp import template + +from model.queueentry import QueueEntry + + +class Home(webapp.RequestHandler): + def get(self): + builder_names = QueueEntry.builder_names() + self.response.out.write( + template.render("templates/home.html", { + 'builder_names': builder_names, + })) + + +class BuilderPicker(webapp.RequestHandler): + def get(self): + self.response.out.write( + template.render("templates/builder-picker.html", {})) diff --git a/Tools/RebaselineQueueServer/index.yaml b/Tools/RebaselineQueueServer/index.yaml new file mode 100755 index 0000000..a3b9e05 --- /dev/null +++ b/Tools/RebaselineQueueServer/index.yaml @@ -0,0 +1,11 @@ +indexes: + +# AUTOGENERATED + +# This index.yaml is automatically updated whenever the dev_appserver +# detects that a new type of query is run. If you want to manage the +# index.yaml file manually, remove the above marker line (the line +# saying "# AUTOGENERATED"). If you want to manage some indexes +# manually, move them above the marker line. The index.yaml file is +# automatically uploaded to the admin console when you next deploy +# your application using appcfg.py. diff --git a/Tools/RebaselineQueueServer/main.py b/Tools/RebaselineQueueServer/main.py new file mode 100755 index 0000000..4497d63 --- /dev/null +++ b/Tools/RebaselineQueueServer/main.py @@ -0,0 +1,56 @@ +# Copyright (C) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Request a modern Django +from google.appengine.dist import use_library +use_library('django', '1.2') + +from google.appengine.ext import webapp +from google.appengine.ext.webapp import util + +from handlers import pages +from handlers import builderqueue + + +def main(): + application = webapp.WSGIApplication([ + ('/', pages.Home), + ('/builder/picker', pages.BuilderPicker), + + # Queue CRUD operations + ('/builder/(.+)/queue/edit', builderqueue.QueueEdit), + ('/builder/(.+)/queue/add', builderqueue.QueueAdd), + ('/builder/(.+)/queue/remove', builderqueue.QueueRemove), + ('/builder/(.+)/queue', builderqueue.QueueHtml), + ('/builder/(.+)/queue/json', builderqueue.QueueJson), + ], + debug=True) + util.run_wsgi_app(application) + +if __name__ == '__main__': + main() diff --git a/Tools/RebaselineQueueServer/model/__init__.py b/Tools/RebaselineQueueServer/model/__init__.py new file mode 100644 index 0000000..ef65bee --- /dev/null +++ b/Tools/RebaselineQueueServer/model/__init__.py @@ -0,0 +1 @@ +# Required for Python to search this directory for module files diff --git a/Tools/RebaselineQueueServer/model/queueentry.py b/Tools/RebaselineQueueServer/model/queueentry.py new file mode 100644 index 0000000..6570fc0 --- /dev/null +++ b/Tools/RebaselineQueueServer/model/queueentry.py @@ -0,0 +1,63 @@ +# Copyright (C) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +from google.appengine.ext import db + + +class QueueEntry(db.Model): + test = db.StringProperty() + builder = db.StringProperty() + + @staticmethod + def add(builder_name, test): + entry = QueueEntry() + entry.builder = builder_name + entry.test = test + entry.put() + return entry + + @staticmethod + def remove(builder_name, test): + query = QueueEntry.all() + query = query.filter('builder =', builder_name).filter('test =', test) + for entry in query: + entry.delete() + + @staticmethod + def entries_for_builder(builder_name): + query = QueueEntry.all() + query = query.filter('builder =', builder_name) + return query + + @staticmethod + def builder_names(): + query = QueueEntry.all() + builder_names = set() + for entry in query: + builder_names.add(entry.builder) + return builder_names diff --git a/Tools/RebaselineQueueServer/static/builder-frame-empty.html b/Tools/RebaselineQueueServer/static/builder-frame-empty.html new file mode 100644 index 0000000..31b91bb --- /dev/null +++ b/Tools/RebaselineQueueServer/static/builder-frame-empty.html @@ -0,0 +1,10 @@ + + + + Rebaseline Queue + + + +Select a group and then a builder to see tests that are currently failing on it (if any). + + diff --git a/Tools/RebaselineQueueServer/static/styles.css b/Tools/RebaselineQueueServer/static/styles.css new file mode 100644 index 0000000..a36ff35 --- /dev/null +++ b/Tools/RebaselineQueueServer/static/styles.css @@ -0,0 +1,71 @@ +body { + font-family: Helvetica, Arial, sans-serif; + font-size: 12px; +} + +h1 { + border-bottom: solid 1px #ccc; +} + +#builder-picker body, +#add-form body { + margin: 0; +} + +#builder-picker, +#builder-picker body { + height: 100%; +} + +#builder-picker body { + display: -webkit-box; + -webkit-box-orient: vertical; +} + +#builder-picker-controls { + padding: 0.5em; + border-bottom: solid 1px black; +} + +#builder-picker-controls select { + min-width: 10em; +} + +#builder-frame { + border: 0; + -webkit-box-flex: 1; + display: block; +} + +.status { + font-size: 16px; + text-align: center; + padding: 1em; +} + +.test-table { + border-collapse: collapse; +} + +.test-table caption { + font-size: 16px; + font-weight: bold; + background: #eee; + padding: .5em; +} + +.test-table th { + text-align: left; + border-bottom: solid 1px #ccc; + background: #eee; + min-width: 8em; +} + +.test-table tbody tr:hover { + background: #ffa; +} + +.test-table .submit-row { + text-align: right; + padding: 1em 0; +} diff --git a/Tools/RebaselineQueueServer/templates/builder-picker.html b/Tools/RebaselineQueueServer/templates/builder-picker.html new file mode 100644 index 0000000..1068c04 --- /dev/null +++ b/Tools/RebaselineQueueServer/templates/builder-picker.html @@ -0,0 +1,74 @@ + + + + Rebaseline Queue: Builders + + + + + +
+ + + + + +
+ + + + + + + diff --git a/Tools/RebaselineQueueServer/templates/builder-queue-edit.html b/Tools/RebaselineQueueServer/templates/builder-queue-edit.html new file mode 100644 index 0000000..21a0f02 --- /dev/null +++ b/Tools/RebaselineQueueServer/templates/builder-queue-edit.html @@ -0,0 +1,176 @@ + + + + Rebaseline Queue: Edit + + + + + +
Loading...
+ + + + + + + diff --git a/Tools/RebaselineQueueServer/templates/builder-queue-list.html b/Tools/RebaselineQueueServer/templates/builder-queue-list.html new file mode 100644 index 0000000..79fa02a --- /dev/null +++ b/Tools/RebaselineQueueServer/templates/builder-queue-list.html @@ -0,0 +1,23 @@ + + + + {{ builder_name|escape }} Queue + + + + +

Queue: {{ builder_name|escape }}

+ +
    +{% for entry in entries %} +
  1. + {{ entry.test|escape }} +
  2. +{% empty %} + No tests found in queue. +{% endfor %} +
+ +Edit queue + + diff --git a/Tools/RebaselineQueueServer/templates/home.html b/Tools/RebaselineQueueServer/templates/home.html new file mode 100644 index 0000000..c6a16ff --- /dev/null +++ b/Tools/RebaselineQueueServer/templates/home.html @@ -0,0 +1,28 @@ + + + + Rebaseline Queue + + + + +

Rebaseline Queue

+ + + + + -- cgit v1.1