Changeset 246663 in webkit
- Timestamp:
- Jun 20, 2019, 4:53:22 PM (7 years ago)
- Location:
- trunk/Websites/perf.webkit.org
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
public/include/commit-log-fetcher.php (modified) (1 diff)
-
server-tests/api-commits-tests.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Websites/perf.webkit.org/ChangeLog
r246581 r246663 1 2019-06-20 Dewei Zhu <dewei_zhu@apple.com> 2 3 Fix a bug that 'test_metrics' and 'tests' tables are not joined correctly in CommitLogFetcher.fetch_latest_for_platform 4 https://bugs.webkit.org/show_bug.cgi?id=199062 5 6 Reviewed by Ryosuke Niwa. 7 8 'test_metrics' and 'tests' should be joined based on 'metric_test' and 'test_id'. 9 10 * public/include/commit-log-fetcher.php: Fix the typo in the query. 11 * server-tests/api-commits-tests.js: Added a unit test for this change. 12 1 13 2019-06-17 Dewei Zhu <dewei_zhu@apple.com> 2 14 -
trunk/Websites/perf.webkit.org/public/include/commit-log-fetcher.php
r246522 r246663 156 156 { 157 157 $query_result = $this->db->query_and_fetch_all("SELECT commits.* FROM test_runs, builds, build_commits, commits 158 WHERE run_build = build_id AND NOT EXISTS (SELECT * FROM build_requests WHERE request_build = build_id )158 WHERE run_build = build_id AND NOT EXISTS (SELECT * FROM build_requests WHERE request_build = build_id LIMIT 1) 159 159 AND run_config IN (SELECT config_id FROM test_configurations 160 160 WHERE config_type = 'current' AND config_platform = $2 AND config_metric 161 IN (SELECT metric_id FROM test_metrics, tests WHERE metric_ id= test_id and test_parent IS NULL))161 IN (SELECT metric_id FROM test_metrics, tests WHERE metric_test = test_id and test_parent IS NULL)) 162 162 AND run_build = build_id AND commit_build = build_id AND build_commit = commit_id AND commit_repository = $1 163 163 ORDER BY build_time DESC LIMIT 1;", array($repository_id, $platform_id)); -
trunk/Websites/perf.webkit.org/server-tests/api-commits-tests.js
r246522 r246663 6 6 const addSlaveForReport = require('./resources/common-operations.js').addSlaveForReport; 7 7 const prepareServerTest = require('./resources/common-operations.js').prepareServerTest; 8 const submitReport = require('./resources/common-operations.js').submitReport; 8 9 9 10 describe("/api/commits/", function () { … … 80 81 time: '2017-01-20T03:56:20.045Z' 81 82 } 83 84 const report = [{ 85 "buildNumber": "124", 86 "buildTime": "2015-10-27T15:34:51", 87 "builderName": "someBuilder", 88 "builderPassword": "somePassword", 89 "platform": "some platform", 90 "tests": {"Speedometer-2": {"metrics": {"Score": {"current": [[100]]}}}}, 91 "revisions": { 92 "WebKit": { 93 "timestamp": "2017-01-20T02:52:34.577Z", 94 "revision": "210948" 95 } 96 } 97 }]; 82 98 83 99 function assertCommitIsSameAsOneSubmitted(commit, submitted) … … 238 254 assert.equal(result['commits'][0]['revision'], systemVersionCommits['commits'][0]['revision']); 239 255 }); 256 }); 257 258 it("should always return a commit as long as there is an existing 'current' type test run for a given platform", async () => { 259 const remote = TestServer.remoteAPI(); 260 const db = TestServer.database(); 261 await db.insert('tests', {name: 'A-Test'}); 262 await submitReport(report); 263 await db.query(`DELETE FROM tests WHERE test_name = 'A-Test'`); 264 265 const platforms = await db.selectAll('platforms'); 266 assert.equal(platforms.length, 1); 267 268 const test_metrics = await db.selectAll('test_metrics'); 269 assert.equal(test_metrics.length, 1); 270 271 const tests = await db.selectAll('tests'); 272 assert.equal(tests.length, 1); 273 274 assert(test_metrics[0].id != tests[0].id); 275 276 const response = await remote.getJSON(`/api/commits/WebKit/latest?platform=${platforms[0].id}`); 277 assert(response.commits.length); 240 278 }); 241 279 });
Note:
See TracChangeset
for help on using the changeset viewer.