Adding layout tests for the bot watcher's dashboard QUnit tests. https://bugs.webkit...
authorjmarcell@apple.com <jmarcell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2016 21:08:40 +0000 (21:08 +0000)
committerjmarcell@apple.com <jmarcell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Apr 2016 21:08:40 +0000 (21:08 +0000)
Reviewed by Daniel Bates.

Moved supporting resources into a resources folder and updated index.html accordingly
to point to the new locations. Added code to tests.js to dumpAsText when QUnit is done.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index-expected.txt: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index.html: Updated to point to tests.js and Mock files in resources directory.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueue.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueue.js.
(MockBuildbotQueue):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueueView.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueueView.js.
(MockBuildbotQueueView):
(MockBuildbotQueueView.prototype._latestProductiveIteration):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js.
(MockTrac):
(MockTrac.prototype.get oldestRecordedRevisionNumber):
(MockTrac.prototype.get latestRecordedRevisionNumber):
(MockTrac.prototype.loadMoreHistoricalData):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-git-trac-rss.xml: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-git-trac-rss.xml.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-trac-rss.xml: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-trac-rss.xml.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js.
Updated the unit tests for Trac._loaded() to point to the XML files that are now located in the 'resources' directory.
(QUnit.done): Added. Removes machine-specific output from test results and calls testRunner.notifyDone to let the layout test harness know that all testing is done.
* Scripts/run-dashboard-tests: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199180 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index-expected.txt [new file with mode: 0644]
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index.html
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueue.js [moved from Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueue.js with 100% similarity]
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueueView.js [moved from Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueueView.js with 100% similarity]
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js [moved from Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js with 100% similarity]
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-git-trac-rss.xml [moved from Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-git-trac-rss.xml with 100% similarity]
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-trac-rss.xml [moved from Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-trac-rss.xml with 100% similarity]
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js [moved from Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js with 96% similarity]
Tools/ChangeLog
Tools/Scripts/run-dashboard-tests [new file with mode: 0755]

diff --git a/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index-expected.txt b/Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index-expected.txt
new file mode 100644 (file)
index 0000000..2049446
--- /dev/null
@@ -0,0 +1,34 @@
+WebKit Bot Watcher's Dashboard QUnit Test Runner noglobalsnotrycatch
+Hide passed tests
+Trac: _loaded (0, 8, 8)Rerun
+Trac: parse gitBranches (0, 7, 7)Rerun
+Trac: _parseRevisionFromURL (0, 3, 3)Rerun
+Trac: nextRevision (0, 2, 2)Rerun
+Trac: indexOfRevision (0, 1, 1)Rerun
+Trac: commitsOnBranchLaterThanRevision (0, 1, 1)Rerun
+Trac: commitsOnBranchLaterThanRevision no commits (0, 1, 1)Rerun
+Trac: commitsOnBranchInRevisionRange (0, 1, 1)Rerun
+BuildBotQueueView: _appendPendingRevisionCount (0, 1, 1)Rerun
+BuildBotQueueView: _popoverLinesForCommitRange (0, 1, 1)Rerun
+BuildBotQueueView: _presentPopoverForPendingCommits (0, 1, 1)Rerun
+BuildBotQueueView: _presentPopoverForPendingCommits no pending commits (0, 1, 1)Rerun
+BuildBotQueueView: _presentPopoverForRevisionRange (0, 1, 1)Rerun
+BuildBotQueueView: _presentPopoverForRevisionRange no commits (0, 1, 1)Rerun
+BuildBotQueueView: _revisionContentWithPopoverForIteration (0, 3, 3)Rerun
+BuildBotQueueView: _revisionContentWithPopoverForIteration has previousIteration (0, 4, 4)Rerun
+BuildBotQueueView: _formatRevisionForDisplay Subversion (0, 1, 1)Rerun
+BuildBotQueueView: _formatRevisionForDisplay Git (0, 1, 1)Rerun
+BuildBotQueue: compareIterations by revisions (0, 3, 3)Rerun
+BuildBotQueue: compareIterations by loaded (one revision missing) (0, 2, 2)Rerun
+BuildBotQueue: compareIterations by loaded (same revision) (0, 2, 2)Rerun
+BuildBotQueue: compareIterations by id (revisions not specified) (0, 3, 3)Rerun
+BuildBotQueue: compareIterations by id (same revision) (0, 3, 3)Rerun
+BuildBotQueue: compareIterationsByRevisions (0, 3, 3)Rerun
+r33022bob@webkit.orgcommit message
+commits since previous result
+r33020george@webkit.orgcommit message
+r33018john@webkit.orgcommit message
+no commits to trunk since previous result
+commits since previous result
+r33022bob@webkit.orgcommit message
+r33020george@webkit.orgcommit message
index cb4245d..ab81b8d 100644 (file)
@@ -62,10 +62,10 @@ THE POSSIBILITY OF SUCH DAMAGE.
     <script src="../Settings.js"></script>
     <script src="../Trac.js"></script>
     <script src="../../../../../../../Source/ThirdParty/qunit/qunit/qunit.js"></script>
