https://bugs.webkit.org/show_bug.cgi?id=77250
Reviewed by Adam Barth.
Added admin/merge-tests. This page allows administrators to easily merge test objects.
Also add the forgotten title.png and rename api/create to admin/create since we don't allow
non-admins to create new models anyway.
* Websites/webkit-perf.appspot.com/app.yaml:
* Websites/webkit-perf.appspot.com/css: Added.
* Websites/webkit-perf.appspot.com/css/title.png: Added.
* Websites/webkit-perf.appspot.com/main.py:
* Websites/webkit-perf.appspot.com/merge_tests.yaml: Added.
* Websites/webkit-perf.appspot.com/merge_tests_handler.py: Added.
(MergeTestHandler):
(MergeTestHandler.get):
(MergeTestHandler.post):
* Websites/webkit-perf.appspot.com/models.py:
(deleteModelWithNumericIdHolder):
* Websites/webkit-perf.appspot.com/static/create-models.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106292
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-01-30 Ryosuke Niwa <rniwa@webkit.org>
+
+ webkit-perf.appspot.com should have an ability to merge tests
+ https://bugs.webkit.org/show_bug.cgi?id=77250
+
+ Reviewed by Adam Barth.
+
+ Added admin/merge-tests. This page allows administrators to easily merge test objects.
+
+ Also add the forgotten title.png and rename api/create to admin/create since we don't allow
+ non-admins to create new models anyway.
+
+ * Websites/webkit-perf.appspot.com/app.yaml:
+ * Websites/webkit-perf.appspot.com/css: Added.
+ * Websites/webkit-perf.appspot.com/css/title.png: Added.
+ * Websites/webkit-perf.appspot.com/main.py:
+ * Websites/webkit-perf.appspot.com/merge_tests.yaml: Added.
+ * Websites/webkit-perf.appspot.com/merge_tests_handler.py: Added.
+ (MergeTestHandler):
+ (MergeTestHandler.get):
+ (MergeTestHandler.post):
+ * Websites/webkit-perf.appspot.com/models.py:
+ (deleteModelWithNumericIdHolder):
+ * Websites/webkit-perf.appspot.com/static/create-models.html:
+
2012-01-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
Add manual tests for tap highlighting
application: webkit-perf
-version: 8
+version: 9
runtime: python27
api_version: 1
threadsafe: false
static_files: favicon.ico
upload: favicon\.ico
-- url: /admin/((.+)\.html)
+- url: /admin/(.+\.html)
static_files: static/\1
upload: static
secure: always
script: main.py
secure: always
-- url: /admin/report
- script: main.py
- secure: always
- login: admin
-
-- url: /api/create/(\w+)
+- url: /admin/
script: main.py
secure: always
login: admin
from report_handler import ReportHandler
from report_handler import AdminReportHandler
from runs_handler import RunsHandler
+from merge_tests_handler import MergeTestsHandler
routes = [
- ('/api/create/(.*)', CreateHandler),
+ ('/admin/report/?', AdminReportHandler),
+ ('/admin/merge-tests/?', MergeTestsHandler),
+ ('/admin/create/(.*)', CreateHandler),
('/api/test/?', ManifestHandler),
('/api/test/report/?', ReportHandler),
- ('/admin/report/?', AdminReportHandler),
('/api/test/runs/?', RunsHandler),
('/api/test/dashboard/?', DashboardHandler),
]
--- /dev/null
+<!DOCTYPE html>
+<html>
+<body>
+<h1>Merge tests</h1>
+<form method="post" action="/admin/merge-tests">
+
+<label for="merge">Merge</label>:
+<select id="merge" name="merge">
+{% for test in tests %}
+ <option value="{{ test.name }}">{{ test.name }}</option>
+{% endfor %}
+</select>
+
+<label for="into">Into</label>:
+<select id="into" name="into">
+{% for test in tests %}
+ <option value="{{ test.name }}">{{ test.name }}</option>
+{% endfor %}
+</select>
+
+<button type="submit">Merge</button>
+
+</form>
+</body>
+</html>
--- /dev/null
+#!/usr/bin/env python
+# Copyright (C) 2012 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.
+
+import webapp2
+from google.appengine.ext.webapp import template
+
+import os
+
+from models import Test
+from models import TestResult
+from models import deleteModelWithNumericIdHolder
+
+
+class MergeTestsHandler(webapp2.RequestHandler):
+ def get(self):
+ self.response.out.write(template.render('merge_tests.yaml', {'tests': Test.all()}))
+
+ def post(self):
+ self.response.headers['Content-Type'] = 'text/plain; charset=utf-8';
+
+ merge = Test.get_by_key_name(self.request.get('merge'))
+ into = Test.get_by_key_name(self.request.get('into'))
+ if not merge or not into:
+ self.response.out.write('Invalid test names')
+ return
+
+ mergedResults = TestResult.all()
+ mergedResults.filter('name =', merge.name)
+ for result in mergedResults:
+ result.name = into.name
+ result.put()
+
+ deleteModelWithNumericIdHolder(merge)
+
+ self.response.out.write('OK')
return owner
+def deleteModelWithNumericIdHolder(model):
+ idHolder = NumericIdHolder.get_by_id(model.id)
+ model.delete()
+ idHolder.delete()
+
+
def modelFromNumericId(id, expectedKind):
idHolder = NumericIdHolder.get_by_id(id)
return idHolder.owner if idHolder and idHolder.owner and isinstance(idHolder.owner, expectedKind) else None
<p>Key: canonicalized name used by build bots and storage. Name: human friendly name</p>
<h2>Builder</h2>
-<form method="post" action="/api/create/builder" onsubmit="return submitByXHR(this, event)">
+<form method="post" action="/admin/create/builder" onsubmit="return submitByXHR(this, event)">
<label for="name">Name/Key</label><input type="text" name="name">
<label for="password">Password</label><input type="password" name="password">
<button type="submit">Create</button>
</form>
<h2>Branch</h2>
-<form method="post" action="/api/create/branch" onsubmit="return submitByXHR(this, event);">
+<form method="post" action="/admin/create/branch" onsubmit="return submitByXHR(this, event);">
<label for="key">Key</label><input type="text" name="key">
<label for="name">Name</label><input type="text" name="name">
<button type="submit">Create</button>
</form>
<h2>Platform</h2>
-<form method="post" action="/api/create/platform" onsubmit="return submitByXHR(this, event)">
+<form method="post" action="/admin/create/platform" onsubmit="return submitByXHR(this, event)">
<label for="key">Key</label><input type="text" name="key">
<label for="name">Name</label><input type="text" name="name">
<button type="submit">Create</button>
$('data').value = JSON.stringify({
'branch': 'webkit-trunk',
'platform': 'chromium-mac',
- 'builder-name': 'google-mac-2',
+ 'builder-name': 'Chromium Mac Release (Perf)',
'build-number': '123',
'timestamp': parseInt(Date.now() / 1000),
'revision': 104856,