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

814 lines
40 KiB
JavaScript
Raw Permalink Normal View History

Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
'use strict';
const assert = require('assert');
require('../tools/js/v3-models.js');
const MockData = require('./resources/mock-data.js');
const TestServer = require('./resources/test-server.js');
const TemporaryFile = require('./resources/temporary-file.js').TemporaryFile;
[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;
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const prepareServerTest = require('./resources/common-operations.js').prepareServerTest;
function makeReport(rootFile, buildRequestId = 1, repositoryList = ['WebKit'], buildTime = '2017-05-10T02:54:08.666')
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
{
return {
[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',
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
builderName: 'someBuilder',
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
buildTag: "123",
buildTime: buildTime,
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
buildRequest: buildRequestId,
rootFile: rootFile,
repositoryList: JSON.stringify(repositoryList),
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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
function addWorkerAndCreateRootFile(workerInfo = makeReport())
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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
return addWorkerForReport(workerInfo).then(() => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TemporaryFile.makeTemporaryFile('some.dat', 'some content');
});
}
function createTestGroupWihPatch()
{
const triggerableConfiguration = {
[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': 'sync-worker',
'workerPassword': 'password',
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
'triggerable': 'build-webkit',
'configurations': [
{test: MockData.someTestId(), platform: MockData.somePlatformId()},
],
'repositoryGroups': [
{name: 'webkit', repositories: [
{repository: MockData.webkitRepositoryId(), acceptsPatch: true},
{repository: MockData.sharedRepositoryId()},
]}
]
};
const db = TestServer.database();
return MockData.addMockData(db).then(() => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return Promise.all([TemporaryFile.makeTemporaryFile('patch.dat', 'patch file'), Manifest.fetch()]);
}).then((result) => {
const patchFile = result[0];
return Promise.all([UploadedFile.uploadFile(patchFile), TestServer.remoteAPI().postJSON('/api/update-triggerable/', triggerableConfiguration)]);
}).then((result) => {
const patchFile = result[0];
const someTest = Test.findById(MockData.someTestId());
const webkit = Repository.findById(MockData.webkitRepositoryId());
const shared = Repository.findById(MockData.sharedRepositoryId());
const set1 = new CustomCommitSet;
set1.setRevisionForRepository(webkit, '191622', patchFile);
set1.setRevisionForRepository(shared, '80229');
const set2 = new CustomCommitSet;
set2.setRevisionForRepository(webkit, '191622');
set2.setRevisionForRepository(shared, '80229');
[perf dashboard] Add sequential mode for perf dashboard A/B testing. https://bugs.webkit.org/show_bug.cgi?id=223886 Reviewed by Ryosuke Niwa. Add 'testgroup_repetition_type' to 'analysis_test_groups' table to store repetition type which defaults to 'alternating'. Add support to schedule 'sequential' A/B testing which schedules all iterations for the first configuration (A) before the iterations for the second configuration (B). Before this patch, all A/B testing alternated between two different configurations for each iteration. Add retry logic for 'sequential' A/B testing. Update syncing script to not proceed with next configuration the current configuration successfully completed more iterations than the initially requested or retries exceeded the list. Fix a potential race in syncing script that 'Promise.all' may cause test group not scheduled in order. * browser-tests/test-group-form-tests.js: Updated and added unit tests. * init-database.sql: Added 'testgroup_repetition_type' field to 'analysis_test_groups' table. * migrate-database.sql: Updated migration script to conditionally add 'testgroup_repetition_type' field. * public/api/test-groups.php: Added 'repetitionType' field in api return value. * public/include/build-requests-fetcher.php: Fetching build requests under a triggerable should include test group with all test groups finished but still need retry. This will allow syncing script to resolve the build request by ID and block other request to be scheduled on the builder. * public/include/commit-sets-helpers.php: Added code to create build requests based on test mode. * public/privileged-api/add-build-requests.php: Added support to only add build requests to one commit set. * public/privileged-api/create-analysis-task.php: Added 'repetitionType' support. * public/privileged-api/create-test-group.php: Added 'repetitionType' support. * public/privileged-api/update-test-group.php: * public/shared/common-component-base.js: * public/v3/components/custom-configuration-test-group-form.js: Added 'repetitionType' support. (CustomConfigurationTestGroupForm.prototype.startTesting): * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm.prototype.startTesting): * public/v3/components/test-group-form.js: (TestGroupForm.prototype.startTesting): * public/v3/models/analysis-task.js: (AnalysisTask.async create): (AnalysisTask): * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.updateSingleton): Allow build request order to be updated. * public/v3/models/test-group.js: (TestGroup): (TestGroup.prototype.updateSingleton): (TestGroup.prototype.repetitionType): (TestGroup.prototype.repetitionCountForCommitSet): Refactored `repetitionCount` since repetition may be different between configurations. (TestGroup.prototype.hasRetries): A helper function to tell if a test group has retry runs. (TestGroup.prototype.additionalRepetitionNeededToReachInitialRepetitionCount): (TestGroup.prototype.successfulTestCount): (TestGroup.prototype.isFirstTestRequest): (TestGroup.prototype.precedingBuildRequest): (TestGroup.prototype.retryCountForCommitSet): (TestGroup.prototype.retryCountsAreSameForAllCommitSets): (TestGroup.prototype.async _createAlternatingRetriesForTestGroup): Moved from 'retry-failed-build-requests' module. (TestGroup.async _createSequentialRetriesForTestGroup): Moved from 'retry-failed-build-requests' module. (TestGroup.prototype.async cancelPendingRequests): (TestGroup.prototype.async didSendNotification): (TestGroup.prototype.async addMoreBuildRequests): (TestGroup.async createWithTask): (TestGroup.async createWithCustomConfiguration): (TestGroup.async createAndRefetchTestGroups): (TestGroup.prototype.async scheduleMoreRequestsOrClearFlag): Moved from 'retry-failed-build-requests' module. (TestGroup.async fetchById): Added support to fetch test group by ID. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype.didConstructShadowTree): (AnalysisTaskResultsPane.prototype.didConstructShadowTree): (AnalysisTaskConfiguratorPane.prototype.setTestGroups): (AnalysisTaskConfiguratorPane): (AnalysisTaskTestGroupPane.prototype.didConstructShadowTree): (AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): (AnalysisTaskTestGroupPane.prototype._retrySummary): (AnalysisTaskPage.prototype.didConstructShadowTree): (AnalysisTaskPage.prototype.async _retryCurrentTestGroup): (AnalysisTaskPage.prototype.async _bisectCurrentTestGroup): (AnalysisTaskPage.set const): (AnalysisTaskPage.prototype.async _createTestGroupAfterVerifyingCommitSetList): (AnalysisTaskPage.prototype.async _createCustomTestGroup): * public/v3/pages/chart-pane.js: (ChartPane.prototype.didConstructShadowTree): (ChartPane.prototype.async _analyzeRange): * public/v3/pages/create-analysis-task-page.js: (CreateAnalysisTaskPage.prototype.async _createAnalysisTaskWithGroup): * server-tests/api-build-requests-tests.js: Added a unit test. * server-tests/api-upload-root-tests.js: Updated unit tests. * server-tests/privileged-api-add-build-requests-tests.js: Updated and added unit tests. * server-tests/privileged-api-create-analysis-task-tests.js: Added unit tests. * server-tests/privileged-api-create-test-group-tests.js: Updated and added unit tests. * server-tests/privileged-api-update-test-group-tests.js: Updated and added unit tests. * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/mock-data.js: (MockData.addMockData): (MockData.set addMockBuildRequestsWithRoots): (MockData.set addAnotherMockTestGroup): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/tools-buildbot-triggerable-tests.js: Updated and added unit tests. * server-tests/tools-sync-buildbot-integration-tests.js: Updated unit tests. (async createTestGroupWithPatch): (createTestGroupWihOwnedCommit): * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._shouldDeferSequentialTestingRequestWithNewCommitSet): * tools/js/measurement-set-analyzer.js: (MeasurementSetAnalyzer.prototype.async _analyzeMeasurementSet): (MeasurementSetAnalyzer): * tools/js/retry-failed-build-requests.js: Removed. * tools/run-analysis.js: Use updated API to retry. (async analysisLoop): (async processTestGroupMayNeedMoreRequests): * tools/sync-buildbot.js: Added command line option '--max-retry-factor'. * unit-tests/analysis-task-tests.js: Updated unit tests. * unit-tests/buildbot-syncer-tests.js: Updated unit tests. (createSampleBuildRequest): * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/retry-failed-build-requests-tests.js: Moved unit tests to test-group-tests.js. * unit-tests/test-groups-tests.js: Added unit tests from 'retry-failed-build-requests-tests.js'. Canonical link: https://commits.webkit.org/238151@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-26 01:23:22 +00:00
return TestGroup.createWithTask('custom task', Platform.findById(MockData.somePlatformId()), someTest, 'some group', 2, 'alternating', [set1, set2]);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}).then((task) => {
return TestGroup.findAllByTask(task.id())[0];
}).then((group) => {
return db.query('UPDATE analysis_test_groups SET testgroup_author = $1', ['someUser']).then(() => group);
});
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}
function createTestGroupWithPatchAndOwnedCommits()
{
const triggerableConfiguration = {
[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': 'sync-worker',
'workerPassword': 'password',
'triggerable': 'build-webkit',
'configurations': [
{test: MockData.someTestId(), platform: MockData.somePlatformId()},
],
'repositoryGroups': [
{name: 'webkit', repositories: [
{repository: MockData.webkitRepositoryId(), acceptsPatch: true}
]}
]
};
const db = TestServer.database();
return MockData.addMockData(db).then(() => {
return Promise.all([TemporaryFile.makeTemporaryFile('patch.dat', 'patch file'), Manifest.fetch()]);
}).then((result) => {
const patchFile = result[0];
return Promise.all([UploadedFile.uploadFile(patchFile), TestServer.remoteAPI().postJSON('/api/update-triggerable/', triggerableConfiguration)]);
}).then((result) => {
const patchFile = result[0];
const someTest = Test.findById(MockData.someTestId());
const webkit = Repository.findById(MockData.webkitRepositoryId());
const ownedSJC = Repository.findById(MockData.ownedJSCRepositoryId());
const set1 = new CustomCommitSet;
set1.setRevisionForRepository(webkit, '191622', patchFile);
set1.setRevisionForRepository(ownedSJC, 'owned-jsc-6161', null, '191622');
const set2 = new CustomCommitSet;
set2.setRevisionForRepository(webkit, '192736');
set2.setRevisionForRepository(ownedSJC, 'owned-jsc-9191', null, '192736');
[perf dashboard] Add sequential mode for perf dashboard A/B testing. https://bugs.webkit.org/show_bug.cgi?id=223886 Reviewed by Ryosuke Niwa. Add 'testgroup_repetition_type' to 'analysis_test_groups' table to store repetition type which defaults to 'alternating'. Add support to schedule 'sequential' A/B testing which schedules all iterations for the first configuration (A) before the iterations for the second configuration (B). Before this patch, all A/B testing alternated between two different configurations for each iteration. Add retry logic for 'sequential' A/B testing. Update syncing script to not proceed with next configuration the current configuration successfully completed more iterations than the initially requested or retries exceeded the list. Fix a potential race in syncing script that 'Promise.all' may cause test group not scheduled in order. * browser-tests/test-group-form-tests.js: Updated and added unit tests. * init-database.sql: Added 'testgroup_repetition_type' field to 'analysis_test_groups' table. * migrate-database.sql: Updated migration script to conditionally add 'testgroup_repetition_type' field. * public/api/test-groups.php: Added 'repetitionType' field in api return value. * public/include/build-requests-fetcher.php: Fetching build requests under a triggerable should include test group with all test groups finished but still need retry. This will allow syncing script to resolve the build request by ID and block other request to be scheduled on the builder. * public/include/commit-sets-helpers.php: Added code to create build requests based on test mode. * public/privileged-api/add-build-requests.php: Added support to only add build requests to one commit set. * public/privileged-api/create-analysis-task.php: Added 'repetitionType' support. * public/privileged-api/create-test-group.php: Added 'repetitionType' support. * public/privileged-api/update-test-group.php: * public/shared/common-component-base.js: * public/v3/components/custom-configuration-test-group-form.js: Added 'repetitionType' support. (CustomConfigurationTestGroupForm.prototype.startTesting): * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm.prototype.startTesting): * public/v3/components/test-group-form.js: (TestGroupForm.prototype.startTesting): * public/v3/models/analysis-task.js: (AnalysisTask.async create): (AnalysisTask): * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.updateSingleton): Allow build request order to be updated. * public/v3/models/test-group.js: (TestGroup): (TestGroup.prototype.updateSingleton): (TestGroup.prototype.repetitionType): (TestGroup.prototype.repetitionCountForCommitSet): Refactored `repetitionCount` since repetition may be different between configurations. (TestGroup.prototype.hasRetries): A helper function to tell if a test group has retry runs. (TestGroup.prototype.additionalRepetitionNeededToReachInitialRepetitionCount): (TestGroup.prototype.successfulTestCount): (TestGroup.prototype.isFirstTestRequest): (TestGroup.prototype.precedingBuildRequest): (TestGroup.prototype.retryCountForCommitSet): (TestGroup.prototype.retryCountsAreSameForAllCommitSets): (TestGroup.prototype.async _createAlternatingRetriesForTestGroup): Moved from 'retry-failed-build-requests' module. (TestGroup.async _createSequentialRetriesForTestGroup): Moved from 'retry-failed-build-requests' module. (TestGroup.prototype.async cancelPendingRequests): (TestGroup.prototype.async didSendNotification): (TestGroup.prototype.async addMoreBuildRequests): (TestGroup.async createWithTask): (TestGroup.async createWithCustomConfiguration): (TestGroup.async createAndRefetchTestGroups): (TestGroup.prototype.async scheduleMoreRequestsOrClearFlag): Moved from 'retry-failed-build-requests' module. (TestGroup.async fetchById): Added support to fetch test group by ID. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype.didConstructShadowTree): (AnalysisTaskResultsPane.prototype.didConstructShadowTree): (AnalysisTaskConfiguratorPane.prototype.setTestGroups): (AnalysisTaskConfiguratorPane): (AnalysisTaskTestGroupPane.prototype.didConstructShadowTree): (AnalysisTaskTestGroupPane.prototype._renderCurrentTestGroup): (AnalysisTaskTestGroupPane.prototype._retrySummary): (AnalysisTaskPage.prototype.didConstructShadowTree): (AnalysisTaskPage.prototype.async _retryCurrentTestGroup): (AnalysisTaskPage.prototype.async _bisectCurrentTestGroup): (AnalysisTaskPage.set const): (AnalysisTaskPage.prototype.async _createTestGroupAfterVerifyingCommitSetList): (AnalysisTaskPage.prototype.async _createCustomTestGroup): * public/v3/pages/chart-pane.js: (ChartPane.prototype.didConstructShadowTree): (ChartPane.prototype.async _analyzeRange): * public/v3/pages/create-analysis-task-page.js: (CreateAnalysisTaskPage.prototype.async _createAnalysisTaskWithGroup): * server-tests/api-build-requests-tests.js: Added a unit test. * server-tests/api-upload-root-tests.js: Updated unit tests. * server-tests/privileged-api-add-build-requests-tests.js: Updated and added unit tests. * server-tests/privileged-api-create-analysis-task-tests.js: Added unit tests. * server-tests/privileged-api-create-test-group-tests.js: Updated and added unit tests. * server-tests/privileged-api-update-test-group-tests.js: Updated and added unit tests. * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/mock-data.js: (MockData.addMockData): (MockData.set addMockBuildRequestsWithRoots): (MockData.set addAnotherMockTestGroup): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/tools-buildbot-triggerable-tests.js: Updated and added unit tests. * server-tests/tools-sync-buildbot-integration-tests.js: Updated unit tests. (async createTestGroupWithPatch): (createTestGroupWihOwnedCommit): * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._shouldDeferSequentialTestingRequestWithNewCommitSet): * tools/js/measurement-set-analyzer.js: (MeasurementSetAnalyzer.prototype.async _analyzeMeasurementSet): (MeasurementSetAnalyzer): * tools/js/retry-failed-build-requests.js: Removed. * tools/run-analysis.js: Use updated API to retry. (async analysisLoop): (async processTestGroupMayNeedMoreRequests): * tools/sync-buildbot.js: Added command line option '--max-retry-factor'. * unit-tests/analysis-task-tests.js: Updated unit tests. * unit-tests/buildbot-syncer-tests.js: Updated unit tests. (createSampleBuildRequest): * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/retry-failed-build-requests-tests.js: Moved unit tests to test-group-tests.js. * unit-tests/test-groups-tests.js: Added unit tests from 'retry-failed-build-requests-tests.js'. Canonical link: https://commits.webkit.org/238151@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-26 01:23:22 +00:00
return TestGroup.createWithTask('custom task', Platform.findById(MockData.somePlatformId()), someTest, 'some group', 2, 'alternating', [set1, set2]);
}).then((task) => {
return TestGroup.findAllByTask(task.id())[0];
}).then((group) => {
return db.query('UPDATE analysis_test_groups SET testgroup_author = $1', ['someUser']).then(() => group);
});
}
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
describe('/api/upload-root/', function () {
prepareServerTest(this);
TemporaryFile.inject();
it('should reject when root file is missing', () => {
return TestServer.remoteAPI().postFormData('/api/upload-root/', {}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'NoFileSpecified');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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
it('should reject when there are no workers', () => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TemporaryFile.makeTemporaryFile('some.dat', 'some content').then((rootFile) => {
return TestServer.remoteAPI().postFormData('/api/upload-root/', makeReport(rootFile));
}).then((response) => {
[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
assert.strictEqual(response['status'], 'WorkerNotFound');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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
it('should reject when worker name is missing', () => {
return addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
[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
delete report.workerName;
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
[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
assert.strictEqual(response['status'], 'MissingWorkerName');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when builder name is missing', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
delete report.builderName;
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuilderName');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
it('should reject when build tag is missing', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
delete report.buildTag;
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuildTag');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when build number is not a number', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
delete report.buildTag;
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
report.buildNumber = '1abc';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuildNumber');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
it('should reject if both build number and build tag exists but different', async () => {
[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 rootFile = await addWorkerAndCreateRootFile();
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const report = makeReport(rootFile);
report.buildNumber = '456';
const response = await TestServer.remoteAPI().postFormData('/api/upload-root/', report);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'BuilderNumberTagMismatch');
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
});
it('should accept if both build number and build tag exists with same value', async () => {
const testGroup = await createTestGroupWithPatchAndOwnedCommits();
const webkit = Repository.findById(MockData.webkitRepositoryId());
const ownedJSC = Repository.findById(MockData.ownedJSCRepositoryId());
const buildRequest = testGroup.buildRequests()[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(testGroup.buildRequests().length, 6);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
assert(buildRequest.isPending());
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(buildRequest.buildId(), null);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const webkitPatch = commitSet.patchForRepository(webkit);
assert(webkitPatch instanceof UploadedFile);
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(webkitPatch.filename(), 'patch.dat');
assert.strictEqual(commitSet.rootForRepository(webkit), null);
assert.strictEqual(commitSet.revisionForRepository(ownedJSC), 'owned-jsc-6161');
assert.strictEqual(commitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(commitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(commitSet.allRootFiles(), []);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const otherBuildRequest = testGroup.buildRequests()[1];
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '192736');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(ownedJSC), 'owned-jsc-9191');
assert.strictEqual(otherCommitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(otherCommitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
[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 rootFile = await addWorkerAndCreateRootFile();
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const report = makeReport(rootFile, buildRequest.id(), ['WebKit']);
report.buildNumber = report.buildTag;
const response = await TestServer.remoteAPI().postFormData('/api/upload-root/', report);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
});
it('should continue working with build number if build tag is not present', async () => {
const testGroup = await createTestGroupWithPatchAndOwnedCommits();
const webkit = Repository.findById(MockData.webkitRepositoryId());
const ownedJSC = Repository.findById(MockData.ownedJSCRepositoryId());
const buildRequest = testGroup.buildRequests()[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(testGroup.buildRequests().length, 6);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
assert(buildRequest.isPending());
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(buildRequest.buildId(), null);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const webkitPatch = commitSet.patchForRepository(webkit);
assert(webkitPatch instanceof UploadedFile);
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(webkitPatch.filename(), 'patch.dat');
assert.strictEqual(commitSet.rootForRepository(webkit), null);
assert.strictEqual(commitSet.revisionForRepository(ownedJSC), 'owned-jsc-6161');
assert.strictEqual(commitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(commitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(commitSet.allRootFiles(), []);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const otherBuildRequest = testGroup.buildRequests()[1];
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '192736');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(ownedJSC), 'owned-jsc-9191');
assert.strictEqual(otherCommitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(otherCommitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
[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 rootFile = await addWorkerAndCreateRootFile();
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
const report = makeReport(rootFile, buildRequest.id(), ['WebKit']);
delete report.buildTag;
report.buildNumber = '123';
const response = await TestServer.remoteAPI().postFormData('/api/upload-root/', report);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
});
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
it('should reject when build time is missing', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
delete report.buildTime;
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuildTime');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when build time is malformed', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
report.buildTime = 'Wed, 10 May 2017 03:02:30 GMT';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuildTime');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when build request ID is missing', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
delete report.buildRequest;
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuildRequest');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when build request ID is not a number', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
report.buildRequest = 'abc';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuildRequest');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when build request does not exist', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TestServer.remoteAPI().postFormData('/api/upload-root/', makeReport(rootFile));
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidBuildRequestType');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when repository list is missing', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
delete report.repositoryList;
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidRepositoryList');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when repository list is not a valid JSON string', () => {
[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 addWorkerAndCreateRootFile().then((rootFile) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const report = makeReport(rootFile);
report.repositoryList = 'a+b';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidRepositoryList');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when using invalid key to specify an owned repository', () => {
let webkit;
let webkitPatch;
let ownedJSC;
let testGroup;
let buildRequest;
let otherBuildRequest;
let uploadedRoot;
return createTestGroupWithPatchAndOwnedCommits().then((group) => {
webkit = Repository.findById(MockData.webkitRepositoryId());
ownedJSC = Repository.findById(MockData.ownedJSCRepositoryId());
testGroup = group;
buildRequest = testGroup.buildRequests()[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(testGroup.buildRequests().length, 6);
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
assert(buildRequest.isPending());
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(buildRequest.buildId(), null);
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
webkitPatch = commitSet.patchForRepository(webkit);
assert(webkitPatch instanceof UploadedFile);
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(webkitPatch.filename(), 'patch.dat');
assert.strictEqual(commitSet.rootForRepository(webkit), null);
assert.strictEqual(commitSet.revisionForRepository(ownedJSC), 'owned-jsc-6161');
assert.strictEqual(commitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(commitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(commitSet.allRootFiles(), []);
otherBuildRequest = testGroup.buildRequests()[1];
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '192736');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(ownedJSC), 'owned-jsc-9191');
assert.strictEqual(otherCommitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(otherCommitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
[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 addWorkerAndCreateRootFile();
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id(), ['WebKit']);
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
const uploadedRootRawData = response['uploadedFile'];
uploadedRoot = UploadedFile.ensureSingleton(uploadedRootRawData.id, uploadedRootRawData);
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(uploadedRoot.filename(), 'some.dat');
return TestGroup.fetchForTask(buildRequest.testGroup().task().id(), true);
}).then((testGroups) => {
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(testGroups.length, 1);
const group = testGroups[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(group, testGroup);
assert.strictEqual(testGroup.buildRequests().length, 6);
const updatedBuildRequest = testGroup.buildRequests()[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(updatedBuildRequest, buildRequest);
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
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(buildRequest.buildId(), null);
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(buildRequest.commitSet().allRootFiles(), [uploadedRoot]);
assert.deepStrictEqual(otherBuildRequest.commitSet().allRootFiles(), []);
return TemporaryFile.makeTemporaryFile('JavaScriptCore-Root.dat', 'JavaScript Content 0');
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id(), [{ownerRepositoryWrongKey: 'WebKit', ownedRepository: 'JavaScriptCore'}], '2017-05-10T02:54:09.666');
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidKeyForRepository');
});
});
it('should reject when reporting an invalid owned repository', () => {
let webkit;
let webkitPatch;
let ownedJSC;
let testGroup;
let buildRequest;
let otherBuildRequest;
let uploadedRoot;
return createTestGroupWithPatchAndOwnedCommits().then((group) => {
webkit = Repository.findById(MockData.webkitRepositoryId());
ownedJSC = Repository.findById(MockData.ownedJSCRepositoryId());
testGroup = group;
buildRequest = testGroup.buildRequests()[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(testGroup.buildRequests().length, 6);
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
assert(buildRequest.isPending());
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(buildRequest.buildId(), null);
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
webkitPatch = commitSet.patchForRepository(webkit);
assert(webkitPatch instanceof UploadedFile);
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(webkitPatch.filename(), 'patch.dat');
assert.strictEqual(commitSet.rootForRepository(webkit), null);
assert.strictEqual(commitSet.revisionForRepository(ownedJSC), 'owned-jsc-6161');
assert.strictEqual(commitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(commitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(commitSet.allRootFiles(), []);
otherBuildRequest = testGroup.buildRequests()[1];
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '192736');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(ownedJSC), 'owned-jsc-9191');
assert.strictEqual(otherCommitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(otherCommitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
[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 addWorkerAndCreateRootFile();
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id(), ['WebKit']);
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
const uploadedRootRawData = response['uploadedFile'];
uploadedRoot = UploadedFile.ensureSingleton(uploadedRootRawData.id, uploadedRootRawData);
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(uploadedRoot.filename(), 'some.dat');
return TestGroup.fetchForTask(buildRequest.testGroup().task().id(), true);
}).then((testGroups) => {
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(testGroups.length, 1);
const group = testGroups[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(group, testGroup);
assert.strictEqual(testGroup.buildRequests().length, 6);
const updatedBuildRequest = testGroup.buildRequests()[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(updatedBuildRequest, buildRequest);
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
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(buildRequest.buildId(), null);
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(buildRequest.commitSet().allRootFiles(), [uploadedRoot]);
assert.deepStrictEqual(otherBuildRequest.commitSet().allRootFiles(), []);
return TemporaryFile.makeTemporaryFile('JavaScriptCore-Root.dat', 'JavaScript Content 0');
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id(), [{ownerRepository: 'WebKit2', ownedRepository: 'JavaScriptCore'}], '2017-05-10T02:54:09.666');
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidRepository');
});
});
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
it('should accept when build request exists', () => {
let webkit;
let webkitPatch;
let shared;
let testGroup;
let buildRequest;
let otherBuildRequest;
let uploadedRoot;
return createTestGroupWihPatch().then((group) => {
webkit = Repository.findById(MockData.webkitRepositoryId());
shared = Repository.findById(MockData.sharedRepositoryId());
testGroup = group;
buildRequest = testGroup.buildRequests()[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(testGroup.buildRequests().length, 6);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
assert(buildRequest.isPending());
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(buildRequest.buildId(), null);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
webkitPatch = commitSet.patchForRepository(webkit);
assert(webkitPatch instanceof UploadedFile);
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(webkitPatch.filename(), 'patch.dat');
assert.strictEqual(commitSet.rootForRepository(webkit), null);
assert.strictEqual(commitSet.revisionForRepository(shared), '80229');
assert.strictEqual(commitSet.patchForRepository(shared), null);
assert.strictEqual(commitSet.rootForRepository(shared), null);
assert.deepStrictEqual(commitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
otherBuildRequest = testGroup.buildRequests()[1];
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '191622');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(shared), '80229');
assert.strictEqual(otherCommitSet.patchForRepository(shared), null);
assert.strictEqual(otherCommitSet.rootForRepository(shared), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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
return addWorkerAndCreateRootFile();
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}).then((rootFile) => {
return TestServer.remoteAPI().postFormData('/api/upload-root/', makeReport(rootFile, buildRequest.id()));
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const uploadedRootRawData = response['uploadedFile'];
uploadedRoot = UploadedFile.ensureSingleton(uploadedRootRawData.id, uploadedRootRawData);
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(uploadedRoot.filename(), 'some.dat');
assert.strictEqual(uploadedRoot.author(), 'someUser');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TestGroup.fetchForTask(buildRequest.testGroup().task().id(), true);
}).then((testGroups) => {
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(testGroups.length, 1);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const group = testGroups[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(group, testGroup);
assert.strictEqual(testGroup.buildRequests().length, 6);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const updatedBuildRequest = testGroup.buildRequests()[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(updatedBuildRequest, buildRequest);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(buildRequest.hasFinished());
assert(!buildRequest.isPending());
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.notStrictEqual(buildRequest.buildId(), null);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
assert.strictEqual(commitSet.patchForRepository(webkit), webkitPatch);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const webkitRoot = commitSet.rootForRepository(webkit);
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(webkitRoot, uploadedRoot);
assert.strictEqual(commitSet.revisionForRepository(shared), '80229');
assert.strictEqual(commitSet.patchForRepository(shared), null);
assert.strictEqual(commitSet.rootForRepository(shared), null);
assert.deepStrictEqual(commitSet.allRootFiles(), [uploadedRoot]);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '191622');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(shared), '80229');
assert.strictEqual(otherCommitSet.patchForRepository(shared), null);
assert.strictEqual(otherCommitSet.rootForRepository(shared), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when the repository list is not an array', () => {
let buildRequest;
return createTestGroupWihPatch().then((group) => {
buildRequest = group.buildRequests()[0];
[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 addWorkerAndCreateRootFile();
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id());
report.repositoryList = '"a"';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidRepositoryList');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when the repository list refers to a non-existent repository', () => {
let buildRequest;
return createTestGroupWihPatch().then((group) => {
buildRequest = group.buildRequests()[0];
[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 addWorkerAndCreateRootFile();
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id());
report.repositoryList = '["WebKit", "BadRepositoryName"]';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidRepository');
assert.strictEqual(response['repositoryName'], 'BadRepositoryName');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should reject when the repository list refers to a repository not present in the commit set', () => {
let buildRequest;
return createTestGroupWihPatch().then((group) => {
buildRequest = group.buildRequests()[0];
[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 addWorkerAndCreateRootFile();
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id());
report.repositoryList = '["WebKit", "macOS"]';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidRepository');
assert.strictEqual(response['repositoryName'], 'macOS');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should update all commit set items in the repository listed', () => {
let webkit;
let webkitPatch;
let shared;
let testGroup;
let buildRequest;
let otherBuildRequest;
let uploadedRoot;
return createTestGroupWihPatch().then((group) => {
webkit = Repository.findById(MockData.webkitRepositoryId());
shared = Repository.findById(MockData.sharedRepositoryId());
testGroup = group;
buildRequest = testGroup.buildRequests()[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(testGroup.buildRequests().length, 6);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
assert(buildRequest.isPending());
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(buildRequest.buildId(), null);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
webkitPatch = commitSet.patchForRepository(webkit);
assert(webkitPatch instanceof UploadedFile);
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(webkitPatch.filename(), 'patch.dat');
assert.strictEqual(commitSet.rootForRepository(webkit), null);
assert.strictEqual(commitSet.revisionForRepository(shared), '80229');
assert.strictEqual(commitSet.patchForRepository(shared), null);
assert.strictEqual(commitSet.rootForRepository(shared), null);
assert.deepStrictEqual(commitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
otherBuildRequest = testGroup.buildRequests()[1];
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '191622');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(shared), '80229');
assert.strictEqual(otherCommitSet.patchForRepository(shared), null);
assert.strictEqual(otherCommitSet.rootForRepository(shared), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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
return addWorkerAndCreateRootFile();
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id());
report.repositoryList = '["WebKit", "Shared"]';
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const uploadedRootRawData = response['uploadedFile'];
uploadedRoot = UploadedFile.ensureSingleton(uploadedRootRawData.id, uploadedRootRawData);
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(uploadedRoot.filename(), 'some.dat');
assert.strictEqual(uploadedRoot.author(), 'someUser');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TestGroup.fetchForTask(buildRequest.testGroup().task().id(), true);
}).then((testGroups) => {
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(testGroups.length, 1);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const group = testGroups[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(group, testGroup);
assert.strictEqual(testGroup.buildRequests().length, 6);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const updatedBuildRequest = testGroup.buildRequests()[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(updatedBuildRequest, buildRequest);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(buildRequest.hasFinished());
assert(!buildRequest.isPending());
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.notStrictEqual(buildRequest.buildId(), null);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
assert.strictEqual(commitSet.patchForRepository(webkit), webkitPatch);
assert.strictEqual(commitSet.rootForRepository(webkit), uploadedRoot);
assert.strictEqual(commitSet.revisionForRepository(shared), '80229');
assert.strictEqual(commitSet.patchForRepository(shared), null);
assert.strictEqual(commitSet.rootForRepository(shared), uploadedRoot);
assert.deepStrictEqual(commitSet.allRootFiles(), [uploadedRoot]);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '191622');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(shared), '80229');
assert.strictEqual(otherCommitSet.patchForRepository(shared), null);
assert.strictEqual(otherCommitSet.rootForRepository(shared), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
it('should only set build requests as complete when all roots are built', () => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
let webkit;
let webkitPatch;
let ownedJSC;
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
let testGroup;
let buildRequest;
let otherBuildRequest;
let uploadedRoot;
let jscRoot;
return createTestGroupWithPatchAndOwnedCommits().then((group) => {
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
webkit = Repository.findById(MockData.webkitRepositoryId());
ownedJSC = Repository.findById(MockData.ownedJSCRepositoryId());
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
testGroup = group;
buildRequest = testGroup.buildRequests()[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(testGroup.buildRequests().length, 6);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
assert(buildRequest.isPending());
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(buildRequest.buildId(), null);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const commitSet = buildRequest.commitSet();
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(commitSet.revisionForRepository(webkit), '191622');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
webkitPatch = commitSet.patchForRepository(webkit);
assert(webkitPatch instanceof UploadedFile);
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(webkitPatch.filename(), 'patch.dat');
assert.strictEqual(commitSet.rootForRepository(webkit), null);
assert.strictEqual(commitSet.revisionForRepository(ownedJSC), 'owned-jsc-6161');
assert.strictEqual(commitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(commitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(commitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
otherBuildRequest = testGroup.buildRequests()[1];
const otherCommitSet = otherBuildRequest.commitSet();
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(otherCommitSet.revisionForRepository(webkit), '192736');
assert.strictEqual(otherCommitSet.patchForRepository(webkit), null);
assert.strictEqual(otherCommitSet.rootForRepository(webkit), null);
assert.strictEqual(otherCommitSet.revisionForRepository(ownedJSC), 'owned-jsc-9191');
assert.strictEqual(otherCommitSet.patchForRepository(ownedJSC), null);
assert.strictEqual(otherCommitSet.rootForRepository(ownedJSC), null);
assert.deepStrictEqual(otherCommitSet.allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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
return addWorkerAndCreateRootFile();
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id(), ['WebKit']);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const uploadedRootRawData = response['uploadedFile'];
uploadedRoot = UploadedFile.ensureSingleton(uploadedRootRawData.id, uploadedRootRawData);
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(uploadedRoot.filename(), 'some.dat');
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
return TestGroup.fetchForTask(buildRequest.testGroup().task().id(), true);
}).then((testGroups) => {
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(testGroups.length, 1);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const group = testGroups[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(group, testGroup);
assert.strictEqual(testGroup.buildRequests().length, 6);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
const updatedBuildRequest = testGroup.buildRequests()[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(updatedBuildRequest, buildRequest);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(!buildRequest.hasFinished());
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(buildRequest.buildId(), null);
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(buildRequest.commitSet().allRootFiles(), [uploadedRoot]);
assert.deepStrictEqual(otherBuildRequest.commitSet().allRootFiles(), []);
return TemporaryFile.makeTemporaryFile('JavaScriptCore-Root.dat', 'JavaScript Content 0');
}).then((rootFile) => {
const report = makeReport(rootFile, buildRequest.id(), [{ownerRepository: 'WebKit', ownedRepository: 'JavaScriptCore'}], '2017-05-10T02:54:09.666');
return TestServer.remoteAPI().postFormData('/api/upload-root/', report);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
const uploadedRootRawData = response['uploadedFile'];
jscRoot = UploadedFile.ensureSingleton(uploadedRootRawData.id, uploadedRootRawData);
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(jscRoot.filename(), 'JavaScriptCore-Root.dat');
return TestGroup.fetchForTask(buildRequest.testGroup().task().id(), true);
}).then((testGroups) => {
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(testGroups.length, 1);
const group = testGroups[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(group, testGroup);
assert.strictEqual(testGroup.buildRequests().length, 6);
const updatedBuildRequest = testGroup.buildRequests()[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(updatedBuildRequest, buildRequest);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
assert(buildRequest.isBuild());
assert(!buildRequest.isTest());
assert(buildRequest.hasFinished());
assert(!buildRequest.isPending());
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.notStrictEqual(buildRequest.buildId(), null);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +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.deepStrictEqual(buildRequest.commitSet().allRootFiles(), [uploadedRoot, jscRoot]);
assert.deepStrictEqual(otherBuildRequest.commitSet().allRootFiles(), []);
Add API to upload a patched build for a custom A/B testing https://bugs.webkit.org/show_bug.cgi?id=171956 Reviewed by Chris Dumez. Added /api/upload-root to upload a root file, the build product of a patch associated with a commit set. Extracted more functions out of privileged-api/upload-file.php to uploaded-file-helpers.php to share code with /api/upload-root.php. * public/api/upload-root.php: Added. (main): (compute_commit_set_items_to_update): Find the list of commit set items to associate this root with. A root can be associated with multiple repositories and there fore commit set items; e.g. if a software is built from multiple repositories and there is a patch associated with one of them, the built product must be associated with all those repositories. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Include the root file is there is one. * public/include/json-header.php: (validate_arguments): Added the support for validating json string. (verify_slave): Return the slave ID found. * public/include/uploaded-file-helpers.php: (validate_uploaded_file): Extracted from /privileged-api/upload-file to be shared with /api/upload-root. (query_total_file_size): Ditto. (create_uploaded_file_from_form_data): Ditto. (upload_file_in_transaction): Ditto. Takes a lambda to do the extra work inside the transaction. * public/privileged-api/upload-file.php: (main): * public/v3/models/build-request.js: (BuildRequest.constructBuildRequestsFromData): Resolve the rootFIle of each commit set item. * public/v3/models/commit-set.js: (CommitSet): Added _repositoryToRootMap and _allRootFiles as instance variables. (CommitSet.prototype.updateSingleton): Added. Previously, each commit set's states never changed after its creation. After this patch, each item can be newly associated with a root so we must update its _repositoryToRootMap and _allRootFiles. For simplicity, we update all states. (CommitSet.prototype._updateFromObject): Extracted from the constructor. (CommitSet.prototype.allRootFiles): Added. Includes custom roots and roots created for patches. (CommitSet.prototype.rootForRepository): Added. (CommitSet.prototype.equals): Fixed the bug that we were comparing _repositoryToPatchMap to _repositoryToCommitMap, and added a check for _repositoryToRootMap. * public/v3/models/test-group.js: (TestGroup.prototype.task): Added. (TestGroup.createWithTask): (TestGroup.createWithCustomConfiguration): (TestGroup.createAndRefetchTestGroups): (TestGroup._fetchTestGroupsForTask): Deleted. Now fetchForTask takes a boolean argument: ignoreCache. (TestGroup.findAllByTask): Added. (TestGroup.fetchForTask): Renamed from fetchByTask. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): * server-tests/api-build-requests-tests.js: * server-tests/api-upload-root-tests.js: Added. Added tests for /api/upload-root. (makeReport): Added. (addSlaveAndCreateRootFile): Added. (createTestGroupWihPatch): Added. * server-tests/privileged-api-create-test-group-tests.js: * server-tests/resources/mock-data.js: (MockData.sharedRepositoryId): Added. (MockData.addMockData): Added "Shared" repository along with commits. Canonical link: https://commits.webkit.org/188885@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-11 02:32:00 +00:00
});
});
});