haikuwebkit/Websites/perf.webkit.org/server-tests/tools-os-build-fetcher-test...

1024 lines
60 KiB
JavaScript
Raw Permalink Normal View History

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
'use strict';
const assert = require('assert');
const OSBuildFetcher = require('../tools/js/os-build-fetcher.js').OSBuildFetcher;
const MockRemoteAPI = require('../unit-tests/resources/mock-remote-api.js').MockRemoteAPI;
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;
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 prepareServerTest = require('./resources/common-operations.js').prepareServerTest;
const MockSubprocess = require('./resources/mock-subprocess.js').MockSubprocess;
const MockLogger = require('./resources/mock-logger.js').MockLogger;
describe('OSBuildFetcher', function() {
this.timeout(5000);
Tool scripts should not use PrivilegedAPI from 'public/v3/privileged-api.js'. https://bugs.webkit.org/show_bug.cgi?id=184766 Reviewed by Ryosuke Niwa. For tools, we should not use PrivilegedAPI for tools as current PrivilegedAPI is used by UI and it is unnecessary to generate CSRF token for tools. Will post a followup patch that creates a PrivilegedAPI used by tools. Make a change on TestServer.inject and MockRemoteAPI.inject to allow specifying BrowserPrivilegedAPI or NodePrivilegedAPI in the test. Currently defaults to BrowserPrivilegedAPI as this is the test behavior before this change. * server-tests/resources/common-operations.js: Allow passing type of privileged api information to TestServer.inject. * server-tests/resources/test-server.js: Conditionally inject PrivilegedAPI based on type of privileged api. (TestServer.prototype.inject): (TestServer): * server-tests/tools-buildbot-triggerable-tests.js: Updated 'prepareServerTest' invocation. * server-tests/tools-os-build-fetcher-tests.js: Updated 'prepareServerTest' invocation. * server-tests/tools-sync-buildbot-integration-tests.js: Temporarily injecting BrowserPrivilegedAPI for mocking UploadedFile. The actual script does not rely on BrowserPrivilegedAPI at all. (async.createTestGroupWihPatch): (beforeEach): * tools/js/privileged-api.js: Added NodePrivilegedAPI (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): Configure the slave name and password. (NodePrivilegedAPI): * tools/js/v3-models.js: Removed the import of PrivilegedAPI. * unit-tests/privileged-api-tests.js:. Added unit tests for NodePrivilegedAPI. * unit-tests/resources/mock-remote-api.js: Conditionally inject PrivilegedAPI based on the type of privileged api. (MockRemoteAPI.inject): Canonical link: https://commits.webkit.org/200433@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-24 17:17:42 +00:00
TestServer.inject('node');
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
beforeEach(function () {
MockRemoteAPI.reset('http://build.webkit.org');
MockSubprocess.reset();
});
const emptyReport = {
[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',
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
};
[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 workerAuth = {
'name': 'someWorker',
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
'password': 'somePassword'
};
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 ownedCommitWithWebKit = {
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
'WebKit': {'revision': '141978'}
};
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 anotherownedCommitWithWebKit = {
'WebKit': {'revision': '141999'}
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
};
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 anotherownedCommitWithWebKitAndJavaScriptCore = {
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
'WebKit': {'revision': '142000'},
'JavaScriptCore': {'revision': '142000'}
};
const osxCommit = {
'repository': 'OSX',
'revision': 'Sierra16D32',
'order': 1603003200
};
const anotherOSXCommit = {
'repository': 'OSX',
'revision': 'Sierra16E32',
'order': 1603003200
};
const config = {
'name': 'OSX',
'customCommands': [
{
'command': ['list', 'all osx 16Dxx builds'],
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
'ownedCommitCommand': ['list', 'ownedCommit', 'for', 'revision'],
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
'linesToIgnore': '^\\.*$',
'minRevision': 'Sierra16D0',
'maxRevision': 'Sierra16D999'
},
{
'command': ['list', 'all osx 16Exx builds'],
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
'ownedCommitCommand': ['list', 'ownedCommit', 'for', 'revision'],
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
'linesToIgnore': '^\\.*$',
'minRevision': 'Sierra16E0',
'maxRevision': 'Sierra16E999'
}
]
};
const configWithoutOwnedCommitCommand = {
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
'name': 'OSX',
'customCommands': [
{
'command': ['list', 'all osx 16Dxx builds'],
'linesToIgnore': '^\\.*$',
'minRevision': 'Sierra16D0',
'maxRevision': 'Sierra16D999'
},
{
'command': ['list', 'all osx 16Exx builds'],
'linesToIgnore': '^\\.*$',
'minRevision': 'Sierra16E0',
'maxRevision': 'Sierra16E999'
}
]
};
const configTrackingOneOS = {
'name': 'OSX',
'customCommands': [
{
'command': ['list', 'all osx 16Dxx builds'],
'linesToIgnore': '^\\.*$',
'minRevision': 'Sierra16D100',
'maxRevision': 'Sierra16D999'
}
]
};
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('OSBuilderFetcher._computeOrder', () => {
it('should calculate the right order for a given valid revision', () => {
const fetcher = new OSBuildFetcher({});
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(fetcher._computeOrder('Sierra16D32'), 1603003200);
assert.strictEqual(fetcher._computeOrder('16D321'), 1603032100);
assert.strictEqual(fetcher._computeOrder('16d321'), 1603032100);
assert.strictEqual(fetcher._computeOrder('16D321z'), 1603032126);
assert.strictEqual(fetcher._computeOrder('16d321Z'), 1603032126);
assert.strictEqual(fetcher._computeOrder('10.12.3 16D32'), 1603003200);
assert.strictEqual(fetcher._computeOrder('10.12.3 Sierra16D32'), 1603003200);
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
});
it('should throw assertion error when given a invalid revision', () => {
const fetcher = new OSBuildFetcher({});
assert.throws(() => fetcher._computeOrder('invalid'), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder(''), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder('16'), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder('16D'), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder('123'), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder('D123'), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder('123z'), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder('16[163'), 'AssertionError [ERR_ASSERTION]');
assert.throws(() => fetcher._computeOrder('16D163['), 'AssertionError [ERR_ASSERTION]');
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('OSBuilderFetcher._commitsForAvailableBuilds', () => {
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
it('should compatible with command output only contains lines of revision', async () => {
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 logger = new MockLogger;
const fetcher = new OSBuildFetcher({}, null, null, MockSubprocess, logger);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const fetchCommitsPromise = fetcher._commitsForAvailableBuilds(['list', 'build1'], '^\\.*$');
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
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
await waitForInvocationPromise;
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(MockSubprocess.invocations.length, 1);
assert.deepStrictEqual(MockSubprocess.invocations[0].command, ['list', 'build1']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const expectedResults = {allRevisions: ["16D321", "16E321z", "16F321"], commitsWithTestability: {}};
await MockSubprocess.invocations[0].resolve('16D321\n16E321z\n\n16F321');
const buildInfo = await fetchCommitsPromise;
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.deepStrictEqual(expectedResults, buildInfo);
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
});
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
it('should parse the command output as JSON format', async () => {
const logger = new MockLogger;
const fetcher = new OSBuildFetcher({}, null, null, MockSubprocess, logger);
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const fetchCommitsPromise = fetcher._commitsForAvailableBuilds(['list', 'build1']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
await waitForInvocationPromise;
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(MockSubprocess.invocations.length, 1);
assert.deepStrictEqual(MockSubprocess.invocations[0].command, ['list', 'build1']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const outputObject = {allRevisions: ["16D321", "16E321z", "16F321"], commitsWithTestability: {"16D321": "Panic"}};
await MockSubprocess.invocations[0].resolve(JSON.stringify(outputObject));
const buildInfo = await fetchCommitsPromise;
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.deepStrictEqual(outputObject, buildInfo);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
});
});
describe('OSBuilderFetcher._commitsWithinRange', () => {
it('should only return commits whose orders are higher than specified order', async () => {
const logger = new MockLogger;
const fetcher = new OSBuildFetcher({}, null, null, MockSubprocess, logger);
const results = fetcher._commitsWithinRange(["16D321", "16E321z", "16F321"], "OSX", 1604000000, 1606000000);
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, 2);
assert.deepStrictEqual(results[0], {repository: 'OSX', order: 1604032126, revision: '16E321z'});
assert.deepStrictEqual(results[1], {repository: 'OSX', order: 1605032100, revision: '16F321'});
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
});
it('should only return commits whose orders are higher than minOrder and lower than the maxOrder', async () => {
const logger = new MockLogger;
const fetcher = new OSBuildFetcher({}, null, null, MockSubprocess, logger);
const results = fetcher._commitsWithinRange(["16D321", "16E321z", "16F321"], "OSX", 1604000000, 1605000000);
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);
assert.deepStrictEqual(results[0], {repository: 'OSX', order: 1604032126, revision: '16E321z'});
});
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
});
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('OSBuildFetcher._addOwnedCommitsForBuild', () => {
it('should add owned-commit info for commits', () => {
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 logger = new MockLogger;
const fetcher = new OSBuildFetcher({}, null, null, MockSubprocess, logger);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
const addownedCommitPromise = fetcher._addOwnedCommitsForBuild([osxCommit, anotherOSXCommit], ['ownedCommit', 'for', 'revision']);
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
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return waitForInvocationPromise.then(() => {
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(MockSubprocess.invocations.length, 1);
assert.deepStrictEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', 'revision', 'Sierra16D32']);
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
MockSubprocess.invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
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
MockSubprocess.reset();
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.waitForInvocation();
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(() => {
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(MockSubprocess.invocations.length, 1);
assert.deepStrictEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', 'revision', 'Sierra16E32']);
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
MockSubprocess.invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
return addownedCommitPromise;
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((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.length, 2);
assert.strictEqual(results[0]['repository'], osxCommit['repository']);
assert.strictEqual(results[0]['revision'], osxCommit['revision']);
assert.deepStrictEqual(results[0]['ownedCommits'], ownedCommitWithWebKit);
assert.strictEqual(results[1]['repository'], anotherOSXCommit['repository']);
assert.strictEqual(results[1]['revision'], anotherOSXCommit['revision']);
assert.deepStrictEqual(results[1]['ownedCommits'], anotherownedCommitWithWebKit);
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
});
});
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 fail if the command to get owned-commit info fails', () => {
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 logger = new MockLogger;
const fetcher = new OSBuildFetcher({}, null, null, MockSubprocess, logger);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
const addownedCommitPromise = fetcher._addOwnedCommitsForBuild([osxCommit], ['ownedCommit', 'for', 'revision'])
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
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return waitForInvocationPromise.then(() => {
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(MockSubprocess.invocations.length, 1);
assert.deepStrictEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', 'revision', 'Sierra16D32']);
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
MockSubprocess.invocations[0].reject('Failed getting owned-commit');
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
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 addownedCommitPromise.then(() => {
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
assert(false, 'should never be reached');
}, (error_output) => {
assert(error_output);
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(error_output, 'Failed getting owned-commit');
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
});
});
});
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 fail if entries in owned-commits does not contain revision', () => {
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 logger = new MockLogger;
const fetcher = new OSBuildFetcher({}, null, null, MockSubprocess, logger);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
const addownedCommitPromise = fetcher._addOwnedCommitsForBuild([osxCommit], ['ownedCommit', 'for', 'revision'])
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
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return waitForInvocationPromise.then(() => {
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(MockSubprocess.invocations.length, 1);
assert.deepStrictEqual(MockSubprocess.invocations[0].command, ['ownedCommit', 'for', '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
MockSubprocess.invocations[0].resolve('{"WebKit":{"RandomKey": "RandomValue"}}');
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 addownedCommitPromise.then(() => {
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
assert(false, 'should never be reached');
}, (error_output) => {
assert(error_output);
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(error_output.name, 'AssertionError');
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
});
});
})
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +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
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
describe('OSBuildFetcher.fetchReportAndUpdateBuilds', () => {
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
const invocations = MockSubprocess.invocations;
beforeEach(function () {
TestServer.database().connect({keepAlive: true});
});
afterEach(function () {
TestServer.database().disconnect();
});
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
it('should be backward compatible and report all build commits with owned-commits', () => {
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 logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(config, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
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 db = TestServer.database();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
let fetchReportAndUpdateBuildsPromise = null;
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
let fetchAvailableBuildsPromise = null;
[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(emptyReport).then(() => {
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
return Promise.all([
db.insert('repositories', {'id': 10, 'name': 'OSX'}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(parseInt(result['commits'][0]['order'])), 1603006800);
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
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
fetchAvailableBuildsPromise = fetcher._fetchAvailableBuilds();
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return waitForInvocationPromise;
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
invocations[0].resolve('\n\nSierra16D68\nSierra16D69\n');
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
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
invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
invocations[0].resolve('\n\nSierra16E32\nSierra16E33\nSierra16E33h\nSierra16E34');
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
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
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
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
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKitAndJavaScriptCore));
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
return fetchAvailableBuildsPromise;
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
}).then(() => {
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
MockSubprocess.reset();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
fetchReportAndUpdateBuildsPromise = fetcher.fetchReportAndUpdateBuilds();
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.waitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
invocations[0].resolve('\n\nSierra16D68\nSierra16D69\n');
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
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
invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
invocations[0].resolve('\n\nSierra16E32\nSierra16E33\nSierra16E33h\nSierra16E34');
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
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
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
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
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKitAndJavaScriptCore));
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.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
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
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
return fetchReportAndUpdateBuildsPromise;
}).then(() => {
return Promise.all([
db.selectRows('repositories', {'name': 'WebKit'}),
db.selectRows('repositories', {'name': 'JavaScriptCore'}),
db.selectRows('commits', {'revision': 'Sierra16D69'}),
db.selectRows('commits', {'revision': 'Sierra16E33h'}),
db.selectRows('commits', {'revision': 'Sierra16E34'})]);
}).then((results) => {
const webkitRepository = results[0];
const jscRepository = results[1];
const osxCommit16D69 = results[2];
const osxCommit16E33h = results[3];
const osxCommit16E34 = results[4];
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(webkitRepository.length, 1);
assert.strictEqual(webkitRepository[0]['owner'], 10);
assert.strictEqual(jscRepository.length, 1);
assert.strictEqual(jscRepository[0]['owner'], 10);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16D69.length, 1);
assert.strictEqual(osxCommit16D69[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D69[0]['order']), 1603006900);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16E33h.length, 1);
assert.strictEqual(osxCommit16E33h[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E33h[0]['order']), 1604003308);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16E34.length, 1);
assert.strictEqual(osxCommit16E34[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E34[0]['order']), 1604003400);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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((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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D69');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006900);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E34');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003400);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
});
});
it('should report all build commits with owned-commits', () => {
const logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(config, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const db = TestServer.database();
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69"], commitsWithTestability: {}};
const resultsForSierraE = {allRevisions: ["Sierra16E32", "Sierra16E33", "Sierra16E33h", "Sierra16E34"], commitsWithTestability: {}};
let fetchReportAndUpdateBuildsPromise = null;
let fetchAvailableBuildsPromise = null;
[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(emptyReport).then(() => {
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
return Promise.all([
db.insert('repositories', {'id': 10, 'name': 'OSX'}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006800);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
fetchAvailableBuildsPromise = fetcher._fetchAvailableBuilds();
return waitForInvocationPromise;
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraE));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKitAndJavaScriptCore));
return fetchAvailableBuildsPromise;
}).then(() => {
MockSubprocess.reset();
fetchReportAndUpdateBuildsPromise = fetcher.fetchReportAndUpdateBuilds();
return MockSubprocess.waitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraE));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKitAndJavaScriptCore));
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.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
return fetchReportAndUpdateBuildsPromise;
}).then(() => {
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
return Promise.all([
db.selectRows('repositories', {'name': 'WebKit'}),
db.selectRows('repositories', {'name': 'JavaScriptCore'}),
db.selectRows('commits', {'revision': 'Sierra16D69'}),
db.selectRows('commits', {'revision': 'Sierra16E33h'}),
db.selectRows('commits', {'revision': 'Sierra16E34'})]);
}).then((results) => {
const webkitRepository = results[0];
const jscRepository = results[1];
const osxCommit16D69 = results[2];
const osxCommit16E33h = results[3];
const osxCommit16E34 = results[4];
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(webkitRepository.length, 1);
assert.strictEqual(webkitRepository[0]['owner'], 10);
assert.strictEqual(jscRepository.length, 1);
assert.strictEqual(jscRepository[0]['owner'], 10);
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
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(osxCommit16D69.length, 1);
assert.strictEqual(osxCommit16D69[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D69[0]['order']), 1603006900);
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
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(osxCommit16E33h.length, 1);
assert.strictEqual(osxCommit16E33h[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E33h[0]['order']), 1604003308);
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
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(osxCommit16E34.length, 1);
assert.strictEqual(osxCommit16E34[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E34[0]['order']), 1604003400);
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
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D69');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006900);
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
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E34');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003400);
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
});
});
it('should update testability message for commits', async () => {
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(config, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const db = TestServer.database();
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69"], commitsWithTestability: {"Sierra16D68": "Panic", "Sierra16D69": "Spin CPU"}};
const resultsForSierraE = {allRevisions: ["Sierra16E32", "Sierra16E33", "Sierra16E33h", "Sierra16E34"], commitsWithTestability: {"Sierra16E31": "WebKit crashes"}};
[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(emptyReport);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
await Promise.all([
db.insert('repositories', {'id': 10, 'name': 'OSX'}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E31', 'order': 1604003100, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
let result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006800);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const fetchReportAndUpdatePromise = fetcher.fetchReportAndUpdateBuilds();
await MockSubprocess.waitForInvocation();
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
await MockSubprocess.resetAndWaitForInvocation();
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
await MockSubprocess.resetAndWaitForInvocation();
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraE));
await MockSubprocess.resetAndWaitForInvocation();
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
await MockSubprocess.resetAndWaitForInvocation();
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(invocations.length, 1);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKitAndJavaScriptCore));
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.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
await fetchReportAndUpdatePromise;
const webkitRepository = await db.selectRows('repositories', {'name': 'WebKit'});
const jscRepository = await db.selectRows('repositories', {'name': 'JavaScriptCore'});
const osxCommit16D68 = await db.selectRows('commits', {'revision': 'Sierra16D68'});
const osxCommit16D69 = await db.selectRows('commits', {'revision': 'Sierra16D69'});
const osxCommit16E31 = await db.selectRows('commits', {'revision': 'Sierra16E31'});
const osxCommit16E33h = await db.selectRows('commits', {'revision': 'Sierra16E33h'});
const osxCommit16E34 = await db.selectRows('commits', {'revision': 'Sierra16E34'});
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(webkitRepository.length, 1);
assert.strictEqual(webkitRepository[0]['owner'], 10);
assert.strictEqual(jscRepository.length, 1);
assert.strictEqual(jscRepository[0]['owner'], 10);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16D68.length, 1);
assert.strictEqual(osxCommit16D68[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D68[0]['order']), 1603006800);
assert.strictEqual(osxCommit16D68[0]['testability'], "Panic");
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16D69.length, 1);
assert.strictEqual(osxCommit16D69[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D69[0]['order']), 1603006900);
assert.strictEqual(osxCommit16D69[0]['testability'], "Spin CPU");
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16E31.length, 1);
assert.strictEqual(osxCommit16E31[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E31[0]['order']), 1604003100);
assert.strictEqual(osxCommit16E31[0]['testability'], "WebKit crashes");
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16E33h.length, 1);
assert.strictEqual(osxCommit16E33h[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E33h[0]['order']), 1604003308);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
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(osxCommit16E34.length, 1);
assert.strictEqual(osxCommit16E34[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E34[0]['order']), 1604003400);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D69');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006900);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E34');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003400);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
});
it('should report commits without owned-commits if "ownedCommitCommand" is not specified in config', async () => {
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 logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(configWithoutOwnedCommitCommand, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
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 db = TestServer.database();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69"], commitsWithTestability: {}};
const resultsForSierraE = {allRevisions: ["Sierra16E32", "Sierra16E33", "Sierra16E33h", "Sierra16E34"], commitsWithTestability: {}};
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
[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(emptyReport);
await Promise.all([
db.insert('repositories', {'id': 10, 'name': 'OSX'}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
let result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006800);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
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 waitForInvocationPromise = MockSubprocess.waitForInvocation();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const fetchReportAndUpdatePromise = fetcher.fetchReportAndUpdateBuilds();
await waitForInvocationPromise;
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
await MockSubprocess.resetAndWaitForInvocation();
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraE));
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
result = await fetchReportAndUpdatePromise;
const results = await Promise.all([
db.selectRows('repositories', {'name': 'WebKit'}),
db.selectRows('repositories', {'name': 'JavaScriptCore'}),
db.selectRows('commits', {'revision': 'Sierra16D69'}),
db.selectRows('commits', {'revision': 'Sierra16E33h'}),
db.selectRows('commits', {'revision': 'Sierra16E34'})]);
const webkitRepository = results[0];
const jscRepository = results[1];
const osxCommit16D69 = results[2];
const osxCommit16E33h = results[3];
const osxCommit16E34 = results[4];
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(webkitRepository.length, 0);
assert.strictEqual(jscRepository.length, 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(osxCommit16D69.length, 1);
assert.strictEqual(osxCommit16D69[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D69[0]['order']), 1603006900);
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(osxCommit16E33h.length, 1);
assert.strictEqual(osxCommit16E33h[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E33h[0]['order']), 1604003308);
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(osxCommit16E34.length, 1);
assert.strictEqual(osxCommit16E34[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E34[0]['order']), 1604003400);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D69');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006900);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E34');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003400);
});
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
it('should report commits within specified revision range', async () => {
const logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(configWithoutOwnedCommitCommand, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
const db = TestServer.database();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69", "Sierra16D10000"], commitsWithTestability: {}};
const resultsForSierraE = {allRevisions: ["Sierra16E32", "Sierra16E33", "Sierra16E33h", "Sierra16E34", "Sierra16E10000"], commitsWithTestability: {}};
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
[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(emptyReport);
await Promise.all([
db.insert('repositories', {'id': 10, 'name': 'OSX'}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
let result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006800);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const fetchReportAndUpdatePromise = fetcher.fetchReportAndUpdateBuilds();
await waitForInvocationPromise;
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
await MockSubprocess.resetAndWaitForInvocation();
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraE));
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
result = await fetchReportAndUpdatePromise;
const results = await Promise.all([
db.selectRows('repositories', {'name': 'WebKit'}),
db.selectRows('repositories', {'name': 'JavaScriptCore'}),
db.selectRows('commits', {'revision': 'Sierra16D69'}),
db.selectRows('commits', {'revision': 'Sierra16E33h'}),
db.selectRows('commits', {'revision': 'Sierra16E34'})]);
const webkitRepository = results[0];
const jscRepository = results[1];
const osxCommit16D69 = results[2];
const osxCommit16E33h = results[3];
const osxCommit16E34 = results[4];
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(webkitRepository.length, 0);
assert.strictEqual(jscRepository.length, 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(osxCommit16D69.length, 1);
assert.strictEqual(osxCommit16D69[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D69[0]['order']), 1603006900);
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(osxCommit16E33h.length, 1);
assert.strictEqual(osxCommit16E33h[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E33h[0]['order']), 1604003308);
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(osxCommit16E34.length, 1);
assert.strictEqual(osxCommit16E34[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16E34[0]['order']), 1604003400);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D69');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006900);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E34');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003400);
});
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
it('should update commits within specified revision range', async () => {
const logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(configWithoutOwnedCommitCommand, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
const db = TestServer.database();
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69"], commitsWithTestability: {"Sierra16D10000": "Panic"}};
const resultsForSierraE = {allRevisions: ["Sierra16E32", "Sierra16E33", "Sierra16E33h", "Sierra16E34", "Sierra16E10000"], commitsWithTestability: {}};
[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(emptyReport);
await Promise.all([
db.insert('repositories', {'id': 10, 'name': 'OSX'}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
let result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006800);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
const fetchAvailableBuildsPromise = fetcher._fetchAvailableBuilds();
await waitForInvocationPromise;
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
invocations[0].resolve(JSON.stringify(resultsForSierraD));
await MockSubprocess.resetAndWaitForInvocation();
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
invocations[0].resolve(JSON.stringify(resultsForSierraE));
result = await fetchAvailableBuildsPromise;
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.commitsToUpdate.length, 0);
});
it('should use "last-reported" order + 1 as "minOrder"', async () => {
const logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(configTrackingOneOS, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
const db = TestServer.database();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69", "Sierra16D100", "Sierra16D100a"], commitsWithTestability: {}};
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
[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(emptyReport);
await db.insert('repositories', {'id': 10, 'name': 'OSX'});
await db.insert('commits', {'repository': 10, 'revision': 'Sierra16D100', 'order': 1603010000, 'reported': true});
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
let result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603010000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D100');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603010000);
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 waitForInvocationPromise = MockSubprocess.waitForInvocation();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const fetchAndReportPromise = fetcher.fetchReportAndUpdateBuilds();
await waitForInvocationPromise;
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
result = await fetchAndReportPromise;
const results = await Promise.all([
db.selectRows('repositories', {'name': 'WebKit'}),
db.selectRows('repositories', {'name': 'JavaScriptCore'}),
db.selectRows('commits', {'revision': 'Sierra16D69'}),
db.selectRows('commits', {'revision': 'Sierra16D100a'})]);
const webkitRepository = results[0];
const jscRepository = results[1];
const osxCommit16D69 = results[2];
const osxCommit16D100a = results[3];
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(webkitRepository.length, 0);
assert.strictEqual(jscRepository.length, 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(osxCommit16D69.length, 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(osxCommit16D100a.length, 1);
assert.strictEqual(osxCommit16D100a[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D100a[0]['order']), 1603010001);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603010000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D100a');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603010001);
});
it('should use minRevision in the config if there is no commit', async () => {
const logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(configTrackingOneOS, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
const db = TestServer.database();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69", "Sierra16D100", "Sierra16D101"], commitsWithTestability: {}};
[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(emptyReport);
await db.insert('repositories', {'id': 10, 'name': 'OSX'});
let result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603010000&to=1603099900');
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['commits'].length, 0);
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const fetchReportAndUpdatePromise = fetcher.fetchReportAndUpdateBuilds();
await waitForInvocationPromise;
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
result = await fetchReportAndUpdatePromise;
const results = await Promise.all([
db.selectRows('repositories', {'name': 'WebKit'}),
db.selectRows('repositories', {'name': 'JavaScriptCore'}),
db.selectRows('commits', {'revision': 'Sierra16D69'}),
db.selectRows('commits', {'revision': 'Sierra16D100'}),
db.selectRows('commits', {'revision': 'Sierra16D101'})]);
const webkitRepository = results[0];
const jscRepository = results[1];
const osxCommit16D69 = results[2];
const osxCommit16D100 = results[3];
const osxCommit16D101 = results[4];
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(webkitRepository.length, 0);
assert.strictEqual(jscRepository.length, 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(osxCommit16D69.length, 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(osxCommit16D100.length, 1);
assert.strictEqual(osxCommit16D100[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D100[0]['order']), 1603010000);
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(osxCommit16D101.length, 1);
assert.strictEqual(osxCommit16D101[0]['repository'], 10);
assert.strictEqual(parseInt(osxCommit16D101[0]['order']), 1603010100);
result = await TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603010000&to=1603099900');
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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D101');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603010100);
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
});
it('should stop reporting if any custom command fails', () => {
const logger = new MockLogger;
[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 fetcher = new OSBuildFetcher(config, TestServer.remoteAPI(), workerAuth, MockSubprocess, logger);
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 db = TestServer.database();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
const resultsForSierraD = {allRevisions: ["Sierra16D68", "Sierra16D69"], commitsWithTestability: {}};
const resultsForSierraE = {allRevisions: ["Sierra16E32", "Sierra16E33", "Sierra16E33h", "Sierra16E34"], commitsWithTestability: {}};
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
let fetchAndReportPromise = null;
[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(emptyReport).then(() => {
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
return Promise.all([
db.insert('repositories', {'id': 10, 'name': 'OSX'}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D67', 'order': 1603006700, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D68', 'order': 1603006800, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16D69', 'order': 1603006900, 'reported': false}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E32', 'order': 1604003200, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33', 'order': 1604003300, 'reported': true}),
db.insert('commits', {'repository': 10, 'revision': 'Sierra16E33g', 'order': 1604003307, 'reported': true})]);
}).then(() => {
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1603000000&to=1603099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006800);
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
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
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
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
const waitForInvocationPromise = MockSubprocess.waitForInvocation();
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
fetchAndReportPromise = fetcher.fetchReportAndUpdateBuilds();
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return waitForInvocationPromise;
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Dxx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraD));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16D69']);
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
MockSubprocess.invocations[0].resolve(JSON.stringify(ownedCommitWithWebKit));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
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(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'all osx 16Exx builds']);
Extend commits table to contain testability information. https://bugs.webkit.org/show_bug.cgi?id=191557 Reviewed by Ryosuke Niwa. Added the ability to store testability message in commits table. Refactored '/api/report-commits' to support update commit only. Updated os version syncing script to be able to update testability information. * init-database.sql: Added 'commit_testability' field to 'commits' table. * public/api/report-commits.php: Refactor this api to allow only update existing commits. * public/include/commit-log-fetcher.php: Expose testability warning information in this API. * public/include/commit-updater.php: Added 'CommitUpdater' to manage commit insert and update. * public/v3/models/commit-log.js: CommitLog object should expose testability warning information. (CommitLog.prototype.updateSingleton): (CommitLog.prototype.testability): * public/v3/models/commit-set.js: Added 'commitsWithTestability' and 'commits' to CommitSet and IntermediateCommitSet instances. (CommitSet.prototype.commitsWithTestability): (CommitSet.prototype.commits): (IntermediateCommitSet.prototype.commitsWithTestability): (IntermediateCommitSet.prototype.commits): * server-tests/api-report-commits-tests.js: Added unit tests for '/api/report-commits' when `insert=false`. * server-tests/tools-os-build-fetcher-tests.js: Added and updated unit tests. * tools/js/os-build-fetcher.js: Added the ability to update commit testability warnings. (async.fetchReportAndUpdateCommits): (prototype.async.fetchReportAndUpdateBuilds): (prototype.async._fetchAvailableBuilds): (prototype.async._commitsForAvailableBuilds): (prototype._commitsWithinRange): (prototype.async._reportCommits): (fetchAndReportAllInOrder): Deleted. (prototype.fetchAndReportNewBuilds): Deleted. (prototype._fetchAvailableBuilds): Deleted. (prototype._commitsForAvailableBuilds): Deleted. (prototype._submitCommits): Deleted. * tools/sync-os-versions.js: * unit-tests/commit-log-tests.js: Added a unit test for 'testability'. * unit-tests/commit-set-tests.js: Added unit tests for 'commitsWithTestability'. Canonical link: https://commits.webkit.org/207523@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-12-21 02:05:39 +00:00
invocations[0].resolve(JSON.stringify(resultsForSierraE));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E33h']);
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
invocations[0].resolve(JSON.stringify(anotherownedCommitWithWebKit));
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
return MockSubprocess.resetAndWaitForInvocation();
}).then(() => {
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(invocations.length, 1);
assert.deepStrictEqual(invocations[0].command, ['list', 'ownedCommit', 'for', 'revision', 'Sierra16E34']);
Fix os-build-fetcher.js and subprocess.js to make them work https://bugs.webkit.org/show_bug.cgi?id=169844 Reviewed by Antti Koivisto. The script added in r213976 has a bug that it can execute commands to fetch subcommits in parallel. Some commands to poll the lsit of system components is not desirable to be ran in parallel. * server-tests/resources/mock-subprocess.js: (MockSubprocess): Use const declaration. (MockSubprocess.resetAndWaitForInvocation): Added. (MockSubprocess.waitForInvocation): Renamed from waitingForInvocation. A function name must be a verb. See https://webkit.org/code-style-guidelines/#names-verb (MockSubprocess.reset): Set invocations.length to 0 so that tests can store a reference to the array regardless of whether reset is called or when it's called. * server-tests/tools-os-build-fetcher-tests.js: Updated tests per the code change. Most of codes now expect each command to be ran seprately. e.g. if there were two commands to run, instead of expecting them to be both ran, and resolving invocation promises, we'd wait for one command to run, resolve, its subcommand to run, and then move onto the second top-level command. Also use a local reference to MockSubprocess.invocations instead of using the fully qualified name. * tools/js/os-build-fetcher.js: (mapInSerialPromiseChain): Added. Calling a closure that returns a promise on each item in an array in serial (not asynchronous) is a very common pattern in this class. (OSBuildFetcher.fetchAndReportAllInOrder): Added. (OSBuildFetcher.prototype.fetchAndReportNewBuilds): Log what the number of builds being submitted. (OSBuildFetcher.prototype._fetchAvailableBuilds): Fixed the main bug. Using Promise.all would result in each top-level command to be execued in parallel. Since each subcommand is executed as soon as its parent command is executed, this results in commands to be executed in parallel. Added a whole bunch of logging so that we can at least detect a bug like this in the future. (OSBuildFetcher.prototype._commitsForAvailableBuilds): Cleanup the coding style. (OSBuildFetcher.prototype._addSubCommitsForBuild): Use mapInSerialPromiseChain. Tightened the assertion about the content returned by a subcommand. * tools/js/subprocess.js: Fixed the bug that we were importing require('child_process').ChildProcess. execFile is defined on require('child_process') itself. (Subprocess.prototype.execute): Fixed a typo. this._childProcess doesn't exist. (Subprocess): * tools/sync-os-versions.js: Renamed from tools/pull-os-versions.js. (syncLoop): Cleaned up the coding style a little. Also added logging about how long we're about to sleep. Canonical link: https://commits.webkit.org/186826@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-20 22:36:40 +00:00
invocations[0].reject('Command failed');
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
return fetchAndReportPromise.then(() => {
assert(false, 'should never be reached');
}, (error_output) => {
assert(error_output);
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(error_output, 'Command failed');
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=1603000000&to=1603099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16D68');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1603006800);
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
return TestServer.remoteAPI().getJSON('/api/commits/OSX/last-reported?from=1604000000&to=1604099900');
}).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['commits'].length, 1);
assert.strictEqual(result['commits'][0]['revision'], 'Sierra16E33g');
assert.strictEqual(parseInt(result['commits'][0]['order']), 1604003307);
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
});
})
})
});