OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 13 matching lines...) Expand all Loading... |
24 */ | 24 */ |
25 | 25 |
26 var model = model || {}; | 26 var model = model || {}; |
27 | 27 |
28 (function () { | 28 (function () { |
29 | 29 |
30 var kCommitLogLength = 50; | 30 var kCommitLogLength = 50; |
31 | 31 |
32 model.state = {}; | 32 model.state = {}; |
33 model.state.failureAnalysisByTest = {}; | 33 model.state.failureAnalysisByTest = {}; |
34 model.state.expectationsUpdateQueue = []; | |
35 | 34 |
36 function findAndMarkRevertedRevisions(commitDataList) | 35 function findAndMarkRevertedRevisions(commitDataList) |
37 { | 36 { |
38 var revertedRevisions = {}; | 37 var revertedRevisions = {}; |
39 $.each(commitDataList, function(index, commitData) { | 38 $.each(commitDataList, function(index, commitData) { |
40 if (commitData.revertedRevision) | 39 if (commitData.revertedRevision) |
41 revertedRevisions[commitData.revertedRevision] = true; | 40 revertedRevisions[commitData.revertedRevision] = true; |
42 }); | 41 }); |
43 $.each(commitDataList, function(index, commitData) { | 42 $.each(commitDataList, function(index, commitData) { |
44 if (commitData.revision in revertedRevisions) | 43 if (commitData.revision in revertedRevisions) |
(...skipping 20 matching lines...) Expand all Loading... |
65 if (commitData.revision != revision) | 64 if (commitData.revision != revision) |
66 continue; | 65 continue; |
67 if (fuzzyFind(failureAnalysis.testName, commitData)) { | 66 if (fuzzyFind(failureAnalysis.testName, commitData)) { |
68 failureAnalysis.oldestFailingRevision = revision; | 67 failureAnalysis.oldestFailingRevision = revision; |
69 failureAnalysis.newestPassingRevision = revision - 1; | 68 failureAnalysis.newestPassingRevision = revision - 1; |
70 return; | 69 return; |
71 } | 70 } |
72 } | 71 } |
73 } | 72 } |
74 | 73 |
75 model.queueForExpectationUpdate = function(failureInfo) | |
76 { | |
77 model.state.expectationsUpdateQueue.push(failureInfo); | |
78 }; | |
79 | |
80 model.takeExpectationUpdateQueue = function() | |
81 { | |
82 var queue = model.state.expectationsUpdateQueue; | |
83 model.state.expectationsUpdateQueue = []; | |
84 return queue; | |
85 }; | |
86 | |
87 var g_commitIndex = {}; | 74 var g_commitIndex = {}; |
88 | 75 |
89 model.updateRecentCommits = function() | 76 model.updateRecentCommits = function() |
90 { | 77 { |
91 return trac.recentCommitData('trunk', kCommitLogLength).then(function(commit
DataList) { | 78 return trac.recentCommitData('trunk', kCommitLogLength).then(function(commit
DataList) { |
92 model.state.recentCommits = commitDataList; | 79 model.state.recentCommits = commitDataList; |
93 updateCommitIndex(); | 80 updateCommitIndex(); |
94 findAndMarkRevertedRevisions(model.state.recentCommits); | 81 findAndMarkRevertedRevisions(model.state.recentCommits); |
95 }); | 82 }); |
96 }; | 83 }; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 }; | 206 }; |
220 | 207 |
221 // FIXME: Consider looking at the history to see how long this test | 208 // FIXME: Consider looking at the history to see how long this test |
222 // has been failing. | 209 // has been failing. |
223 | 210 |
224 failureCallback(failureAnalysis); | 211 failureCallback(failureAnalysis); |
225 }); | 212 }); |
226 }; | 213 }; |
227 | 214 |
228 })(); | 215 })(); |
OLD | NEW |