1 2013-11-06 Ryosuke Niwa <rniwa@webkit.org>
3 New flakiness dashboard should generate JSON in the background process
4 https://bugs.webkit.org/show_bug.cgi?id=123797
6 Reviewed by Alexey Proskuryakov.
8 * config.json: Add defaultBuildWaitInterval used by process-builds.php.
9 * init-database.sql: Add is_process column to builds table so that we can track of "unprocessed" builds.
11 * public/admin/process-builds.php: Added.
12 (process_latest_five_builds): Update flakiness states and generate JSONs for the latest five builds.
13 We go backwards in the time so that we don't end up infinite looping over a single build that fails.
14 (main): Call processed_builds with an exponential back off.
16 * public/api/report.php:
17 (store_results): No need to return build or builder ids.
18 (main): Don't update flakiness states or generate JSONs.
20 * public/include/test-results.php:
21 (add_build): Take the slave name; it doesn't make any sense to create a build without it and later
22 updating it in store_test_results.
23 (store_test_results): Once new test results are added, explicitly mark this build as unprocessed.
25 2013-11-04 Ryosuke Niwa <rniwa@webkit.org>
27 Build fix. Update is_flaky when it's NULL.
29 * public/include/test-results.php:
31 2013-11-04 Ryosuke Niwa <rniwa@webkit.org>
33 JSON generation on new flakiness dashboard is still too slow
34 https://bugs.webkit.org/show_bug.cgi?id=123776
36 Reviewed by Mark Rowe.
38 * init-database.sql: Added a constraint that result is unique for each (build, test) pair.
40 * public/include/test-results.php:
41 (ResultsJSONGenerator::generate): Don't sort results by latest_revision_time since that's done
42 in the client side anyway.
43 (update_flakiness_for_build): Don't update is_flaky flag if it's already set to the right value.
46 2013-11-04 Ryosuke Niwa <rniwa@webkit.org>
48 Build fixes. In particular, we were missing the code to generate JSONs in report.php :(
50 * public/api/report.php:
51 * public/include/test-results.php:
53 2013-11-04 Ryosuke Niwa <rniwa@webkit.org>
55 Fix JSON generations on new flakiness dashboard
56 https://bugs.webkit.org/show_bug.cgi?id=123723
58 Reviewed by Andreas Kling.
60 Add is_flaky column on results table so that this column can be used to find flaky tests on a given builder
61 efficiently without having to through results for all tests in PHP. This column is updated in report.php
62 when a new build is added. Because is_flaky depends on the preceding and succeeding results, we must update
63 is_flaky flag on results for builds immediately before and after the new build as well.
65 To see why, suppose we had two consecutive results [PASS] [PASS]. If we were to insert [FAIL] result between
66 the two, those two results may also turn into flaky results if they were surrounded by [FAIL]. Similarly,
67 if we had [PASS] [FAIL] and the second result was marked flaky, inserting new [FAIL] must unmark it.
70 * init-database.sql: Added is_flaky column to results table with an index. Also added an index on
71 build_revisions.time as many queries filter results by this quantity. Also set the work_mem to 50MB avoid
72 disk thrashing while sorting results in various queries.
74 * public/api/failing-tests.php: Handle builder ids as well as names. Call generate() with failure types.
75 No longer generates *-failing.json since it's a subset of *-wrongexpectations.json to save time.
77 * public/api/report.php: Rewritten. Calls update_flakiness_after_inserting_build to update is_flaky flags
78 on the newly added results.
79 (store_results): Added.
82 * public/include/test-results.php:
84 (ResultsJSONWriter::add_results_for_test): Renamed from add_results_for_test_if_matches.
85 (ResultsJSONGenerator::generate): Takes the failure type. Instead of generating JSONs for all failure types
86 at once, generate one JSON for the specified type. We generate the list of test ids based on the failure type
87 and query results based on that. This dramatically cuts down the time spent in PHP.
88 (ResultsJSONGenerator::latest_build): Added.
89 (ResultsJSONGenerator::write_jsons): Takes single writer now.
90 (update_flakiness_for_build): Added.
91 (update_flakiness_after_inserting_build): Added.
94 (TestResultsView._populateBuilderPane): Emulate *-failing.json upon *-wrongexpectations.json.
95 (TestResultsView.fetchFailingTestsForBuilder): Ditto.
97 * public/main.css: Minor style tweaks.
98 (.testResults): Extend the border that wraps the test results as needed.
99 (.tooltip): Don't wrap text inside tooltips.
101 2013-10-26 Ryosuke Niwa <rniwa@webkit.org>
103 Make new bug link in flakiness dashboard configurable
104 https://bugs.webkit.org/show_bug.cgi?id=123386
106 Reviewed by Alexey Proskuryakov.
108 * config.json: Added Bugzilla as the default destination for new bugs.
109 * public/api/manifest.php: Include newBugLinks in the manifest.
111 (TestResultsView): Initialize _newBugLinks.
112 (TestResultsView.setNewBugLinks): Added.
113 (TestResultsView._populateTestPane):
114 (TestResultsView._createTestResultRow): Replaced the hard-coded Bugzilla URL by the code
115 to generate hyper-links based on _newBugLinks. Also added a nullity check while formatting
116 revision checks so that we don't blow up when some build doesn't contain all revision info.
117 (TestResultsView._populateBuilderPane):
119 2013-10-26 Ryosuke Niwa <rniwa@webkit.org>
121 New flakiness dashboard should support substring matching
122 https://bugs.webkit.org/show_bug.cgi?id=123393
124 Reviewed by Alexey Proskuryakov.
126 Addressed the use cases by
127 1. Always showing the candidate even when there is exactly one test matching the current value.
128 2. Adding all tests that match the current value upon the user pressing enter key.
131 (fetchManifest): Add all tests that match the current value. Confirm whether the user really
132 want to add all the tests when there are more than 15 tests to add.
133 * public/js/autocompleter.js:
134 (Autocompleter.prototype.filterCandidates): Extracted from _updateCandidates.
135 (Autocompleter.prototype._updateCandidates): Show the candidate window even when there is
136 exactly one test that matches the criteria so that the user can select this test.
138 2013-10-26 Ryosuke Niwa <rniwa@webkit.org>
140 New flakiness dashboard shouldn't treat tests with right expectations as failing
141 https://bugs.webkit.org/show_bug.cgi?id=123385
143 Reviewed by Alexey Proskuryakov.
145 We define failing tests to be tests with wrong expectations whose actual results are not PASS
146 since tests with TEXT, IMAGE, etc... failures do not turn the bots red as long as the expectation
147 of the same type is specified in TestExpectation files.
149 * public/include/test-results.php:
150 (FailingResultsJSONWriter): Inherit from WrongExpectationsResultsJSONWriter.
152 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
154 Build fix. The query results weren't sorted by the latest commit time,
155 yielding wrong set of tests to be listed in the builder pane.
157 * public/include/test-results.php:
159 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
161 Links in new flakiness dashboard could benefit from tooltips
162 https://bugs.webkit.org/show_bug.cgi?id=123381
164 Reviewed by Alexey Proskuryakov.
166 Add title content attribute on each hyperlink in the builder pane.
169 (TestResultsView._populateBuilderPane):
171 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
173 Commit the right change.
177 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
179 The new flakiness dashboard should sort builder and test names
180 https://bugs.webkit.org/show_bug.cgi?id=123363
182 Reviewed by Simon Fraser.
184 Sort the forgotten builders in the menu.
188 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
190 The new flakiness dashboard should sort builder and test names
191 https://bugs.webkit.org/show_bug.cgi?id=123363
193 Reviewed by Simon Fraser.
195 Sort builders and tests by their name in each pane.
198 (TestResultsView._populateTestPane): Lexicologically sort builders by their name.
199 (TestResultsView._sortObjectsByName): Added.
200 (TestResultsView._populateBuilderPane): Lexicologically sort builders by their name.
202 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
204 Merge revision columns in flakiness dashboard
205 https://bugs.webkit.org/show_bug.cgi?id=123360
207 Reviewed by Simon Fraser.
209 Merge revision numbers into one cell separated by /, and clearly label them as "latest revisions".
210 Also add colors for missing & audio failures so that they won't be an empty cell.
213 (TestResultsView._createTestResultHeader): Create a single th for the list of repository names.
214 (TestResultsView._createTestResultRow): Use single td for all revision numbers.
215 * public/js/build.js:
216 (.this.formattedRevision): Don't prefix revision numbers with '@' when we're not in the tooltip.
218 (.resultsTable .AUDIO a): Added.
219 (.resultsTable .MISSING a): Added.
221 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
223 One more build fix. Put each latest revision information in an actual td.
227 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
229 Yet another set of build fixes.
231 1. Manually strip / from revisions JSON if there is any.
232 2. Suppress warnings from ob_end_flush.
233 3. Allow "+" in actual and expected results as used in "TEXT+IMAGE".
235 * public/api/report.php:
236 * public/include/test-results.php:
238 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
240 Another build fix. Move .htaccess to public.
242 * .htaccess: Removed.
243 * public/.htaccess: Copied from .htaccess.
245 2013-10-25 Ryosuke Niwa <rniwa@webkit.org>
247 It turns out that the current instruction only works on Mountain Lion.
249 Also fixed some typos.
253 2013-10-24 Ryosuke Niwa <rniwa@webkit.org>
255 Add an instruction on how to setup test-results app
256 https://bugs.webkit.org/show_bug.cgi?id=123321
258 Rubber-stamped by Stephanie Lewis.
260 Added Install.md and updated config.json accordingly.
262 Also moved init-database.sql out of public/include since it doesn't need to be accessible via httpd.
266 * init-database.sql: Moved from public/include/init-database.sql.
268 2013-10-24 Ryosuke Niwa <rniwa@webkit.org>
270 Move everything except ChangeLog and config.json into public directory.
271 https://bugs.webkit.org/show_bug.cgi?id=123319
273 Rubber-stamped by Stephanie Lewis.
276 * admin/admin.css: Removed.
277 * admin/builders.php: Removed.
278 * admin/index.php: Removed.
279 * admin/repositories.php: Removed.
281 * api/failing-tests.php: Removed.
282 * api/manifest.php: Removed.
283 * api/report.php: Removed.
284 * api/results.php: Removed.
285 * common.css: Removed.
286 * config.json: Copied from include/config.json.
288 * include/admin-footer.php: Removed.
289 * include/admin-header.php: Removed.
290 * include/config.json: Removed.
291 * include/db.php: Removed.
292 * include/init-database.sql: Removed.
293 * include/json-shared.php: Removed.
294 * include/test-results.php: Removed.
295 * index.html: Removed.
297 * js/autocompleter.js: Removed.
298 * js/build.js: Removed.
299 * js/dom.js: Removed.
302 * public/admin: Copied from admin.
303 * public/api: Copied from api.
304 * public/common.css: Copied from common.css.
305 * public/include: Copied from include.
306 * public/include/config.json: Removed.
307 * public/include/db.php:
308 * public/index.html: Copied from index.html.
309 * public/js: Copied from js.
310 * public/main.css: Copied from main.css.
312 2013-10-24 Ryosuke Niwa <rniwa@webkit.org>
314 Showing lists of flaky tests for a builder takes too long
315 https://bugs.webkit.org/show_bug.cgi?id=123311
317 Reviewed by Sam Weinig.
319 Generate JSONs for tests failing, flaky, or with wrong expectation at the time a builder reports results
320 instead when the frontend requests to those those results since it takes multiple seconds or minutes to
321 generate those JSON files.
323 * api/failing-tests.php: Moved and renamed to manually generate all JSON files for a given builder.
326 * api/report.php: Manually flush and end the request (to avoid blocking run-webkit-tests on the other side
327 for minutes), then generate JSONs for tests that are failing, are flaky, and have wrong expectations.
329 * api/results.php: Merge format_result_rows here since it's not used anywhere else.
331 * include/config.json: Added the path to the data directory into which JSON files are generated.
334 (configPath): Takes a relative path value from config.json, and resolves it.
336 * include/json-shared.php:
337 (echo_success): Extracted from exit_with_success.
340 * include/test-results.php:
341 (add_builder): Extracted from add_build.
343 (ResultsJSONWriter): Extracted from api/failing-tests.php.
344 (ResultsJSONWriter.__construct):
345 (ResultsJSONWriter.start):
346 (ResultsJSONWriter.end):
347 (ResultsJSONWriter.add_results_for_test_if_matches):
348 (ResultsJSONWriter.pass_for_failure_type):
349 (FailingResultsJSONWriter): Extracted from index.html's TestResultsView._matchesFailureType.
350 (FailingResultsJSONWriter.__construct):
351 (FailingResultsJSONWriter.pass_for_failure_type):
352 (FlakyResultsJSONWriter): Ditto.
353 (FlakyResultsJSONWriter.__construct):
354 (FlakyResultsJSONWriter.pass_for_failure_type):
355 (WrongExpectationsResultsJSONWriter): Ditto.
356 (WrongExpectationsResultsJSONWriter.__construct):
357 (WrongExpectationsResultsJSONWriter.pass_for_failure_type):
358 (ResultsJSONGenerator): Ditto.
359 (ResultsJSONGenerator.__construct):
360 (ResultsJSONGenerator.generate):
361 (ResultsJSONGenerator.open_json_for_failure_type):
362 (ResultsJSONGenerator.write_jsons):
366 (TestResultsView.setBuilders):
367 (TestResultsView._createResultCell): Add a hyperlink to results.html in the tooltip.
368 (TestResultsView.fetchFailingTestsForBuilder): Fetch the generated JSON files.
370 2013-10-23 Ryosuke Niwa <rniwa@webkit.org>
372 Reverted erroneously committed changes from the previous commit.
376 2013-10-23 Ryosuke Niwa <rniwa@webkit.org>
378 Clicking on a test name on the new flakiness dashboard should add a new test pane
379 https://bugs.webkit.org/show_bug.cgi?id=123194
381 Reviewed by Simon Fraser.
383 Added a new click handler on each test name inside the builder test view add a new test pane.
384 Moved the old trac link to a right-arrow inline SVG icon.
386 Also tweaked the style so that the builder test view looks different from other test panes.
389 (TestResultsView._urlFromTest): Extracted from TestResultsView._linkifiedTestName.
390 (TestResultsView._populateBuilderPane): Fetch the test when its name is clicked.
391 Added a circled right arrow for the old trac link.
392 * main.css: Tweaked the style to move the rounded border around the builder test view to be
393 around the form controls to clearly differentiate it from a regular test pane.
395 2013-10-22 Ryosuke Niwa <rniwa@webkit.org>
397 New flakiness dashboard's test pane should show the latest WebKit revision for each builder
398 https://bugs.webkit.org/show_bug.cgi?id=123189
400 Reviewed by Simon Fraser.
403 (TestResultsView._populateTestPane): Call _createTestResultHeader and _createTestResultRow with
404 a list of repository information.
405 (TestResultsView._createTestResultHeader): Optionally creates headers for a list of repositories.
406 (TestResultsView._createTestResultRow): Add a hyperlinked revision information for each builder.
407 Also add a hyperlink to file a Bugzilla bug when there is no bug associated with the test already.
409 (Build.formattedRevision): Extracted from Build.formattedRevisions.
410 (Build.formattedRevisions):
412 2013-10-22 Ryosuke Niwa <rniwa@webkit.org>
414 Make tables on the new flakiness dashboard sortable
415 https://bugs.webkit.org/show_bug.cgi?id=123141
417 Reviewed by Simon Fraser.
419 Use jquery.tablesorter.js to make test and builder tables sortable. The jquery plugin is already used by run-perf-tests.
422 (TestResultsView._populateTestPane): Add tablesorter to the class name and wrap tr's inside a tbody so that tablesorter
424 (TestResultsView._populateBuilderPane): Ditto.
426 (.resultsTable thead): Use cursor: pointer to signify the fact it's clickable.
427 (.resultsTable th): Don't repeat arrows.
428 (.resultsTable th.headerSortUp): Inline SVG up arrow.
429 (.resultsTable th.headerSortDown): Inline SVG down arrow.
431 2013-10-21 Ryosuke Niwa <rniwa@webkit.org>
433 New flakiness dashboard should hyperlink test names, WebKit revisions, and bubbles
434 https://bugs.webkit.org/show_bug.cgi?id=123134
436 Reviewed by Stephanie Lewis.
438 Copied admin.css, admin-header.php, admin-footer.php, builders.php, repositories.php from WebKit Perf Monitor.
439 (Unfortunately WebKit Perf Monitor hasn't been committed into WebKit repository just yet.)
441 Updated various parts of index.html to linkify test names, build numbers, and bubbles (to results page).
443 * admin/admin.css: Added.
444 * admin/builders.php: Added.
445 * admin/index.php: Removed the duplicated code now that it uses admin-header.php.
446 * admin/repositories.php: Added.
447 * api/manifest.php: Use camelCase for blame_url and build_url to be consistent with other JSON properties.
448 Also exported testCategories from config so that we can linkify test names in the dashboard.
449 * include/admin-footer.php: Added.
450 * include/admin-header.php: Added.
451 * include/config.json: Added test categories. This avoids hard-coding the URL to trac in php/js.
452 * include/init-database.sql: Added name and build_url to builders table and category to tests.
453 * include/test-results.php: Assume the test category to be LayoutTest for now.
456 (TestResultsView): Initialize _builders, _slaves, _repositories, _testCategories as dictionaries as intended.
457 (TestResultsView.setTestCategories): Added.
458 (TestResultsView._createResultCell): Dynamically resolve URLs of results page and and build page.
459 (TestResultsView._populateTestPane): Linkify the test name. Unfortunately we don't have a test object anywhere.
460 We need to figure out a way to find the test object here eventually. For now, hard-coding "LayoutTest" works.
461 (TestResultsView._linkifiedTestName): Added.
462 (TestResultsView._createBuildsAndComputeSlownessOfResults): Takes builderId to set "builder" property on each
463 result object as it's used by Build class.
464 (TestResultsView._populateBuilderPane):
468 (Build.buildUrl): Support $builderName so that we don't have to keep repeating builder names in the database.
469 (Build.revision): Don't access [0] if revisions[repositoryId] was undefined.
471 2013-10-21 Ryosuke Niwa <rniwa@webkit.org>
473 New flakiness dashboard should align results by revision numbers
474 https://bugs.webkit.org/show_bug.cgi?id=123129
476 Reviewed by Tim Horton.
478 * include/config.json: Specify the default cache time to be 10 minutes.
479 * include/json-shared.php: Added Expires and Cache-Control headers. It's configurable via config.json.
481 (TestResultsView._createResultCell): Don't put '-' in a result cell without time.
482 (TestResultsView._populateTestPane): Create an array of build times ordered from the newest to the oldest.
483 Not that build.time() is the newest commit time among all repository for each result. e.g. if we had
484 both WebKit and Safari repository information in a given result, the newer of the two will be used.
485 (TestResultsView._createTestResultHeader): Added.
486 (TestResultsView._createBuildsAndComputeSlownessOfResults): Extracted from _createTestResultRow so
487 that _populateTestPane could use Build object before calling _createTestResultRow.
488 (TestResultsView._createTestResultRow): Takes buildTimes. Insert an empty cell for a build time if
489 the current row doesn't contain that a result for that build time.
490 (TestResultsView._populateBuilderPane):
491 * main.css: Tweaked the style so that bubbles are aligned vertically without '-'.
493 (.resultsTable thead th):
494 (.resultsTable .resultCell):
496 (.resultsTable span a):
498 2013-10-21 Ryosuke Niwa <rniwa@webkit.org>
500 New flakiness dashboard show test time, modifiers, and flaky tests
501 https://bugs.webkit.org/show_bug.cgi?id=123119
503 Reviewed by Tim Horton.
505 * api/failing-tests.php: Manually serialize each row in the results to avoid hitting the memory limit.
507 (Database::query): Added.
508 (Database::fetch_next_row): Added.
509 * include/init-database.sql: Added modifiers and time columns to results table.
510 * include/test-results.php:
511 (store_test_results): Update start_time and end_time to the union of the new interval and the existing interval.
512 (recursively_add_test_results): Handle empty $full_name to eliminate the loop over tests in store_test_results.
513 Also verify that each test name, expected and actual results conform to the specific format to prevent XSS.
514 Also use insert_row instead of select_or_insert_row to avoid issuing an unnecessary SQL query.
515 (format_result): Extracted from format_result_rows. Used in failing-tests.php.
517 (TestResultsView): Added _currentBuilderFailureType and _currentBuilderDays.
518 (TestResultsView._createResultCell): Show the test time and the expected result.
519 (TestResultsView._createTestResultRow): Compute the slowest run and also round time to tenth of second for time
520 less than 10s or second if it's more than 10s so that the test time will always be shown in two digits.
521 Also show the bug number and the latest expected result on the left columns after linkifying the bug numbers.
522 (TestResultsView._matchesFailureType): Added. Determines whether results is of a particular failure type.
523 (TestResultsView._populateBuilderPane):
524 (TestResultsView.fetchFailingTestsForBuilder): Store the failure type such as flaky, wrongtestexpectations.
525 (TestResultsView.updateLocationHash):
526 (TestResultsView.loadTestsFromLocationHash):
529 (element): appendChild if an item is a Node. Otherwise, e.g. integer, create a text node out of toString() call.
530 * main.css: Updated styles.
532 2013-10-18 Ryosuke Niwa <rniwa@webkit.org>
534 New flakiness dashboard should support showing the failing tests per builder
535 https://bugs.webkit.org/show_bug.cgi?id=123011
537 Reviewed by Timothy Hatcher.
539 Added the feature. Also did some refactoring to add this feature.
542 * api/failing-tests.php: Added.
543 * api/manifest.php: Removed the code to make maps by id. The work is now done in index.html.
545 * common.css: Added. Extracted from index.html.
546 * include/test-results.php: Extracted parse_revisions_array and format_result_rows from results.php.
549 (TestResultsView.setAvailableTests): Added.
550 (TestResultsView.showTooltip): Fixed the code to compute x and y coordinates of the tooltip to take
551 scrolled positions into account.
552 (TestResultsView._createTestResultRow): Extracted from _populateTestPane.
553 (TestResultsView.fetchTest): Added the code to show "Loading..." in the pane while loading the JSON.
554 (TestResultsView.fetchTests): Respect the doNotUpdateHash flag.
555 (TestResultsView._populateBuilderPane): Added.
556 (TestResultsView.fetchFailingTestsForBuilder): Added.
557 (TestResultsView.updateLocationHash): Serialize builder & builderDays.
558 (TestResultsView.locationHashChanged): Don't delete existing test panes since that's now done in
559 loadTestsFromLocationHash.
560 (TestResultsView.loadTestsFromLocationHash): Take care of both 'tests' and 'builder' components.
561 (fetchManifest): Setup the UI to select a builder.