Dashboard tests fails to fetch the revision from commits
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Mar 2017 21:56:10 +0000 (21:56 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Mar 2017 21:56:10 +0000 (21:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=170191

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js:
Added recordedCommitIndicesByRevisionNumber.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js:
(setup): Populated trac.recordedCommitIndicesByRevisionNumber since the dashboard code uses this variable.

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

Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js
Tools/ChangeLog

index a075fb8..de28828 100644 (file)
@@ -106,4 +106,15 @@ MockTrac.EXAMPLE_TRAC_COMMITS = [
         "containsBranchLocation": true,
         "branches": ["trunk"]
     }
-];
\ No newline at end of file
+];
+
+MockTrac.recordedCommitIndicesByRevisionNumber = {
+    33018: 0,
+    33019: 1,
+    33020: 2,
+    33021: 3,
+    33022: 4,
+    33023: 5,
+    33024: 6,
+    33025: 7
+};
index a17ca7c..4b5ce4e 100644 (file)
@@ -91,6 +91,7 @@ test("_parseRevisionFromURL", function()
 test("nextRevision", function()
 {
     this.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
+    this.trac.recordedCommitIndicesByRevisionNumber = MockTrac.recordedCommitIndicesByRevisionNumber;
     strictEqual(this.trac.nextRevision("trunk", "33020"), "33022", "nextRevision same branch");
     strictEqual(this.trac.nextRevision("trunk", "33019"), "33020", "nextRevision different branch");
 });
@@ -98,12 +99,14 @@ test("nextRevision", function()
 test("indexOfRevision", function()
 {
     this.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
+    this.trac.recordedCommitIndicesByRevisionNumber = MockTrac.recordedCommitIndicesByRevisionNumber;
     strictEqual(this.trac.indexOfRevision("33020"), 2, "indexOfRevision");
 });
 
 test("commitsOnBranchLaterThanRevision", function()
 {
     this.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
+    this.trac.recordedCommitIndicesByRevisionNumber = MockTrac.recordedCommitIndicesByRevisionNumber;
     var commits = this.trac.commitsOnBranchLaterThanRevision("trunk", "33020");
     equal(commits.length, 1, "greater than 33020");
 });
@@ -111,6 +114,7 @@ test("commitsOnBranchLaterThanRevision", function()
 test("commitsOnBranchLaterThanRevision no commits", function()
 {
     this.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
+    this.trac.recordedCommitIndicesByRevisionNumber = MockTrac.recordedCommitIndicesByRevisionNumber;
     var commits = this.trac.commitsOnBranchLaterThanRevision("someOtherBranch", "33021");
     equal(commits.length, 0, "greater than 33021");
 });
@@ -118,6 +122,7 @@ test("commitsOnBranchLaterThanRevision no commits", function()
 test("commitsOnBranchInRevisionRange", function()
 {
     this.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
+    this.trac.recordedCommitIndicesByRevisionNumber = MockTrac.recordedCommitIndicesByRevisionNumber;
     var commits = this.trac.commitsOnBranchInRevisionRange("trunk", "33020", "33022");
     equal(commits.length, 2, "in range 33020, 33022");
 });
@@ -156,6 +161,7 @@ module("BuildBotQueueView", {
     setup: function() {
         this.trac = new MockTrac();
         this.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
+        this.trac.recordedCommitIndicesByRevisionNumber = MockTrac.recordedCommitIndicesByRevisionNumber;
         this.queue = new MockBuildbotQueue();
         this.trunkBranch = {
             name: "trunk",
@@ -382,6 +388,7 @@ module("BuildBotQueue", {
     setup: function() {
         Dashboard.Repository.OpenSource.trac = new MockTrac();
         Dashboard.Repository.OpenSource.trac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS;
+        Dashboard.Repository.OpenSource.trac.recordedCommitIndicesByRevisionNumber = MockTrac.recordedCommitIndicesByRevisionNumber;
         this.queue = new MockBuildbotQueue();
         this.queue.branches = [{
             name: "trunk",
index 35e4ed5..ace8cc3 100644 (file)
@@ -1,3 +1,15 @@
+2017-03-28  Aakash Jain  <aakash_jain@apple.com>
+
+        Dashboard tests fails to fetch the revision from commits
+        https://bugs.webkit.org/show_bug.cgi?id=170191
+
+        Reviewed by Alexey Proskuryakov.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js:
+        Added recordedCommitIndicesByRevisionNumber.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js:
+        (setup): Populated trac.recordedCommitIndicesByRevisionNumber since the dashboard code uses this variable.
+
 2017-03-28  Timothy Horton  <timothy_horton@apple.com>
 
         Safari crashes when attempting to close tab that is displaying PDF