WebKit Bugzilla
Attachment 372544 Details for
Bug 199062
: Fix a bug that 'test_metrics' and 'tests' tables are not joined correctly in CommitLogFetcher.fetch_latest_for_platform
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199062-20190620002136.patch (text/plain), 5.28 KB, created by
dewei_zhu
on 2019-06-20 00:21:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
dewei_zhu
Created:
2019-06-20 00:21:37 PDT
Size:
5.28 KB
patch
obsolete
>Subversion Revision: 246630 >diff --git a/Websites/perf.webkit.org/ChangeLog b/Websites/perf.webkit.org/ChangeLog >index 85ef41142eef66679befe236b85fdad455987113..de0c0470e614e54ffd69bf1085e244e0433d1769 100644 >--- a/Websites/perf.webkit.org/ChangeLog >+++ b/Websites/perf.webkit.org/ChangeLog >@@ -1,3 +1,15 @@ >+2019-06-20 Dewei Zhu <dewei_zhu@apple.com> >+ >+ Fix a bug that 'test_metrics' and 'tests' tables are not joined correctly in CommitLogFetcher.fetch_latest_for_platform >+ https://bugs.webkit.org/show_bug.cgi?id=199062 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 'test_metrics' and 'tests' should be joined based on 'metric_test' and 'test_id'. >+ >+ * public/include/commit-log-fetcher.php: Fix the typo in the query. >+ * server-tests/api-commits-tests.js: Added a unit test for this change. >+ > 2019-06-17 Dewei Zhu <dewei_zhu@apple.com> > > Customizable test group form should allow user to supply a revision prefix of a commit and revision starts with 'r'. >diff --git a/Websites/perf.webkit.org/public/include/commit-log-fetcher.php b/Websites/perf.webkit.org/public/include/commit-log-fetcher.php >index 540f1dec15c73c206b6cdfac294aace862c4e044..0fd6df82d41a359c5e72455958e1e07ce82881be 100644 >--- a/Websites/perf.webkit.org/public/include/commit-log-fetcher.php >+++ b/Websites/perf.webkit.org/public/include/commit-log-fetcher.php >@@ -155,10 +155,10 @@ class CommitLogFetcher { > function fetch_latest_for_platform($repository_id, $platform_id) > { > $query_result = $this->db->query_and_fetch_all("SELECT commits.* FROM test_runs, builds, build_commits, commits >- WHERE run_build = build_id AND NOT EXISTS (SELECT * FROM build_requests WHERE request_build = build_id) >+ WHERE run_build = build_id AND NOT EXISTS (SELECT * FROM build_requests WHERE request_build = build_id LIMIT 1) > AND run_config IN (SELECT config_id FROM test_configurations > WHERE config_type = 'current' AND config_platform = $2 AND config_metric >- IN (SELECT metric_id FROM test_metrics, tests WHERE metric_id = test_id and test_parent IS NULL)) >+ IN (SELECT metric_id FROM test_metrics, tests WHERE metric_test = test_id and test_parent IS NULL)) > AND run_build = build_id AND commit_build = build_id AND build_commit = commit_id AND commit_repository = $1 > ORDER BY build_time DESC LIMIT 1;", array($repository_id, $platform_id)); > /* This query is approximation. It finds the commit of the last build instead of the last commit. >diff --git a/Websites/perf.webkit.org/server-tests/api-commits-tests.js b/Websites/perf.webkit.org/server-tests/api-commits-tests.js >index 98b02efea671d1de63b58635d04466270fc2d31a..1ed1adf90b051675999d5003706513f26c64bfc7 100644 >--- a/Websites/perf.webkit.org/server-tests/api-commits-tests.js >+++ b/Websites/perf.webkit.org/server-tests/api-commits-tests.js >@@ -5,6 +5,7 @@ const assert = require('assert'); > const TestServer = require('./resources/test-server.js'); > const addSlaveForReport = require('./resources/common-operations.js').addSlaveForReport; > const prepareServerTest = require('./resources/common-operations.js').prepareServerTest; >+const submitReport = require('./resources/common-operations.js').submitReport; > > describe("/api/commits/", function () { > prepareServerTest(this); >@@ -80,6 +81,21 @@ describe("/api/commits/", function () { > time: '2017-01-20T03:56:20.045Z' > } > >+ const report = [{ >+ "buildNumber": "124", >+ "buildTime": "2015-10-27T15:34:51", >+ "builderName": "someBuilder", >+ "builderPassword": "somePassword", >+ "platform": "some platform", >+ "tests": {"Speedometer-2": {"metrics": {"Score": {"current": [[100]]}}}}, >+ "revisions": { >+ "WebKit": { >+ "timestamp": "2017-01-20T02:52:34.577Z", >+ "revision": "210948" >+ } >+ } >+ }]; >+ > function assertCommitIsSameAsOneSubmitted(commit, submitted) > { > assert.equal(commit['revision'], submitted['revision']); >@@ -238,6 +254,28 @@ describe("/api/commits/", function () { > assert.equal(result['commits'][0]['revision'], systemVersionCommits['commits'][0]['revision']); > }); > }); >+ >+ it("should always return a commit as long as there is an existing 'current' type test run for given platform", async () => { >+ const remote = TestServer.remoteAPI(); >+ const db = TestServer.database(); >+ await db.insert('tests', {name: 'A-Test'}); >+ await submitReport(report); >+ await db.query(`DELETE FROM tests WHERE test_name = 'A-Test'`); >+ >+ const platforms = await db.selectAll('platforms'); >+ assert.equal(platforms.length, 1); >+ >+ const test_metrics = await db.selectAll('test_metrics'); >+ assert.equal(test_metrics.length, 1); >+ >+ const tests = await db.selectAll('tests'); >+ assert.equal(tests.length, 1); >+ >+ assert(test_metrics[0].id != tests[0].id); >+ >+ const response = await remote.getJSON(`/api/commits/WebKit/latest?platform=${platforms[0].id}`); >+ assert(response.commits.length); >+ }); > }); > > describe('/api/commits/<repository>/last-reported', () => {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
rniwa
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199062
: 372544