-    <script src="MockTrac.js"></script>
-    <script src="MockBuildbotQueue.js"></script>
-    <script src="MockBuildbotQueueView.js"></script>
-    <script src="tests.js"></script>
+    <script src="resources/MockTrac.js"></script>
+    <script src="resources/MockBuildbotQueue.js"></script>
+    <script src="resources/MockBuildbotQueueView.js"></script>
+    <script src="resources/tests.js"></script>
 
 </head>
 <body>
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+if (window.testRunner) {
+    window.testRunner.dumpAsText();
+    window.testRunner.waitUntilDone();
+}
+
+QUnit.done = function(details) {
+    if (window.testRunner) {
+        var element = document.getElementById("qunit-testresult");
+        element.parentNode.removeChild(element);
+        element = document.getElementById("qunit-userAgent");
+        element.parentNode.removeChild(element);
+        window.testRunner.notifyDone();
+    }
+};
+
 module("Trac", {
     setup: function() {
         this.trac = new MockTrac();
@@ -33,7 +48,7 @@ test("_loaded", function()
 {
     this.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
     var client = new XMLHttpRequest();
-    client.open('GET', 'test-fixture-trac-rss.xml', false);
+    client.open("GET", "resources/test-fixture-trac-rss.xml", false);
     client.onload = function () {
         this.trac._loaded(client.responseXML);
     }.bind(this);
@@ -50,7 +65,7 @@ test("_loaded", function()
 test("parse gitBranches", function()
 {
     var client = new XMLHttpRequest();
-    client.open("GET", "test-fixture-git-trac-rss.xml", false);
+    client.open("GET", "resources/test-fixture-git-trac-rss.xml", false);
     client.onload = function () {
         this.trac._loaded(client.responseXML);
     }.bind(this);
index 5667854..8d9dd15 100644 (file)
@@ -1,3 +1,38 @@
+2016-04-07  Jason Marcell  <jmarcell@apple.com>
+
+        Adding layout tests for the bot watcher's dashboard QUnit tests.
+        https://bugs.webkit.org/show_bug.cgi?id=155272
+
+        Reviewed by Daniel Bates.
+
+        Moved supporting resources into a resources folder and updated index.html accordingly
+        to point to the new locations. Added code to tests.js to dumpAsText when QUnit is done.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index-expected.txt: Added.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index.html: Updated to point to tests.js and Mock files in resources directory.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueue.js: Renamed from
+        Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueue.js.
+        (MockBuildbotQueue):
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueueView.js: Renamed from
+        Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueueView.js.
+        (MockBuildbotQueueView):
+        (MockBuildbotQueueView.prototype._latestProductiveIteration):
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js: Renamed from
+        Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js.
+        (MockTrac):
+        (MockTrac.prototype.get oldestRecordedRevisionNumber):
+        (MockTrac.prototype.get latestRecordedRevisionNumber):
+        (MockTrac.prototype.loadMoreHistoricalData):
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-git-trac-rss.xml: Renamed from
+        Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-git-trac-rss.xml.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-trac-rss.xml: Renamed from
+        Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-trac-rss.xml.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js: Renamed from
+        Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js.
+        Updated the unit tests for Trac._loaded() to point to the XML files that are now located in the 'resources' directory.
+        (QUnit.done): Added. Removes machine-specific output from test results and calls testRunner.notifyDone to let the layout test harness know that all testing is done.
+        * Scripts/run-dashboard-tests: Added.
+
 2016-04-06  ChangSeok Oh  <changseok@webkit.org>
 
         Unreviewed, Update my primary email address and expertise.
diff --git a/Tools/Scripts/run-dashboard-tests b/Tools/Scripts/run-dashboard-tests
new file mode 100755 (executable)
index 0000000..6116b2c
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Copyright (C) 2016 Apple 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:
+# 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. ``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
+# 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.
+
+TOOLS_DIRECTORY="$(dirname $0)"
+RUN_WEBKIT_TESTS="$TOOLS_DIRECTORY/run-webkit-tests"
+TEST_DIRECTORY="$TOOLS_DIRECTORY/../BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests"
+
+$RUN_WEBKIT_TESTS --layout-tests-directory=$TEST_DIRECTORY "$@"