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