haikuwebkit/Websites/perf.webkit.org/server-tests/api-commits-tests.js

880 lines
46 KiB
JavaScript
Raw Permalink Normal View History

REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
'use strict';
const assert = require('assert');
const TestServer = require('./resources/test-server.js');
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
const addWorkerForReport = require('./resources/common-operations.js').addWorkerForReport;
const prepareServerTest = require('./resources/common-operations.js').prepareServerTest;
const submitReport = require('./resources/common-operations.js').submitReport;
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
describe("/api/commits/", function () {
prepareServerTest(this);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const subversionCommits = {
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
"workerName": "someWorker",
"workerPassword": "somePassword",
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
"commits": [
{
"repository": "WebKit",
"revision": "210948",
"revisionIdentifier": "184276@main",
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
"time": "2017-01-20T02:52:34.577Z",
"author": {"name": "Zalan Bujtas", "account": "zalan@apple.com"},
"message": "a message",
},
{
"repository": "WebKit",
"revision": "210949",
"revisionIdentifier": "184277@main",
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
"time": "2017-01-20T03:23:50.645Z",
"author": {"name": "Chris Dumez", "account": "cdumez@apple.com"},
"message": "some message",
},
{
"repository": "WebKit",
"previousCommit": "210949",
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
"revision": "210950",
"revisionIdentifier": "184278@main",
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
"time": "2017-01-20T03:49:37.887Z",
"author": {"name": "Commit Queue", "account": "commit-queue@webkit.org"},
"message": "another message",
},
]
};
const subcersionCommitsWithFakeRevisionIdentifier = {
"workerName": "someWorker",
"workerPassword": "somePassword",
"commits": [
{
"repository": "WebKit",
"revision": "210948",
"revisionIdentifier": "184276@main",
"time": "2017-01-20T02:52:34.577Z",
"author": {"name": "Zalan Bujtas", "account": "zalan@apple.com"},
"message": "a message",
},
{
"repository": "WebKit",
"revision": "210949",
"revisionIdentifier": "184277@main",
"time": "2017-01-20T03:23:50.645Z",
"author": {"name": "Chris Dumez", "account": "cdumez@apple.com"},
"message": "some message",
},
{
"repository": "WebKit",
"previousCommit": "210949",
"revision": "210950",
"revisionIdentifier": "184278@main",
"time": "2017-01-20T03:49:37.887Z",
"author": {"name": "Commit Queue", "account": "commit-queue@webkit.org"},
"message": "another message",
},
{
"repository": "WebKit",
"revision": "210951",
"revisionIdentifier": "184278@something",
"time": "2017-01-20T03:49:40.887Z",
"author": {"name": "Commit Queue", "account": "commit-queue@webkit.org"},
"message": "another message",
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
}
]
};
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const commitsOnePrefixOfTheOther = {
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
"workerName": "someWorker",
"workerPassword": "somePassword",
"commits": [
{
"repository": "WebKit",
"revision": "21094",
"revisionIdentifier": "184272@main",
"time": "2017-01-20T02:52:34.577Z",
"author": {"name": "Zalan Bujtas", "account": "zalan@apple.com"},
"message": "a message",
},
{
"repository": "WebKit",
"revision": "210949",
"revisionIdentifier": "184277@main",
"time": "2017-01-20T03:23:50.645Z",
"author": {"name": "Chris Dumez", "account": "cdumez@apple.com"},
"message": "some message",
}
]
}
const systemVersionCommits = {
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
"workerName": "someWorker",
"workerPassword": "somePassword",
"commits": [
{
"repository": "OSX",
"revision": "16D32",
"order": 6
},
{
"repository": "OSX",
"revision": "16C68",
"order": 5
},
{
"repository": "OSX",
"revision": "16C67",
"order": 4
},
{
"repository": "OSX",
"revision": "16B2657",
"order": 3
},
{
"repository": "OSX",
"revision": "16B2555",
"order": 2
},
{
"repository": "OSX",
"revision": "16A323",
"order": 1
}
]
}
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const notYetReportedCommit = {
revision: '210951',
time: '2017-01-20T03:56:20.045Z'
}
const report = [{
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
"buildTag": "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"
}
}
}];
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
function assertCommitIsSameAsOneSubmitted(commit, submitted)
{
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(commit['revision'], submitted['revision']);
assert.strictEqual(new Date(commit['time']).toISOString(), submitted['time']);
assert.strictEqual(commit['message'], submitted['message']);
assert.strictEqual(commit['authorName'], submitted['author']['name']);
assert.strictEqual(commit['authorEmail'], submitted['author']['account']);
if(submitted['previousCommit']) {
assert.ok(commit['previousCommit']);
} else {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(commit['previousCommit'], null);
}
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
}
describe('/api/commits/<repository>/', () => {
it("should return RepositoryNotFound when there are no matching repository", () => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit').then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'RepositoryNotFound');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return an empty result when there are no reported commits", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z'})
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return the list of all commits for a given repository", () => {
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(subversionCommits).then(() => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
return TestServer.remoteAPI().postJSON('/api/report-commits/', subversionCommits);
}).then(function (response) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const commits = result['commits'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(commits.length, 3);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const submittedCommits = subversionCommits['commits'];
assertCommitIsSameAsOneSubmitted(commits[0], submittedCommits[0]);
assertCommitIsSameAsOneSubmitted(commits[1], submittedCommits[1]);
assertCommitIsSameAsOneSubmitted(commits[2], submittedCommits[2]);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(commits[2]['previousCommit'], commits[1]['id']);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return the list of ordered commits for a given repository", () => {
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(subversionCommits).then(() => {
return TestServer.remoteAPI().postJSON('/api/report-commits/', systemVersionCommits);
}).then(function (response) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
return TestServer.remoteAPI().getJSON('/api/commits/OSX/');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
const commits = result['commits'];
const submittedCommits = systemVersionCommits['commits'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(commits.length, submittedCommits.length);
assert.strictEqual(commits[0]['revision'], submittedCommits[5]['revision']);
assert.strictEqual(commits[1]['revision'], submittedCommits[4]['revision']);
assert.strictEqual(commits[2]['revision'], submittedCommits[3]['revision']);
assert.strictEqual(commits[3]['revision'], submittedCommits[2]['revision']);
assert.strictEqual(commits[4]['revision'], submittedCommits[1]['revision']);
assert.strictEqual(commits[5]['revision'], submittedCommits[0]['revision']);
});
});
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
describe('/api/commits/<repository>/oldest', () => {
it("should return RepositoryNotFound when there are no matching repository", () => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/oldest').then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'RepositoryNotFound');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return an empty results when there are no commits", () => {
return TestServer.database().insert('repositories', {'id': 1, 'name': 'WebKit'}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/oldest');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return the oldest commit", () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(subversionCommits).then(() => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
return remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
}).then(() => {
return remote.getJSON('/api/commits/WebKit/oldest');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result['commits'].length, 1);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'][0]);
});
});
it("should return the oldest commit based on 'commit_order' when 'commit_time' is missing", () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(systemVersionCommits).then(() => {
return remote.postJSONWithStatus('/api/report-commits/', systemVersionCommits);
}).then(() => {
return remote.getJSON('/api/commits/OSX/oldest');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], systemVersionCommits['commits'][5]['revision']);
});
});
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
describe('/api/commits/<repository>/latest', () => {
it("should return RepositoryNotFound when there are no matching repository", () => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/latest').then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'RepositoryNotFound');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return an empty results when there are no commits", () => {
return TestServer.database().insert('repositories', {'id': 1, 'name': 'WebKit'}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/latest');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return the oldest commit", () => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(subversionCommits).then(() => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
return remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
}).then(() => {
return remote.getJSON('/api/commits/WebKit/latest');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result['commits'].length, 1);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'].slice().pop());
});
});
it("should return the latest commit based on 'commit_order' when 'commit_time' is missing", () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(systemVersionCommits).then(() => {
return remote.postJSONWithStatus('/api/report-commits/', systemVersionCommits);
}).then(() => {
return remote.getJSON('/api/commits/OSX/latest');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result['commits'].length, 1);
assert.strictEqual(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 a 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');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(platforms.length, 1);
const test_metrics = await db.selectAll('test_metrics');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(test_metrics.length, 1);
const tests = await db.selectAll('tests');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(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);
});
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
describe('/api/commits/<repository>/last-reported', () => {
it("should return RepositoryNotFound when there are no matching repository", () => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/last-reported').then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'RepositoryNotFound');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return an empty result when there are no reported commits", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z'})
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/last-reported');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return an empty results when there are no reported commits", () => {
return TestServer.database().insert('repositories', {'id': 1, 'name': 'WebKit'}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/last-reported');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return the oldest reported commit", () => {
const db = TestServer.database();
const remote = TestServer.remoteAPI();
return Promise.all([
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
addWorkerForReport(subversionCommits),
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': notYetReportedCommit.revision, 'time': notYetReportedCommit.time}),
]).then(() => {
return remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
}).then(() => {
return remote.getJSON('/api/commits/WebKit/last-reported');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result['commits'].length, 1);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'].slice().pop());
});
});
it("should return the last reported commit based on 'commit_order' when 'commit_time' is missing", () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(systemVersionCommits).then(() => {
return remote.postJSONWithStatus('/api/report-commits/', systemVersionCommits);
}).then(() => {
return remote.getJSON('/api/commits/OSX/last-reported');
}).then(function (result) {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], systemVersionCommits['commits'][0]['revision']);
});
});
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
describe('/api/commits/<repository>/last-reported?from=<start_order>&to=<end_order>', () => {
it("should return a list of commit in given valid order range", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'OSX'}),
db.insert('commits', {'repository': 1, 'revision': 'Sierra16C67', 'order': 367, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': 'Sierra16C68', 'order': 368, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': 'Sierra16C69', 'order': 369, 'reported': false}),
db.insert('commits', {'repository': 1, 'revision': 'Sierra16D32', 'order': 432, 'reported': true})
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=367&to=370');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
const results = response['commits'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.length, 1);
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
const commit = results[0];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(commit.revision, 'Sierra16C68');
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=370&to=367');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
const results = response['commits'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.length, 0);
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=200&to=299');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
const results = response['commits'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.length, 0);
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=369&to=432');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
const results = response['commits'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.length, 1);
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
const commit = results[0];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(commit.revision, 'Sierra16D32');
Rewrite 'pull-os-versions' script in Javascript to add support for reporting os revisions with sub commits. https://bugs.webkit.org/show_bug.cgi?id=169542 Reviewed by Ryosuke Niwa. Extend '/api/commits/<repository>/last-reported' to accept a range and return last reported commits in given range. Rewrite 'pull-os-versions' in JavaScript and add unit tests for it. Instead of writing query manually while searching criteria contains null columns, use the methods provided in 'db.php'. Add '.gitignore' file to ommit files generated by while running tests/instances locally. * .gitignore: Added. * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: 'null_columns' of prepare_params should be a reference. * public/include/report-processor.php: * server-tests/api-commits.js: (then): * server-tests/api-report-commits-tests.js: * server-tests/resources/mock-logger.js: Added. (MockLogger): (MockLogger.prototype.log): (MockLogger.prototype.error): * server-tests/resources/mock-subprocess.js: Added. (MockSubprocess.call): (MockSubprocess.waitingForInvocation): (MockSubprocess.inject): (MockSubprocess.reset): * server-tests/tools-buildbot-triggerable-tests.js: (MockLogger): Deleted. (MockLogger.prototype.log): Deleted. (MockLogger.prototype.error): Deleted. * server-tests/tools-os-build-fetcher-tests.js: Added. (beforeEach): (return.waitingForInvocationPromise.then): (then): (string_appeared_here.return.waitingForInvocationPromise.then): (return.addSlaveForReport.emptyReport.then): * tools/js/os-build-fetcher.js: Added. (OSBuildFetcher): (OSBuildFetcher.prototype._fetchAvailableBuilds): (OSBuildFetcher.prototype._computeOrder): (OSBuildFetcher.prototype._commitsForAvailableBuilds.return.this._subprocess.call.then.): (OSBuildFetcher.prototype._commitsForAvailableBuilds): (OSBuildFetcher.prototype._addSubCommitsForBuild): (OSBuildFetcher.prototype._submitCommits): (OSBuildFetcher.prototype.fetchAndReportNewBuilds): * tools/js/subprocess.js: Added. (const.childProcess.require.string_appeared_here.Subprocess.prototype.call): (const.childProcess.require.string_appeared_here.Subprocess): * tools/pull-os-versions.js: Added. (main): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): Canonical link: https://commits.webkit.org/186651@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-15 08:35:07 +00:00
});
});
});
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
describe('/api/commits/<repository>/<commit>', () => {
it("should return RepositoryNotFound when there are no matching repository", () => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/210949').then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'RepositoryNotFound');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return UnknownCommit when one of the specified commit does not exist in the database", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z'})
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/210949');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'UnknownCommit');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return the commit even if it had not been reported", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z'})
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/210950');
}).then((result) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result['commits'].length, 1);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
assertCommitIsSameAsOneSubmitted(result['commits'][0], {
previousCommit: null,
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
revision: '210950',
time: '2017-01-20T03:49:37.887Z',
author: {name: null, account: null},
message: null,
});
});
});
it("should return the full result for a reported commit", () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(subversionCommits).then(() => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
return remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
}).then(() => {
return remote.getJSON('/api/commits/WebKit/210949');
}).then((result) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 1);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'][1]);
});
});
it("should return the full result for a reported commit with prefix-match to be false", async () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
await addWorkerForReport(subversionCommits);
await remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
const result = await remote.getJSON('/api/commits/WebKit/210949?prefix-match=false');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 1);
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'][1]);
});
it("should return the full result for a reported commit with prefix-match to be true", async () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
await addWorkerForReport(subversionCommits);
await remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
const result = await remote.getJSON('/api/commits/WebKit/210949?prefix-match=true');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 1);
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'][1]);
});
it("should return 'AmbiguousRevisionPrefix' when more than one commits are found for a revision prefix", async () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
await addWorkerForReport(subversionCommits);
await remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
const result = await remote.getJSON('/api/commits/WebKit/21094?prefix-match=true');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'AmbiguousRevisionPrefix');
});
it("should not return 'AmbiguousRevisionPrefix' when there is a commit revision extract matches specified revision prefix", async () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
await addWorkerForReport(commitsOnePrefixOfTheOther);
await remote.postJSONWithStatus('/api/report-commits/', commitsOnePrefixOfTheOther);
const result = await remote.getJSON('/api/commits/WebKit/21094?prefix-match=true');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 1);
assertCommitIsSameAsOneSubmitted(result['commits'][0], commitsOnePrefixOfTheOther['commits'][0]);
});
it("should return 'UnknownCommit' when no commit is found for a revision prefix", async () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
await addWorkerForReport(subversionCommits);
await remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
const result = await remote.getJSON('/api/commits/WebKit/21090?prefix-match=true');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'UnknownCommit');
});
it("should not match prefix and return 'UnkownCommit' when svn commit starts with 'r' prefix and there is no exact match", async () => {
const remote = TestServer.remoteAPI();
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
await addWorkerForReport(subversionCommits);
await remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
const result = await remote.getJSON('/api/commits/WebKit/r21095?prefix-match=true');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'UnknownCommit');
});
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
it("should handle commit revision with space", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'OS X'}),
db.insert('commits', {'repository': 1, 'revision': '10.11.10 Sierra16C67', 'order': 367, 'reported': true}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OS%20X/10.11.10%20Sierra16C67');
}).then((results) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.status, 'OK');
assert.strictEqual(results.commits.length, 1);
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
const commit = results.commits[0];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(parseInt(commit.id), 1);
assert.strictEqual(commit.revision, '10.11.10 Sierra16C67');
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
});
});
it("should return commit with commit revision label", async () => {
await addWorkerForReport(subversionCommits);
const response = await TestServer.remoteAPI().postJSON('/api/report-commits/', subversionCommits);
assert.strictEqual(response['status'], 'OK');
const result = await TestServer.remoteAPI().getJSON(`/api/commits/WebKit/${subversionCommits.commits[0].revisionIdentifier}`);
assert.strictEqual(result['status'], 'OK');
assert.strictEqual(result.commits.length, 1);
assertCommitIsSameAsOneSubmitted(result.commits[0], subversionCommits.commits[0]);
});
it("should return 'AmbiguousRevisionPrefix' when more than one commits are found for a revision label prefix", async () => {
const remote = TestServer.remoteAPI();
await addWorkerForReport(subcersionCommitsWithFakeRevisionIdentifier);
await remote.postJSONWithStatus('/api/report-commits/', subcersionCommitsWithFakeRevisionIdentifier);
const result = await remote.getJSON('/api/commits/WebKit/184278@?prefix-match=true');
assert.strictEqual(result['status'], 'AmbiguousRevisionPrefix');
});
it("should not return 'AmbiguousRevisionPrefix' when there is a commit revision label extract matches specified revision prefix", async () => {
const remote = TestServer.remoteAPI();
await addWorkerForReport(subcersionCommitsWithFakeRevisionIdentifier);
await remote.postJSONWithStatus('/api/report-commits/', subcersionCommitsWithFakeRevisionIdentifier);
const result = await remote.getJSON('/api/commits/WebKit/184278@main?prefix-match=true');
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 1);
assertCommitIsSameAsOneSubmitted(result['commits'][0], subcersionCommitsWithFakeRevisionIdentifier['commits'][2]);
});
it("should return 'UnknownCommit' when no commit is found for a revision label prefix", async () => {
const remote = TestServer.remoteAPI();
await addWorkerForReport(subcersionCommitsWithFakeRevisionIdentifier);
await remote.postJSONWithStatus('/api/report-commits/', subcersionCommitsWithFakeRevisionIdentifier);
const result = await remote.getJSON('/api/commits/WebKit/184278@x?prefix-match=true');
assert.strictEqual(result['status'], 'UnknownCommit');
});
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
});
Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit. https://bugs.webkit.org/show_bug.cgi?id=177178 Reviewed by Ryosuke Niwa. We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two. Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'. * browser-tests/commit-log-viewer-tests.js: * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js. (OwnedCommitViewer): (OwnedCommitViewer.prototype.didConstructShadowTree): (OwnedCommitViewer.prototype._toggleVisibility): (OwnedCommitViewer.prototype.render): (OwnedCommitViewer.prototype._renderOwnedCommitTable): (OwnedCommitViewer.htmlTemplate): (OwnedCommitViewer.cssTemplate): * public/v3/index.html: * public/v3/models/commit-log.js: (CommitLog): (CommitLog.prototype.updateSingleton): (CommitLog.prototype.ownsCommits): (CommitLog.prototype.fetchOwnedCommits): (CommitLog.prototype._buildOwnedCommitMap): (CommitLog.diffOwnedCommits): (CommitLog.prototype.ownsSubCommits): Deleted. (CommitLog.prototype.fetchSubCommits): Deleted. (CommitLog.prototype._buildSubCommitMap): Deleted. (CommitLog.diffSubCommits): Deleted. * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/tools-os-build-fetcher-tests.js: (return.waitForInvocationPromise.then): (string_appeared_here.return.waitForInvocationPromise.then): * tools/js/os-build-fetcher.js: (prototype._fetchAvailableBuilds): (prototype._addOwnedCommitsForBuild): (prototype._addSubCommitsForBuild): Deleted. * unit-tests/commit-log-tests.js: (return.commit.fetchOwnedCommits.then): (return.fetchingPromise.then): (return.commit.fetchSubCommits.then): Deleted. Canonical link: https://commits.webkit.org/193549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-19 21:47:41 +00:00
describe('/api/commits/<repository>/owned-commits?owner-revision=<commit>', () => {
it("should return owned commits for a given commit", () => {
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('repositories', {'id': 2, 'name': 'WebKit', 'owner': 1}),
db.insert('commits', {'id': 1, 'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'id': 2, 'repository': 2, 'revision': '210950', 'reported': true}),
db.insert('commit_ownerships', {'owner': 1, 'owned': 2})
]).then(() => {
Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit. https://bugs.webkit.org/show_bug.cgi?id=177178 Reviewed by Ryosuke Niwa. We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two. Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'. * browser-tests/commit-log-viewer-tests.js: * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js. (OwnedCommitViewer): (OwnedCommitViewer.prototype.didConstructShadowTree): (OwnedCommitViewer.prototype._toggleVisibility): (OwnedCommitViewer.prototype.render): (OwnedCommitViewer.prototype._renderOwnedCommitTable): (OwnedCommitViewer.htmlTemplate): (OwnedCommitViewer.cssTemplate): * public/v3/index.html: * public/v3/models/commit-log.js: (CommitLog): (CommitLog.prototype.updateSingleton): (CommitLog.prototype.ownsCommits): (CommitLog.prototype.fetchOwnedCommits): (CommitLog.prototype._buildOwnedCommitMap): (CommitLog.diffOwnedCommits): (CommitLog.prototype.ownsSubCommits): Deleted. (CommitLog.prototype.fetchSubCommits): Deleted. (CommitLog.prototype._buildSubCommitMap): Deleted. (CommitLog.diffSubCommits): Deleted. * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/tools-os-build-fetcher-tests.js: (return.waitForInvocationPromise.then): (string_appeared_here.return.waitForInvocationPromise.then): * tools/js/os-build-fetcher.js: (prototype._fetchAvailableBuilds): (prototype._addOwnedCommitsForBuild): (prototype._addSubCommitsForBuild): Deleted. * unit-tests/commit-log-tests.js: (return.commit.fetchOwnedCommits.then): (return.fetchingPromise.then): (return.commit.fetchSubCommits.then): Deleted. Canonical link: https://commits.webkit.org/193549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-19 21:47:41 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/1/owned-commits?owner-revision=10.12%2016A323')
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
}).then((results) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.status, 'OK');
assert.strictEqual(results.commits.length, 1);
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit. https://bugs.webkit.org/show_bug.cgi?id=177178 Reviewed by Ryosuke Niwa. We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two. Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'. * browser-tests/commit-log-viewer-tests.js: * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js. (OwnedCommitViewer): (OwnedCommitViewer.prototype.didConstructShadowTree): (OwnedCommitViewer.prototype._toggleVisibility): (OwnedCommitViewer.prototype.render): (OwnedCommitViewer.prototype._renderOwnedCommitTable): (OwnedCommitViewer.htmlTemplate): (OwnedCommitViewer.cssTemplate): * public/v3/index.html: * public/v3/models/commit-log.js: (CommitLog): (CommitLog.prototype.updateSingleton): (CommitLog.prototype.ownsCommits): (CommitLog.prototype.fetchOwnedCommits): (CommitLog.prototype._buildOwnedCommitMap): (CommitLog.diffOwnedCommits): (CommitLog.prototype.ownsSubCommits): Deleted. (CommitLog.prototype.fetchSubCommits): Deleted. (CommitLog.prototype._buildSubCommitMap): Deleted. (CommitLog.diffSubCommits): Deleted. * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/tools-os-build-fetcher-tests.js: (return.waitForInvocationPromise.then): (string_appeared_here.return.waitForInvocationPromise.then): * tools/js/os-build-fetcher.js: (prototype._fetchAvailableBuilds): (prototype._addOwnedCommitsForBuild): (prototype._addSubCommitsForBuild): Deleted. * unit-tests/commit-log-tests.js: (return.commit.fetchOwnedCommits.then): (return.fetchingPromise.then): (return.commit.fetchSubCommits.then): Deleted. Canonical link: https://commits.webkit.org/193549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-19 21:47:41 +00:00
const ownedCommit = results.commits[0];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(parseInt(ownedCommit.repository), 2);
assert.strictEqual(ownedCommit.revision, '210950');
assert.strictEqual(parseInt(ownedCommit.id), 2);
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
});
});
Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit. https://bugs.webkit.org/show_bug.cgi?id=177178 Reviewed by Ryosuke Niwa. We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two. Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'. * browser-tests/commit-log-viewer-tests.js: * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js. (OwnedCommitViewer): (OwnedCommitViewer.prototype.didConstructShadowTree): (OwnedCommitViewer.prototype._toggleVisibility): (OwnedCommitViewer.prototype.render): (OwnedCommitViewer.prototype._renderOwnedCommitTable): (OwnedCommitViewer.htmlTemplate): (OwnedCommitViewer.cssTemplate): * public/v3/index.html: * public/v3/models/commit-log.js: (CommitLog): (CommitLog.prototype.updateSingleton): (CommitLog.prototype.ownsCommits): (CommitLog.prototype.fetchOwnedCommits): (CommitLog.prototype._buildOwnedCommitMap): (CommitLog.diffOwnedCommits): (CommitLog.prototype.ownsSubCommits): Deleted. (CommitLog.prototype.fetchSubCommits): Deleted. (CommitLog.prototype._buildSubCommitMap): Deleted. (CommitLog.diffSubCommits): Deleted. * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/tools-os-build-fetcher-tests.js: (return.waitForInvocationPromise.then): (string_appeared_here.return.waitForInvocationPromise.then): * tools/js/os-build-fetcher.js: (prototype._fetchAvailableBuilds): (prototype._addOwnedCommitsForBuild): (prototype._addSubCommitsForBuild): Deleted. * unit-tests/commit-log-tests.js: (return.commit.fetchOwnedCommits.then): (return.fetchingPromise.then): (return.commit.fetchSubCommits.then): Deleted. Canonical link: https://commits.webkit.org/193549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-19 21:47:41 +00:00
it("should return an empty list of commits if no owned-commit is associated with given commit", () => {
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('repositories', {'id': 2, 'name': 'WebKit'}),
db.insert('commits', {'id': 1, 'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'id': 2, 'repository': 2, 'revision': '210950', 'reported': true})
]).then(() => {
Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit. https://bugs.webkit.org/show_bug.cgi?id=177178 Reviewed by Ryosuke Niwa. We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two. Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'. * browser-tests/commit-log-viewer-tests.js: * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js. (OwnedCommitViewer): (OwnedCommitViewer.prototype.didConstructShadowTree): (OwnedCommitViewer.prototype._toggleVisibility): (OwnedCommitViewer.prototype.render): (OwnedCommitViewer.prototype._renderOwnedCommitTable): (OwnedCommitViewer.htmlTemplate): (OwnedCommitViewer.cssTemplate): * public/v3/index.html: * public/v3/models/commit-log.js: (CommitLog): (CommitLog.prototype.updateSingleton): (CommitLog.prototype.ownsCommits): (CommitLog.prototype.fetchOwnedCommits): (CommitLog.prototype._buildOwnedCommitMap): (CommitLog.diffOwnedCommits): (CommitLog.prototype.ownsSubCommits): Deleted. (CommitLog.prototype.fetchSubCommits): Deleted. (CommitLog.prototype._buildSubCommitMap): Deleted. (CommitLog.diffSubCommits): Deleted. * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/tools-os-build-fetcher-tests.js: (return.waitForInvocationPromise.then): (string_appeared_here.return.waitForInvocationPromise.then): * tools/js/os-build-fetcher.js: (prototype._fetchAvailableBuilds): (prototype._addOwnedCommitsForBuild): (prototype._addSubCommitsForBuild): Deleted. * unit-tests/commit-log-tests.js: (return.commit.fetchOwnedCommits.then): (return.fetchingPromise.then): (return.commit.fetchSubCommits.then): Deleted. Canonical link: https://commits.webkit.org/193549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-19 21:47:41 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/1/owned-commits?owner-revision=10.12%2016A323')
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
}).then((results) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.status, 'OK');
assert.deepStrictEqual(results.commits, []);
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
});
});
it("should return an empty list if commit revision is invalid", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('repositories', {'id': 2, 'name': 'WebKit'}),
db.insert('commits', {'id': 1, 'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'id': 2, 'repository': 2, 'revision': '210950', 'reported': true})
]).then(() => {
Use 'owned commit' instead of 'sub commit' whenever refers to a commit owned by another commit. https://bugs.webkit.org/show_bug.cgi?id=177178 Reviewed by Ryosuke Niwa. We use both 'owned commit' and 'sub commit' to refer to a commit owned by an another commit. We should use one term instead of two. Renaming 'subCommit' to 'ownedCommit', 'ownsSubCommit' to 'ownsCommit' and 'sub-commit' to 'owned-commit'. * browser-tests/commit-log-viewer-tests.js: * public/api/commits.php: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): * public/v3/components/owned-commit-viewer.js: Renamed from Websites/perf.webkit.org/public/v3/components/sub-commit-viewer.js. (OwnedCommitViewer): (OwnedCommitViewer.prototype.didConstructShadowTree): (OwnedCommitViewer.prototype._toggleVisibility): (OwnedCommitViewer.prototype.render): (OwnedCommitViewer.prototype._renderOwnedCommitTable): (OwnedCommitViewer.htmlTemplate): (OwnedCommitViewer.cssTemplate): * public/v3/index.html: * public/v3/models/commit-log.js: (CommitLog): (CommitLog.prototype.updateSingleton): (CommitLog.prototype.ownsCommits): (CommitLog.prototype.fetchOwnedCommits): (CommitLog.prototype._buildOwnedCommitMap): (CommitLog.diffOwnedCommits): (CommitLog.prototype.ownsSubCommits): Deleted. (CommitLog.prototype.fetchSubCommits): Deleted. (CommitLog.prototype._buildSubCommitMap): Deleted. (CommitLog.diffSubCommits): Deleted. * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/tools-os-build-fetcher-tests.js: (return.waitForInvocationPromise.then): (string_appeared_here.return.waitForInvocationPromise.then): * tools/js/os-build-fetcher.js: (prototype._fetchAvailableBuilds): (prototype._addOwnedCommitsForBuild): (prototype._addSubCommitsForBuild): Deleted. * unit-tests/commit-log-tests.js: (return.commit.fetchOwnedCommits.then): (return.fetchingPromise.then): (return.commit.fetchSubCommits.then): Deleted. Canonical link: https://commits.webkit.org/193549@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-19 21:47:41 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/1/owned-commits?owner-revision=10.12%2016A324')
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
}).then((results) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(results.status, 'OK');
assert.strictEqual(results.commits.length, 0);
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
});
})
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
describe('/api/commits/<repository>/?precedingRevision=<commit-1>&lastRevision=<commit-2>', () => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
it("should return RepositoryNotFound when there are no matching repository", () => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/?from=210900&to=211000').then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'RepositoryNotFound');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return UnknownCommit when one of the specified commit does not exist in the database", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z'})
]).then(() => {
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/?precedingRevision=210900&lastRevision=211000');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'UnknownCommit');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
it("should return an empty result when commits in the specified range have not been reported", () => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210949', 'time': '2017-01-20T03:23:50.645Z'}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z'}),
]).then(() => {
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/?precedingRevision=210949&lastRevision=210950');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
});
});
it("should return InvalidCommitRange when the specified range is backwards", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210949', 'time': '2017-01-20T03:23:50.645Z'}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z'}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/?precedingRevision=210950&lastRevision=210949');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidCommitRange');
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
});
});
it("should return use the commit order when time is not specified", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2555', order: 2, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2657', order: 3, 'reported': true}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/macOS/?precedingRevision=10.12%2016A323&lastRevision=10.12%2016B2657');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'].map((commit) => commit['revision']), ['10.12 16B2555', '10.12 16B2657']);
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
});
});
it("should return InconsistentCommits when precedingRevision specifies a time but lastRevision does not", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16A323', time: '2017-01-20T03:23:50.645Z', order: 1, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2555', order: 2, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2657', order: 3, 'reported': true}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/macOS/?precedingRevision=10.12%2016A323&lastRevision=10.12%2016B2657');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InconsistentCommits');
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
});
});
it("should return InconsistentCommits when precedingRevision does not specify a time has a time but lastRevision does", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2555', order: 2, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2657', time: '2017-01-20T03:23:50.645Z', order: 3, 'reported': true}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/macOS/?precedingRevision=10.12%2016A323&lastRevision=10.12%2016B2657');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InconsistentCommits');
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
});
});
it("should return empty results when precedingRevision does not specify a time or an order has a time but lastRevision does", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16A323', 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2555', order: 2, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2657', order: 3, 'reported': true}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/macOS/?precedingRevision=10.12%2016A323&lastRevision=10.12%2016B2657');
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
});
});
it("should return empty results when precedingRevision an order has a time but lastRevision does not", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16A323', order: 1, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2555', order: 2, 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '10.12 16B2657', 'reported': true}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/macOS/?precedingRevision=10.12%2016A323&lastRevision=10.12%2016B2657');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['commits'], []);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});
it("should return reported commits in the specified range", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
db.insert('commits', {'repository': 1, 'revision': '210948', 'time': '2017-01-20T02:52:34.577Z', 'reported': true}),
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
db.insert('commits', {'repository': 1, 'revision': '210949', 'time': '2017-01-20T03:23:50.645Z', 'reported': true}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z', 'reported': true}),
]).then(() => {
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/WebKit/?precedingRevision=210948&lastRevision=210950');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
}).then((result) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 2);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
assertCommitIsSameAsOneSubmitted(result['commits'][0], {
previousCommit: null,
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
revision: '210949',
time: '2017-01-20T03:23:50.645Z',
author: {name: null, account: null},
message: null,
});
assertCommitIsSameAsOneSubmitted(result['commits'][1], {
previousCommit: null,
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
revision: '210950',
time: '2017-01-20T03:49:37.887Z',
author: {name: null, account: null},
message: null,
});
});
});
it("should return reported commits in the specified revision label range", async () => {
const db = TestServer.database();
await db.insert('repositories', {'id': 1, 'name': 'WebKit'});
await db.insert('commits', {'repository': 1, 'revision': '210948', 'revision_identifier': '184276@main', 'time': '2017-01-20T02:52:34.577Z', 'reported': true});
await db.insert('commits', {'repository': 1, 'revision': '210949', 'revision_identifier': '184277@main', 'time': '2017-01-20T03:23:50.645Z', 'reported': true});
await db.insert('commits', {'repository': 1, 'revision': '210950', 'revision_identifier': '184278@main', 'time': '2017-01-20T03:49:37.887Z', 'reported': true});
const result = await TestServer.remoteAPI().getJSON('/api/commits/WebKit/?precedingRevision=184276@main&lastRevision=184278@main');
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 2);
assertCommitIsSameAsOneSubmitted(result['commits'][0], {
previousCommit: null,
revision: '210949',
revisionIdentifier: '184289@main',
time: '2017-01-20T03:23:50.645Z',
author: {name: null, account: null},
message: null,
});
assertCommitIsSameAsOneSubmitted(result['commits'][1], {
previousCommit: null,
revision: '210950',
revisionIdentifier: '184290@main',
time: '2017-01-20T03:49:37.887Z',
author: {name: null, account: null},
message: null,
});
});
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
it("should not include a revision not within the specified range", () => {
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
const db = TestServer.database();
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
const remote = TestServer.remoteAPI();
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
db.insert('commits', {'repository': 1, 'revision': '210947', 'time': '2017-01-20T02:38:45.485Z', 'reported': false}),
db.insert('commits', {'repository': 1, 'revision': '210948', 'time': '2017-01-20T02:52:34.577Z', 'reported': false}),
db.insert('commits', {'repository': 1, 'revision': '210949', 'time': '2017-01-20T03:23:50.645Z', 'reported': false}),
db.insert('commits', {'repository': 1, 'revision': '210950', 'time': '2017-01-20T03:49:37.887Z', 'reported': false}),
]).then(() => {
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
return addWorkerForReport(subversionCommits);
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
}).then(() => {
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
return remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
}).then(() => {
Charts page show an inconsistent list of revisions for Git and Subversion https://bugs.webkit.org/show_bug.cgi?id=169888 Reviewed by Andreas Kling. With Git, CommitLogViewer was showing the list of revisions including the starting hash, which was the last data point's revision instead of all revisions after the last data point. Fixed the bug by always specifying the revision at the last data point in both Subversion and Git and then making /api/commits/<repository>/?from=X&to=Y exclude the first revision. For clarity, "from" and "to" query parameters have been renamed to "precedingRevision" and "lastRevision" respectively. We also no longer adds 1 to the starting revision of Subversion-like starting revisions. e.g. when the last data point was at r1234, new data point is at r1250, the label is now "r1234-r1250" instead of "r1235-r1250". * browser-tests/chart-revision-range-tests.js: Fixed the tests since revisionList no longer specifies from/to revisions. * browser-tests/commit-log-viewer-tests.js: Added. Added tests for CommitLogViewer. * browser-tests/index.html: Include the new test. Also use a local copy of mocha.js/css. * public/api/commits.php: (main): Renamed "from" and "to" query parameters. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_between): Added a check that commit time should either be specified in both rows or not specified in either. Also reject when before_first_revision is identical or after last_revision instead of re-ordering them since it no longer makes sense to do so with new query parameter names. * public/v3/components/base.js: (ComponentBase._addContentToElement): Use Array.isArray instead of instanceof. It's resilient againt realm (global object) differences. * public/v3/components/chart-pane-base.js: (ChartPaneBase.prototype._updateCommitLogViewer): No longer calls enqueueToRender on this since CommitLogViewer does that on its own now. (ChartPaneBase.prototype.render): Juse use this._openRepository instead of relying on CommitLogViewer to remember which repository is current. This was the only use of currentRepository. * public/v3/components/commit-log-viewer.js: (CommitLogViewer): (CommitLogViewer.prototype.currentRepository): Deleted. (CommitLogViewer.prototype.view): (CommitLogViewer.prototype._fetchCommitLogs): Modernized and extracted from view to make it lazy. Call fetchForSingleRevision when precedingRevision is not specified or it's identical to lastRevision since the generic JSON API no longer supports being called with the identical revisions. (CommitLogViewer.prototype.render): Modernized & simplified the code. (CommitLogViewer.prototype._renderCommitList): Extracted from render to make it lazy. (CommitLogViewer.htmlTemplate): Add ID on caption & tbody so that they're more easily addressable. (CommitLogViewer.cssTemplate): * public/v3/models/commit-log.js: (CommitLog.prototype.diff): No longer includes from/to revisions in the result. Also avoid adding 1 to a Subversion-like starting revision for creating the label. See above. But we still do this for forming URLs due to the way tools like Trac work with Subversion revisions. (CommitLog.fetchBetweenRevisions): Rewritten using DataModel.prototype.cachedFetch with FIXME for what this function is supposed to be doing. (CommitLog._cachedCommitLogs): Deleted. (CommitLog.fetchForSingleRevision): Added. (CommitLog._constructFromRawData): Added. * public/v3/models/data-model.js: (DataModelObject.cachedFetch): Don't parse query values as an integer. Just URL-escape them. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequest): Fixed a typo. * server-tests/api-commits-tests.js: Renamed from api-commits.js. Updated the existing tests to use new query parameters and added more test cases. * unit-tests/commit-log-tests.js: Updated the test cases now that CommitLog.prototype.diff no longer includes from/to values. They're computed in ChartRevisionRange instead. Canonical link: https://commits.webkit.org/186834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-21 01:19:39 +00:00
return remote.getJSON('/api/commits/WebKit/?precedingRevision=210947&lastRevision=210949');
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
}).then((result) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 2);
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'][0]);
assertCommitIsSameAsOneSubmitted(result['commits'][1], subversionCommits['commits'][1]);
});
});
it("should not include a revision not within the specified commit revision label range", async () => {
const db = TestServer.database();
const remote = TestServer.remoteAPI();
await db.insert('repositories', {'id': 1, 'name': 'WebKit'}),
await db.insert('commits', {'repository': 1, 'revision': '210947', 'revision_identifier': '184275@main', 'time': '2017-01-20T02:38:45.485Z', 'reported': false});
await db.insert('commits', {'repository': 1, 'revision': '210948', 'revision_identifier': '184276@main', 'time': '2017-01-20T02:52:34.577Z', 'reported': false});
await db.insert('commits', {'repository': 1, 'revision': '210949', 'revision_identifier': '184277@main', 'time': '2017-01-20T03:23:50.645Z', 'reported': false});
await db.insert('commits', {'repository': 1, 'revision': '210950', 'revision_identifier': '184278@main', 'time': '2017-01-20T03:49:37.887Z', 'reported': false});
await addWorkerForReport(subversionCommits);
await remote.postJSONWithStatus('/api/report-commits/', subversionCommits);
const result = await remote.getJSON('/api/commits/WebKit/?precedingRevision=184275@main&lastRevision=184277@main');
assert.strictEqual(result['status'], 'OK');
assert.deepStrictEqual(result['commits'].length, 2);
assertCommitIsSameAsOneSubmitted(result['commits'][0], subversionCommits['commits'][0]);
assertCommitIsSameAsOneSubmitted(result['commits'][1], subversionCommits['commits'][1]);
});
REGRESSION(r198234): /api/commits/%revision% always fails https://bugs.webkit.org/show_bug.cgi?id=167235 Reviewed by Antti Koivisto. The bug was caused by a typo in CommitLogFetcher::fetch_revision, which was calling commit_for_revision on $this->db instead of $this. This had been monkey-patched in the internal dashboard so it was working there. Also fixed a bug that /latest wasn't doing what it claimed to do, and a bug that /oldest /latest, and /last-reported would return a commit with all values set to null instead of an empty list. Finally, added server API tests for /api/commits. * public/api/commits.php: (main): Add a comment for APIs that only exist for v2 UI. * public/include/commit-log-fetcher.php: (CommitLogFetcher::fetch_latest): Fixed the bug that this function was returning the oldest commit, not the the latest commit as desired. (CommitLogFetcher::fetch_revision): Fixed the bug that this function would always encounter an exception because commit_for_revision is defined on $this, not $this->db. (CommitLogFetcher::format_single_commit): Return an empty list instead of an array with a single commit with all values set to null. * server-tests/api-commits.js: Added. Added tests for the JSON API at /api/commits. (.assertCommitIsSameAsOneSubmitted): Added. A helper function to compare a commit returned by /api/commits to one sent to /api/report-commits. Canonical link: https://commits.webkit.org/184299@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-20 22:02:09 +00:00
});
});