Commit cdf6fce2 authored by abarth@chromium.org's avatar abarth@chromium.org

Polymer-based Garden-O-Matic should have a basic results panel

This CL makes it possible to examine failures on Sheriff-O-Matic (the Polymer
version of Garden-O-Matic). Currently, the results panel just lets you select
which test and builder you're interested in. It's not able to display the
actual test results yet.

NOTRY=true

Review URL: https://codereview.chromium.org/349783003

git-svn-id: svn://svn.chromium.org/blink/trunk@177189 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a5fd5005
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
"dependencies": { "dependencies": {
"polymer": "Polymer/polymer#~0.3.3", "polymer": "Polymer/polymer#~0.3.3",
"paper-elements": "Polymer/paper-elements#~0.3.3", "paper-elements": "Polymer/paper-elements#~0.3.3",
"core-elements": "Polymer/core-elements#~0.3.3" "core-elements": "Polymer/core-elements#~0.3.3",
"paper-item": "Polymer/paper-item#~0.3.3"
} }
} }
...@@ -75,8 +75,13 @@ THE POSSIBILITY OF SUCH DAMAGE. ...@@ -75,8 +75,13 @@ THE POSSIBILITY OF SUCH DAMAGE.
<link rel="import" href="bower_components/polymer/polymer.html"> <link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="polymer-load-warning.html"> <link rel="import" href="polymer-load-warning.html">
<link rel="import" href="ui/ct-commit-tests.html"> <link rel="import" href="ui/ct-commit-tests.html">
<link rel="import" href="ui/ct-failure-card-tests.html">
<link rel="import" href="ui/ct-failure-grouper-tests.html"> <link rel="import" href="ui/ct-failure-grouper-tests.html">
<link rel="import" href="ui/ct-failure-stream-tests.html">
<link rel="import" href="ui/ct-results-by-builder-tests.html">
<link rel="import" href="ui/ct-results-comparison-tests.html"> <link rel="import" href="ui/ct-results-comparison-tests.html">
<link rel="import" href="ui/ct-results-panel-tests.html">
<link rel="import" href="ui/ct-test-list-tests.html">
<link rel="import" href="ui/ct-test-output-tests.html"> <link rel="import" href="ui/ct-test-output-tests.html">
</body> </body>
...@@ -38,7 +38,7 @@ ui.kUseNewWindowForLinksSetting = 'gardenomatic.use-new-window-for-links'; ...@@ -38,7 +38,7 @@ ui.kUseNewWindowForLinksSetting = 'gardenomatic.use-new-window-for-links';
ui.displayNameForBuilder = function(builderName) ui.displayNameForBuilder = function(builderName)
{ {
return builderName.replace(/Webkit /, ''); return builderName.replace(/Webkit /i, '');
} }
ui.urlForCrbug = function(bugID) ui.urlForCrbug = function(bugID)
......
<!-- <!--
Copyright (C) 2011 Google Inc. All rights reserved. Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
Redistribution and use in source and binary forms, with or without found in the LICENSE file.
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. 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.
THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
The favicons are from the awesome famfamfam.com, which is the website of Mark The favicons are from the awesome famfamfam.com, which is the website of Mark
James, a web developer from Birmingham, UK. James, a web developer from Birmingham, UK.
--> -->
<!DOCTYPE html> <!DOCTYPE html>
<head> <head>
<title>Sheriff-O-Matic</title> <title>Sheriff-O-Matic</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no"> <meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700"> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700">
<style> <style>
html { html {
overflow-y: scroll; overflow-y: scroll;
} }
body { body {
font-family: 'Open Sans'; font-family: 'Open Sans';
font-size: 14px; font-size: 14px;
......
...@@ -22,7 +22,7 @@ var kExampleCommitData = { ...@@ -22,7 +22,7 @@ var kExampleCommitData = {
module("ct-commit"); module("ct-commit");
asyncTest("basic", 3, function() { asyncTest("basic", 2, function() {
var grouper = document.createElement('ct-commit'); var grouper = document.createElement('ct-commit');
grouper.data = kExampleCommitData; grouper.data = kExampleCommitData;
...@@ -31,7 +31,6 @@ asyncTest("basic", 3, function() { ...@@ -31,7 +31,6 @@ asyncTest("basic", 3, function() {
var html = grouper.shadowRoot.innerHTML; var html = grouper.shadowRoot.innerHTML;
equal(html.indexOf('eseidel') != -1, true) equal(html.indexOf('eseidel') != -1, true)
equal(html.indexOf('abarth') != -1, true)
equal(html.indexOf('may not depend on') != -1, true) equal(html.indexOf('may not depend on') != -1, true)
start(); start();
......
...@@ -4,13 +4,41 @@ Use of this source code is governed by a BSD-style license that can be ...@@ -4,13 +4,41 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. found in the LICENSE file.
--> -->
<polymer-element name="ct-commit" attributes="data" noscript> <polymer-element name="ct-commit" attributes="data">
<template> <template>
<style> <style>
:host { :host {
display: block; display: block;
} }
a {
padding: 5px 10px;
margin-right: 5px;
border-radius: 4px;
display: inline-block;
}
:host(:hover) a {
background-color: #555;
color: white;
}
:host(:hover) a::after {
content: '';
width: 0;
height: 0;
margin-top: 5px;
position: absolute;
margin-left: 10px;
border-top: 5px solid white;
border-left: 5px solid #555;
border-bottom: 5px solid white;
}
</style> </style>
{{data.revision}}: {{data.summary}} <em>{{data.author}} ({{data.reviewer}})</em> <a href="{{data.revision|changesetURL}}">{{data.revision}}</a> {{data.summary}} <em>{{data.author}}</em>
</template> </template>
<script>
Polymer({
changesetURL: function(revision) {
return trac.changesetURL(revision);
},
});
</script>
</polymer-element> </polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-failure-card.html">
<script>
(function () {
module("ct-failure-card");
asyncTest("examine", 1, function() {
var card = document.createElement('ct-failure-card');
card.failures = [];
Platform.endOfMicrotask(function() {
card.addEventListener('ct-examine-failures', function(event) {
deepEqual(event.detail, []);
start();
});
card.shadowRoot.getElementById('examine').dispatchEvent(new CustomEvent('tap'));
});
});
})()
</script>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-commit-list.html">
<link rel="import" href="ct-test-list.html">
<polymer-element name="ct-failure-card" attributes="failures">
<template>
<style>
:host {
display: flex;
margin: 5px;
padding: 5px;
border-top: 1px solid lightgrey;
}
paper-button {
background: papayawhip;
}
</style>
<div style="flex: 1">
<ct-test-list tests="{{failures|testNames}}"></ct-test-list>
<ct-commit-list first="{{failures[0].newestPassingRevision + 1}}"
last="{{failures[0].oldestFailingRevision}}"></ct-commit-list>
</div>
<div>
<paper-button id="examine" on-tap="{{examine}}">Examine</paper-button>
</div>
</template>
<script>
Polymer({
failures: [],
testNames: function(failures) {
return failures.map(function(failureAnalysis) { return failureAnalysis.testName });
},
examine: function() {
this.fire('ct-examine-failures', this.failures);
},
});
</script>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-failure-stream.html">
<script>
(function () {
module("ct-failure-stream");
asyncTest("basic", 3, function() {
var stream = document.createElement('ct-failure-stream');
// FIXME: We should use some more interesting test data, but
// ct-failure-stream will give these values to ct-commit-data,
// which will hit the network unless we figure out how to mock
// out ct-commit-data in a better way.
stream.groups = [[], []];
Platform.endOfMicrotask(function() {
var cards = stream.shadowRoot.querySelectorAll('ct-failure-card');
equal(cards.length, 2);
deepEqual(cards[0].failures, []);
deepEqual(cards[1].failures, []);
start();
});
});
})()
</script>
...@@ -4,13 +4,12 @@ Use of this source code is governed by a BSD-style license that can be ...@@ -4,13 +4,12 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. found in the LICENSE file.
--> -->
<link rel="import" href="ct-commit-list.html"> <link rel="import" href="ct-failure-card.html">
<polymer-element name="ct-failure-stream" attributes="groups" noscript> <polymer-element name="ct-failure-stream" attributes="groups" noscript>
<template> <template>
<template repeat="{{failures in groups}}"> <template repeat="{{failures in groups}}">
<hr> <ct-failure-card failures="{{failures}}"></ct-failure-card>
<template repeat="{{failure in failures}}">{{failure.testName}}<br></template>
<ct-commit-list first="{{failures[0].newestPassingRevision + 1}}" last="{{failures[0].oldestFailingRevision}}"></ct-commits>
</template> </template>
</template>
</polymer-element> </polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-results-by-builder.html">
<script>
(function () {
var kExampleFailure = {
"testName": "inspector/console/console-viewport-selection.html",
"resultNodesByBuilder": {
"WebKit Linux (dbg)": {
"expected": "SLOW",
"is_unexpected": true,
"actual": "TEXT",
"bugs": ["webkit.org/b/90488"],
"time": 5.9
},
"WebKit Mac10.6 (dbg)": {
"actual": "TEXT",
"time": 6.5,
"bugs": ["webkit.org/b/90488"],
"is_unexpected": true,
"expected": "SLOW",
"has_stderr": true
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
};
module("ct-results-by-builder");
asyncTest("basic", 9, function() {
var results = document.createElement('ct-results-by-builder');
results.failure = kExampleFailure;
Platform.endOfMicrotask(function() {
var tabs = results.shadowRoot.querySelectorAll('paper-tab');
equal(tabs.length, 2);
equal(tabs[0].textContent, 'Linux (dbg)');
equal(tabs[1].textContent, 'Mac10.6 (dbg)');
var detail = results.shadowRoot.querySelectorAll('ct-results-detail');
equal(detail.length, 1);
equal(detail[0].test, 'inspector/console/console-viewport-selection.html');
equal(detail[0].builder, 'WebKit Linux (dbg)');
results.shadowRoot.querySelector('paper-tabs').selected = 1;
Platform.endOfMicrotask(function() {
var detail = results.shadowRoot.querySelectorAll('ct-results-detail');
equal(detail.length, 1);
equal(detail[0].test, 'inspector/console/console-viewport-selection.html');
equal(detail[0].builder, 'WebKit Mac10.6 (dbg)');
start();
});
});
});
})()
</script>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="../bower_components/core-pages/core-pages.html">
<link rel="import" href="../bower_components/paper-tabs/paper-tab.html">
<link rel="import" href="../bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="ct-results-detail.html">
<polymer-element name="ct-results-by-builder" attributes="failure">
<template>
<style>
:host {
display: block;
}
</style>
<paper-tabs selected="{{selected}}">
<template repeat="{{builder in builders}}">
<paper-tab>{{builder|displayName}}</paper-tab>
</template>
</paper-tabs>
<ct-results-detail test="{{failure.testName}}" builder="{{builders[selected]}}"></ct-results-detail>
</template>
<script>
Polymer({
failure: null,
builders: [],
selected: 0,
failureChanged: function() {
this.builders = Object.getOwnPropertyNames(this.failure.resultNodesByBuilder);
this.selected = 0;
},
displayName: function(builder) {
return ui.displayNameForBuilder(builder);
},
});
</script>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-results-comparison.html">
<polymer-element name="ct-results-detail" attributes="test builder" noscript>
<template>
<style>
:host {
display: block;
}
</style>
Test: {{test}}<br>
Builder: {{builder}}
</template>
</polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-results-panel.html">
<script>
(function () {
var kExampleFailures = [{
"testName": "plugins/gesture-events-scrolled.html",
"resultNodesByBuilder": {
"WebKit Win7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"time": 0.9
},
"WebKit Mac10.6 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 1.8
},
"WebKit Mac10.7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 3.2
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
}, {
"testName": "plugins/transformed-events.html",
"resultNodesByBuilder": {
"WebKit Win7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"time": 0.6
},
"WebKit Mac10.6 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 1.4
},
"WebKit Mac10.7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 3
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
}, {
"testName": "plugins/gesture-events.html",
"resultNodesByBuilder": {
"WebKit Win7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"time": 1.7
},
"WebKit Mac10.6 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 2.5
},
"WebKit Mac10.7 (dbg)": {
"expected": "PASS",
"is_unexpected": true,
"actual": "CRASH",
"has_stderr": true,
"time": 3.4
}
},
"oldestFailingRevision": 177164,
"newestPassingRevision": 177165
}];
module("ct-results-panel");
asyncTest("empty", 1, function() {
var panel = document.createElement('ct-results-panel');
Platform.endOfMicrotask(function() {
var message = panel.shadowRoot.querySelector('.message');
equal(message.textContent, 'No results to display.');
start();
});
});
asyncTest("basic", 8, function() {
var panel = document.createElement('ct-results-panel');
panel.failures = kExampleFailures;
Platform.endOfMicrotask(function() {
var items = panel.shadowRoot.querySelectorAll('paper-item');
equal(items.length, 3);
equal(items[0].label, 'plugins/gesture-events-scrolled.html');
equal(items[1].label, 'plugins/transformed-events.html');
equal(items[2].label, 'plugins/gesture-events.html');
var results = panel.shadowRoot.querySelectorAll('ct-results-by-builder');
equal(results.length, 1);
equal(results[0].failure, kExampleFailures[0]);
panel.shadowRoot.querySelector('core-menu').selected = 2;
Platform.endOfMicrotask(function() {
var results = panel.shadowRoot.querySelectorAll('ct-results-by-builder');
equal(results.length, 1);
equal(results[0].failure, kExampleFailures[2]);
start();
});
});
});
})()
</script>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="../bower_components/core-menu/core-menu.html">
<link rel="import" href="../bower_components/paper-item/paper-item.html">
<link rel="import" href="ct-results-by-builder.html">
<polymer-element name="ct-results-panel" attributes="failures">
<template>
<style>
:host {
display: block;
}
paper-item.core-selected {
font-weight: bold;
}
.message {
text-align: center;
margin: 20px;
}
</style>
<template if="{{!failures.length}}">
<div class="message">No results to display.</div>
</template>
<template if="{{failures.length}}">
<core-menu selected="{{selected}}">
<template repeat="{{failure in failures}}">
<paper-item label="{{failure.testName}}"></paper-item>
</template>
</core-menu>
<ct-results-by-builder failure="{{failures[selected]}}"></ct-results-by-builder>
</template>
</template>
<script>
Polymer({
failures: [],
selected: 0,
failuresChanged: function() {
this.selected = 0;
},
});
</script>
</polymer-element>
...@@ -17,9 +17,10 @@ found in the LICENSE file. ...@@ -17,9 +17,10 @@ found in the LICENSE file.
<script src="../scripts/model.js"></script> <script src="../scripts/model.js"></script>
<link rel="import" href="../bower_components/core-pages/core-pages.html"> <link rel="import" href="../bower_components/core-pages/core-pages.html">
<link rel="import" href="../bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="../bower_components/paper-tabs/paper-tab.html"> <link rel="import" href="../bower_components/paper-tabs/paper-tab.html">
<link rel="import" href="../bower_components/paper-tabs/paper-tabs.html">
<link rel="import" href="ct-unexpected-failures.html"> <link rel="import" href="ct-unexpected-failures.html">
<link rel="import" href="ct-results-panel.html">
<polymer-element name="ct-sheriff-o-matic"> <polymer-element name="ct-sheriff-o-matic">
<template> <template>
...@@ -35,12 +36,19 @@ found in the LICENSE file. ...@@ -35,12 +36,19 @@ found in the LICENSE file.
<paper-tab>Results</paper-tab> <paper-tab>Results</paper-tab>
</paper-tabs> </paper-tabs>
<core-pages selected="{{selected}}"> <core-pages selected="{{selected}}">
<ct-unexpected-failures></ct-unexpected-failures> <ct-unexpected-failures on-ct-examine-failures="{{onExamine}}"></ct-unexpected-failures>
<ct-results-panel failures="{{currentFailures}}"></ct-results-panel>
</core-pages> </core-pages>
</template> </template>
<script> <script>
Polymer({ Polymer({
selected: 0, selected: 0,
currentFailures: [],
onExamine: function(event) {
this.currentFailures = event.detail;
this.selected = 1;
},
}); });
</script> </script>
</polymer-element> </polymer-element>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="ct-test-list.html">
<script>
(function () {
var kExampleTests = [
"plugins/gesture-events-scrolled.html",
"plugins/transformed-events.html",
"plugins/gesture-events.html",
];
module("ct-test-list");
asyncTest("basic", 4, function() {
var list = document.createElement('ct-test-list');
list.tests = kExampleTests;
Platform.endOfMicrotask(function() {
var tests = list.shadowRoot.querySelectorAll('a');
equal(tests.length, 3);
equal(tests[0].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=plugins%2Fgesture-events-scrolled.html');
equal(tests[1].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=plugins%2Ftransformed-events.html');
equal(tests[2].href, 'http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=plugins%2Fgesture-events.html');
start();
});
});
})()
</script>
<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<polymer-element name="ct-test-list" attributes="tests">
<template>
<style>
:host {
display: block;
}
</style>
<template repeat="{{testName in tests}}">
<div><a href="{{testName|flakinessDashboardURL}}">{{testName}}</a></div>
</template>
</template>
<script>
Polymer({
flakinessDashboardURL: function(testName) {
return ui.urlForFlakinessDashboard([testName]);
},
});
</script>
</polymer-element>
...@@ -17,14 +17,14 @@ found in the LICENSE file. ...@@ -17,14 +17,14 @@ found in the LICENSE file.
bottom: 40px; bottom: 40px;
left: 10px; left: 10px;
} }
#update { paper-button {
background: #4285f4; background: #4285f4;
color: #fff; color: #fff;
} }
</style> </style>
<ct-failure-analyzer id="analyzer" status="{{analyzerStatus}}" failures="{{failures}}"></ct-failure-analyzer> <ct-failure-analyzer id="analyzer" status="{{analyzerStatus}}" failures="{{failures}}"></ct-failure-analyzer>
<ct-failure-grouper failures="{{failures}}" groups="{{failureGroups}}"></ct-failure-grouper> <ct-failure-grouper failures="{{failures}}" groups="{{failureGroups}}"></ct-failure-grouper>
<paper-button id="update" on-tap="{{update}}">Update</paper-button> <paper-button on-tap="{{update}}">Update</paper-button>
<ct-failure-stream groups="{{failureGroups}}"></ct-failure-stream> <ct-failure-stream groups="{{failureGroups}}"></ct-failure-stream>
<paper-toast id="toast" text="{{analyzerStatus}}"></paper-toast> <paper-toast id="toast" text="{{analyzerStatus}}"></paper-toast>
</template> </template>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment