haikuwebkit/Websites/perf.webkit.org/unit-tests/buildbot-syncer-tests.js

1737 lines
93 KiB
JavaScript
Raw Permalink Normal View History

Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
'use strict';
let assert = require('assert');
require('../tools/js/v3-models.js');
const BrowserPrivilegedAPI = require('../public/v3/privileged-api.js').PrivilegedAPI;
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
const MockRemoteAPI = require('./resources/mock-remote-api.js').MockRemoteAPI;
const MockModels = require('./resources/mock-v3-models.js').MockModels;
const BuildbotBuildEntry = require('../tools/js/buildbot-syncer.js').BuildbotBuildEntry;
const BuildbotSyncer = require('../tools/js/buildbot-syncer.js').BuildbotSyncer;
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
function sampleiOSConfig()
{
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
'workerArgument': 'workername',
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
'buildRequestArgument': 'build_request_id',
'repositoryGroups': {
'ios-svn-webkit': {
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
'repositories': {'WebKit': {}, 'iOS': {}},
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
'testProperties': {
'desired_image': {'revision': 'iOS'},
'opensource': {'revision': 'WebKit'},
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
}
}
},
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
'types': {
'speedometer': {
'test': ['Speedometer'],
'properties': {'test_name': 'speedometer'}
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
},
'jetstream': {
'test': ['JetStream'],
'properties': {'test_name': 'jetstream'}
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
},
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
'dromaeo-dom': {
'test': ['Dromaeo', 'DOM Core Tests'],
'properties': {'tests': 'dromaeo-dom'}
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
},
},
'builders': {
'iPhone-bench': {
'builder': 'ABTest-iPhone-RunBenchmark-Tests',
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
'properties': {'forcescheduler': 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler'},
[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
'workerList': ['ABTest-iPhone-0'],
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
},
'iPad-bench': {
'builder': 'ABTest-iPad-RunBenchmark-Tests',
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
'properties': {'forcescheduler': 'ABTest-iPad-RunBenchmark-Tests-ForceScheduler'},
[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
'workerList': ['ABTest-iPad-0', 'ABTest-iPad-1'],
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
},
'iOS-builder': {
'builder': 'ABTest-iOS-Builder',
'properties': {'forcescheduler': 'ABTest-Builder-ForceScheduler'},
},
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
},
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
'buildConfigurations': [
{'builders': ['iOS-builder'], 'platforms': ['iPhone', 'iPad']},
],
'testConfigurations': [
{'builders': ['iPhone-bench'], 'types': ['speedometer', 'jetstream', 'dromaeo-dom'], 'platforms': ['iPhone']},
{'builders': ['iPad-bench'], 'types': ['speedometer', 'jetstream'], 'platforms': ['iPad']},
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
]
};
}
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
function sampleiOSConfigWithExpansions()
{
return {
"triggerableName": "build-webkit-ios",
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
"buildRequestArgument": "build-request-id",
"repositoryGroups": { },
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
"types": {
"iphone-plt": {
"test": ["PLT-iPhone"],
"properties": {"test_name": "plt"}
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
},
"ipad-plt": {
"test": ["PLT-iPad"],
"properties": {"test_name": "plt"}
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
},
"speedometer": {
"test": ["Speedometer"],
"properties": {"tests": "speedometer"}
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
},
},
"builders": {
"iphone": {
"builder": "iPhone AB Tests",
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
"properties": {"forcescheduler": "force-iphone-ab-tests"},
},
"iphone-2": {
"builder": "iPhone 2 AB Tests",
"properties": {"forcescheduler": "force-iphone-2-ab-tests"},
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
},
"ipad": {
"builder": "iPad AB Tests",
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
"properties": {"forcescheduler": "force-ipad-ab-tests"},
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
},
},
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
"testConfigurations": [
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
{
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
"builders": ["iphone", "iphone-2"],
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
"platforms": ["iPhone", "iOS 10 iPhone"],
"types": ["iphone-plt", "speedometer"],
},
{
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
"builders": ["ipad"],
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
"platforms": ["iPad"],
"types": ["ipad-plt", "speedometer"],
},
]
}
}
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
function smallConfiguration()
{
return {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
'buildRequestArgument': 'id',
'repositoryGroups': {
'ios-svn-webkit': {
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
'repositories': {'iOS': {}, 'WebKit': {}},
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
'testProperties': {
'os': {'revision': 'iOS'},
'wk': {'revision': 'WebKit'}
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
}
}
},
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
'types': {
'some-test': {
'test': ['Some test'],
}
},
'builders': {
'some-builder': {
'builder': 'some builder',
'properties': {'forcescheduler': 'some-builder-ForceScheduler'}
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}
},
'testConfigurations': [{
'builders': ['some-builder'],
'platforms': ['Some platform'],
'types': ['some-test'],
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
}]
};
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
}
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
function builderNameToIDMap()
{
return {
'some builder' : '100',
'ABTest-iPhone-RunBenchmark-Tests': '101',
'ABTest-iPad-RunBenchmark-Tests': '102',
'ABTest-iOS-Builder': '103',
'iPhone AB Tests' : '104',
'iPhone 2 AB Tests': '105',
'iPad AB Tests': '106'
};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
}
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
function smallPendingBuild()
{
return samplePendingBuildRequests(null, null, null, "some builder");
}
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
function smallInProgressBuild()
{
return sampleInProgressBuild();
}
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
function smallFinishedBuild()
{
return sampleFinishedBuild(null, null, "some builder");
}
function createSampleBuildRequest(platform, test)
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
{
assert(platform instanceof Platform);
assert(test instanceof Test);
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
const webkit197463 = CommitLog.ensureSingleton('111127', {'id': '111127', 'time': 1456955807334, 'repository': MockModels.webkit, 'revision': '197463'});
const shared111237 = CommitLog.ensureSingleton('111237', {'id': '111237', 'time': 1456931874000, 'repository': MockModels.sharedRepository, 'revision': '80229'});
const ios13A452 = CommitLog.ensureSingleton('88930', {'id': '88930', 'time': 0, 'repository': MockModels.ios, 'revision': '13A452'});
const commitSet = CommitSet.ensureSingleton('4197', {customRoots: [], revisionItems: [{commit: webkit197463}, {commit: shared111237}, {commit: ios13A452}]});
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
return BuildRequest.ensureSingleton('16733-' + platform.id(), {'triggerable': MockModels.triggerable,
repositoryGroup: MockModels.svnRepositoryGroup,
[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
'commitSet': commitSet, 'status': 'pending', 'platform': platform, 'test': test, order: 0});
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
}
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
function createSampleBuildRequestWithPatch(platform, test, order)
{
assert(platform instanceof Platform);
assert(!test || test instanceof Test);
const webkit197463 = CommitLog.ensureSingleton('111127', {'id': '111127', 'time': 1456955807334, 'repository': MockModels.webkit, 'revision': '197463'});
const shared111237 = CommitLog.ensureSingleton('111237', {'id': '111237', 'time': 1456931874000, 'repository': MockModels.sharedRepository, 'revision': '80229'});
const ios13A452 = CommitLog.ensureSingleton('88930', {'id': '88930', 'time': 0, 'repository': MockModels.ios, 'revision': '13A452'});
const patch = new UploadedFile(453, {'createdAt': new Date('2017-05-01T19:16:53Z'), 'filename': 'patch.dat', 'extension': '.dat', 'author': 'some user',
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
size: 534637, sha256: '169463c8125e07c577110fe144ecd63942eb9472d438fc0014f474245e5df8a1'});
const root = new UploadedFile(456, {'createdAt': new Date('2017-05-01T21:03:27Z'), 'filename': 'root.dat', 'extension': '.dat', 'author': 'some user',
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
size: 16452234, sha256: '03eed7a8494ab8794c44b7d4308e55448fc56f4d6c175809ba968f78f656d58d'});
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
const commitSet = CommitSet.ensureSingleton('53246456', {customRoots: [root], revisionItems: [{commit: webkit197463, patch, requiresBuild: true}, {commit: shared111237}, {commit: ios13A452}]});
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
return BuildRequest.ensureSingleton(`6345645376-${order}`, {'triggerable': MockModels.triggerable,
repositoryGroup: MockModels.svnRepositoryGroup,
'commitSet': commitSet, 'status': 'pending', 'platform': platform, 'test': test, 'order': order});
}
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
function createSampleBuildRequestWithOwnedCommit(platform, test, order)
{
assert(platform instanceof Platform);
assert(!test || test instanceof Test);
const webkit197463 = CommitLog.ensureSingleton('111127', {'id': '111127', 'time': 1456955807334, 'repository': MockModels.webkit, 'revision': '197463'});
const owner111289 = CommitLog.ensureSingleton('111289', {'id': '111289', 'time': 1456931874000, 'repository': MockModels.ownerRepository, 'revision': 'owner-001'});
const owned111222 = CommitLog.ensureSingleton('111222', {'id': '111222', 'time': 1456932774000, 'repository': MockModels.ownedRepository, 'revision': 'owned-002'});
const ios13A452 = CommitLog.ensureSingleton('88930', {'id': '88930', 'time': 0, 'repository': MockModels.ios, 'revision': '13A452'});
const root = new UploadedFile(456, {'createdAt': new Date('2017-05-01T21:03:27Z'), 'filename': 'root.dat', 'extension': '.dat', 'author': 'some user',
size: 16452234, sha256: '03eed7a8494ab8794c44b7d4308e55448fc56f4d6c175809ba968f78f656d58d'});
const commitSet = CommitSet.ensureSingleton('53246486', {customRoots: [root], revisionItems: [{commit: webkit197463}, {commit: owner111289}, {commit: owned111222, commitOwner: owner111289, requiresBuild: true}, {commit: ios13A452}]});
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
return BuildRequest.ensureSingleton(`6345645370-${order}`, {'triggerable': MockModels.triggerable,
repositoryGroup: MockModels.svnRepositoryWithOwnedRepositoryGroup,
'commitSet': commitSet, 'status': 'pending', 'platform': platform, 'test': test, 'order': order});
}
function createSampleBuildRequestWithOwnedCommitAndPatch(platform, test, order)
{
assert(platform instanceof Platform);
assert(!test || test instanceof Test);
const webkit197463 = CommitLog.ensureSingleton('111127', {'id': '111127', 'time': 1456955807334, 'repository': MockModels.webkit, 'revision': '197463'});
const owner111289 = CommitLog.ensureSingleton('111289', {'id': '111289', 'time': 1456931874000, 'repository': MockModels.ownerRepository, 'revision': 'owner-001'});
const owned111222 = CommitLog.ensureSingleton('111222', {'id': '111222', 'time': 1456932774000, 'repository': MockModels.ownedRepository, 'revision': 'owned-002'});
const ios13A452 = CommitLog.ensureSingleton('88930', {'id': '88930', 'time': 0, 'repository': MockModels.ios, 'revision': '13A452'});
const patch = new UploadedFile(453, {'createdAt': new Date('2017-05-01T19:16:53Z'), 'filename': 'patch.dat', 'extension': '.dat', 'author': 'some user',
size: 534637, sha256: '169463c8125e07c577110fe144ecd63942eb9472d438fc0014f474245e5df8a1'});
const commitSet = CommitSet.ensureSingleton('53246486', {customRoots: [], revisionItems: [{commit: webkit197463, patch, requiresBuild: true}, {commit: owner111289}, {commit: owned111222, commitOwner: owner111289, requiresBuild: true}, {commit: ios13A452}]});
return BuildRequest.ensureSingleton(`6345645370-${order}`, {'triggerable': MockModels.triggerable,
repositoryGroup: MockModels.svnRepositoryWithOwnedRepositoryGroup,
'commitSet': commitSet, 'status': 'pending', 'platform': platform, 'test': test, 'order': order});
}
function samplePendingBuildRequestData(buildRequestId, buildTime, workerName, builderId)
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
{
return {
"builderid": builderId || 102,
"buildrequestid": 17,
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
"buildsetid": 894720,
"claimed": false,
"claimed_at": null,
"claimed_by_masterid": null,
"complete": false,
"complete_at": null,
"priority": 0,
"results": -1,
"submitted_at": buildTime || 1458704983,
"waited_for": false,
"properties": {
"build_request_id": [buildRequestId || 16733, "Force Build Form"],
"scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
[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": [workerName, "Worker (deprecated)"],
"workername": [workerName, "Worker"]
}
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
};
}
function samplePendingBuildRequests(buildRequestId, buildTime, workerName, builderName)
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
{
return {
"buildrequests" : [samplePendingBuildRequestData(buildRequestId, buildTime, workerName, builderNameToIDMap()[builderName])]
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +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
function sampleBuildData(workerName, isComplete, buildRequestId, buildTag, builderId, state_string)
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
{
return {
"builderid": builderId || 102,
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
"number": buildTag || 614,
"buildrequestid": 17,
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
"complete": isComplete,
"complete_at": null,
"buildid": 418744,
"masterid": 1,
"results": null,
"started_at": 1513725109,
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
state_string,
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
"workerid": 41,
"properties": {
"build_request_id": [buildRequestId || 16733, "Force Build Form"],
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
"platform": ["mac", "Unknown"],
"scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
[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": [workerName || "ABTest-iPad-0", "Worker (deprecated)"],
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
"workername": [workerName || "ABTest-iPad-0", "Worker"],
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
}
};
}
function sampleInProgressBuildData(workerName)
{
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
return sampleBuildData(workerName, false, null, null, null, 'building');
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
}
function sampleInProgressBuild(workerName)
{
return {
"builds": [sampleInProgressBuildData(workerName)]
};
}
function sampleFinishedBuildData(buildRequestId, workerName, builderName)
{
return sampleBuildData(workerName, true, buildRequestId || 18935, 1755, builderNameToIDMap()[builderName]);
}
function sampleFinishedBuild(buildRequestId, workerName, builderName)
{
return {
"builds": [sampleFinishedBuildData(buildRequestId, workerName, builderName)]
};
}
describe('BuildbotSyncer', () => {
MockModels.inject();
const requests = MockRemoteAPI.inject('http://build.webkit.org', BrowserPrivilegedAPI);
describe('_loadConfig', () => {
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
it('should create BuildbotSyncer objects for a configuration that specify all required options', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
assert.equal(BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap()).length, 1);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
it('should throw when some required options are missing', () => {
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
delete config.builders;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /"some-builder" is not a valid builder in the configuration/);
assert.throws(() => {
const config = smallConfiguration();
delete config.types;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /"some-test" is not a valid type in the configuration/);
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
delete config.testConfigurations[0].builders;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /The test configuration 1 does not specify "builders" as an array/);
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
delete config.testConfigurations[0].platforms;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /The test configuration 1 does not specify "platforms" as an array/);
assert.throws(() => {
const config = smallConfiguration();
delete config.testConfigurations[0].types;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /The test configuration 0 does not specify "types" as an array/);
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
delete config.buildRequestArgument;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /buildRequestArgument must specify the name of the property used to store the build request ID/);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
it('should throw when a test name is not an array of strings', () => {
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.testConfigurations[0].types = 'some test';
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /The test configuration 0 does not specify "types" as an array/);
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.testConfigurations[0].types = [1];
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /"1" is not a valid type in the configuration/);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
it('should throw when properties is not an object', () => {
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.builders[Object.keys(config.builders)[0]].properties = 'hello';
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties should be a dictionary/);
assert.throws(() => {
const config = smallConfiguration();
config.types[Object.keys(config.types)[0]].properties = 'hello';
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties should be a dictionary/);
});
it('should throw when testProperties is specifed in a type or a builder', () => {
assert.throws(() => {
const config = smallConfiguration();
const firstType = Object.keys(config.types)[0];
config.types[firstType].testProperties = {};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Unrecognized parameter "testProperties"/);
assert.throws(() => {
const config = smallConfiguration();
const firstBuilder = Object.keys(config.builders)[0];
config.builders[firstBuilder].testProperties = {};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Unrecognized parameter "testProperties"/);
});
it('should throw when buildProperties is specifed in a type or a builder', () => {
assert.throws(() => {
const config = smallConfiguration();
const firstType = Object.keys(config.types)[0];
config.types[firstType].buildProperties = {};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Unrecognized parameter "buildProperties"/);
assert.throws(() => {
const config = smallConfiguration();
const firstBuilder = Object.keys(config.builders)[0];
config.builders[firstBuilder].buildProperties = {};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Unrecognized parameter "buildProperties"/);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
it('should throw when properties for a type is malformed', () => {
const firstType = Object.keys(smallConfiguration().types)[0];
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.types[firstType].properties = 'hello';
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties should be a dictionary/);
assert.throws(() => {
const config = smallConfiguration();
config.types[firstType].properties = {'some': {'otherKey': 'some root'}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties "some" specifies a non-string value of type "object"/);
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.types[firstType].properties = {'some': {'otherKey': 'some root'}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties "some" specifies a non-string value of type "object"/);
assert.throws(() => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.types[firstType].properties = {'some': {'revision': 'WebKit'}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties "some" specifies a non-string value of type "object"/);
assert.throws(() => {
const config = smallConfiguration();
config.types[firstType].properties = {'some': 1};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, / Build properties "some" specifies a non-string value of type "object"/);
});
it('should throw when properties for a builder is malformed', () => {
const firstBuilder = Object.keys(smallConfiguration().builders)[0];
assert.throws(() => {
const config = smallConfiguration();
config.builders[firstBuilder].properties = 'hello';
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties should be a dictionary/);
assert.throws(() => {
const config = smallConfiguration();
config.builders[firstBuilder].properties = {'some': {'otherKey': 'some root'}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties "some" specifies a non-string value of type "object"/);
assert.throws(() => {
const config = smallConfiguration();
config.builders[firstBuilder].properties = {'some': {'otherKey': 'some root'}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties "some" specifies a non-string value of type "object"/);
assert.throws(() => {
const config = smallConfiguration();
config.builders[firstBuilder].properties = {'some': {'revision': 'WebKit'}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties "some" specifies a non-string value of type "object"/);
assert.throws(() => {
const config = smallConfiguration();
config.builders[firstBuilder].properties = {'some': 1};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Build properties "some" specifies a non-string value of type "object"/);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
it('should create BuildbotSyncer objects for valid configurations', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.equal(syncers.length, 3);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
assert.ok(syncers[0] instanceof BuildbotSyncer);
assert.ok(syncers[1] instanceof BuildbotSyncer);
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.ok(syncers[2] instanceof BuildbotSyncer);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
it('should parse builder names correctly', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
assert.equal(syncers[0].builderName(), 'ABTest-iPhone-RunBenchmark-Tests');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(syncers[1].builderName(), 'ABTest-iPad-RunBenchmark-Tests');
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.equal(syncers[2].builderName(), 'ABTest-iOS-Builder');
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
it('should parse test configurations with build configurations correctly', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
let configurations = syncers[0].testConfigurations();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert(syncers[0].isTester());
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(configurations.length, 3);
assert.equal(configurations[0].platform, MockModels.iphone);
assert.equal(configurations[0].test, MockModels.speedometer);
assert.equal(configurations[1].platform, MockModels.iphone);
assert.equal(configurations[1].test, MockModels.jetstream);
assert.equal(configurations[2].platform, MockModels.iphone);
assert.equal(configurations[2].test, MockModels.domcore);
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.deepEqual(syncers[0].buildConfigurations(), []);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
configurations = syncers[1].testConfigurations();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert(syncers[1].isTester());
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(configurations.length, 2);
assert.equal(configurations[0].platform, MockModels.ipad);
assert.equal(configurations[0].test, MockModels.speedometer);
assert.equal(configurations[1].platform, MockModels.ipad);
assert.equal(configurations[1].test, MockModels.jetstream);
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.deepEqual(syncers[1].buildConfigurations(), []);
assert(!syncers[2].isTester());
assert.deepEqual(syncers[2].testConfigurations(), []);
configurations = syncers[2].buildConfigurations();
assert.equal(configurations.length, 2);
assert.equal(configurations[0].platform, MockModels.iphone);
assert.equal(configurations[0].test, null);
assert.equal(configurations[1].platform, MockModels.ipad);
assert.equal(configurations[1].test, null);
});
it('should throw when a build configuration use the same builder as a test configuration', () => {
assert.throws(() => {
const config = sampleiOSConfig();
config.buildConfigurations[0].builders = config.testConfigurations[0].builders;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
});
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
it('should parse test configurations with types and platforms expansions correctly', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfigWithExpansions(), builderNameToIDMap());
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.equal(syncers.length, 3);
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
let configurations = syncers[0].testConfigurations();
assert.equal(configurations.length, 4);
assert.equal(configurations[0].platform, MockModels.iphone);
assert.equal(configurations[0].test, MockModels.iPhonePLT);
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.equal(configurations[1].platform, MockModels.iphone);
assert.equal(configurations[1].test, MockModels.speedometer);
assert.equal(configurations[2].platform, MockModels.iOS10iPhone);
assert.equal(configurations[2].test, MockModels.iPhonePLT);
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
assert.equal(configurations[3].platform, MockModels.iOS10iPhone);
assert.equal(configurations[3].test, MockModels.speedometer);
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.deepEqual(syncers[0].buildConfigurations(), []);
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
configurations = syncers[1].testConfigurations();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.equal(configurations.length, 4);
assert.equal(configurations[0].platform, MockModels.iphone);
assert.equal(configurations[0].test, MockModels.iPhonePLT);
assert.equal(configurations[1].platform, MockModels.iphone);
assert.equal(configurations[1].test, MockModels.speedometer);
assert.equal(configurations[2].platform, MockModels.iOS10iPhone);
assert.equal(configurations[2].test, MockModels.iPhonePLT);
assert.equal(configurations[3].platform, MockModels.iOS10iPhone);
assert.equal(configurations[3].test, MockModels.speedometer);
assert.deepEqual(syncers[1].buildConfigurations(), []);
configurations = syncers[2].testConfigurations();
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
assert.equal(configurations.length, 2);
assert.equal(configurations[0].platform, MockModels.ipad);
assert.equal(configurations[0].test, MockModels.iPadPLT);
assert.equal(configurations[1].platform, MockModels.ipad);
assert.equal(configurations[1].test, MockModels.speedometer);
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
assert.deepEqual(syncers[2].buildConfigurations(), []);
Syncing script's configuration duplicates a lot of boilerplate https://bugs.webkit.org/show_bug.cgi?id=160574 Rubber-stamped by Chris Dumez. This patch makes each configuration accept an array of platforms and types so that we can write: {"type": "speedometer", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "speedometer", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "speedometer", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk El Capitan MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk El Capitan MacBookPro"}, {"type": "jetstream", "builder": "mba", "platform": "Trunk Sierra MacBookAir"}, {"type": "jetstream", "builder": "mbp", "platform": "Trunk Sierra MacBookPro"}, more concisely as: {"builder": "mba", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookAir", "Trunk Sierra MacBookAir"]}, {"builder": "mbp", "types": ["speedometer", "jetstream"], "platforms": ["Trunk El Capitan MacBookPro", "Trunk Sierra MacBookPro"]}, * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): (BuildbotSyncer._expandTypesAndPlatforms): Added. Clones a new configuration entry for each type and platform. (BuildbotSyncer._createTestConfiguration): Extracted from _loadConfig. (BuildbotSyncer._validateAndMergeConfig): Added a new argument that specifies a property that shouldn't be merged into the configuration. Also added the support for 'types' and 'platforms', and merged the code for verify an array of strings. Finally, allow the appearance of 'properties' since this function can now be called on a cloned configuration in which 'arguments' had already been renamed to 'properties'. * unit-tests/buildbot-syncer-tests.js: Added a test case to parse a consolidated configuration. (sampleiOSConfigWithExpansions): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added a few more mock models for the newly added test. Canonical link: https://commits.webkit.org/178693@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-04 23:24:14 +00:00
});
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
it('should throw when repositoryGroups is not an object', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = 1;
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /repositoryGroups must specify a dictionary from the name to its definition/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = 'hello';
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /repositoryGroups must specify a dictionary from the name to its definition/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
it('should throw when a repository group does not specify a dictionary of repositories', () => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {testProperties: {}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" does not specify a dictionary of repositories/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: 1}, testProperties: {}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" does not specify a dictionary of repositories/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
it('should throw when a repository group specifies an empty dictionary', () => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {}, testProperties: {}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" does not specify any repository/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
it('should throw when a repository group specifies an invalid repository name', () => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'InvalidRepositoryName': {}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /"InvalidRepositoryName" is not a valid repository name/);
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
});
it('should throw when a repository group specifies a repository with a non-dictionary value', () => {
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'WebKit': 1}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /"WebKit" specifies a non-dictionary value/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
it('should throw when the description of a repository group is not a string', () => {
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'WebKit': {}}, description: 1}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" have an invalid description/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'WebKit': {}}, description: [1, 2]}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" have an invalid description/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
it('should throw when a repository group does not specify a dictionary of properties', () => {
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'WebKit': {}}, testProperties: 1}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies the test configurations with an invalid type/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'WebKit': {}}, testProperties: 'hello'}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies the test configurations with an invalid type/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
it('should throw when a repository group refers to a non-existent repository in the properties dictionary', () => {
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'WebKit': {}}, testProperties: {'wk': {revision: 'InvalidRepository'}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" an invalid repository "InvalidRepository"/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
it('should throw when a repository group refers to a repository which is not listed in the list of repositories', () => {
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {repositories: {'WebKit': {}}, testProperties: {'os': {revision: 'iOS'}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" an invalid repository "iOS"/);
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {acceptsPatch: true}},
testProperties: {'wk': {revision: 'WebKit'}, 'install-roots': {'roots': {}}},
buildProperties: {'os': {revision: 'iOS'}},
acceptsRoots: true}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" an invalid repository "iOS"/);
});
it('should throw when a repository group refers to a repository in building a patch which does not accept a patch', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {acceptsPatch: true}, 'iOS': {}},
testProperties: {'wk': {revision: 'WebKit'}, 'ios': {revision: 'iOS'}, 'install-roots': {'roots': {}}},
buildProperties: {'wk': {revision: 'WebKit'}, 'ios': {revision: 'iOS'}, 'wk-patch': {patch: 'iOS'}},
acceptsRoots: true}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies a patch for "iOS" but it does not accept a patch/);
});
it('should throw when a repository group specifies a patch without specifying a revision', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {acceptsPatch: true}},
testProperties: {'wk': {revision: 'WebKit'}, 'install-roots': {'roots': {}}},
buildProperties: {'wk-patch': {patch: 'WebKit'}},
acceptsRoots: true}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies a patch for "WebKit" but does not specify a revision/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
it('should throw when a repository group does not use a listed repository', () => {
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {'repositories': {'WebKit': {}}, testProperties: {}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" does not use some of the repositories listed in testing/);
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {acceptsPatch: true}},
testProperties: {'wk': {revision: 'WebKit'}, 'install-roots': {'roots': {}}},
buildProperties: {},
acceptsRoots: true}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" does not use some of the repositories listed in building a patch/);
Add the support for scheduling a A/B testing with a patch. https://bugs.webkit.org/show_bug.cgi?id=171209 Reviewed by Chris Dumez. Added the support for creating a custom test group with a patch applied. First, each repository in a repository group has a boolean indicating whether a given repository can have a patch applied or not. When any configuration in a test group contains a patch, we create build requests without a test specified in order to "build" those patches. These build requests have negative order numbers to differentiate them from regular build requests. We can't simply build ones with patches since there could be differences in SDK, build options, etc... when patches are applied. The JSON format for commit sets returned by /api/build-requests have been changed from using an array of commit IDs to an array of dictionaries indicate commit and acceptsPatch boolean. /api/update-triggerable now uses a dictionary with two keys: repository and acceptsPatch to specify a set of repositories associated with a repository group, and /privileged-api-create-test-group uses a dictionary with two keys: revision and patch instead of a revision string to specify commit sets. Furthermore, the syncing script's configuration have been updated to use a dictionary of repository names to an options dictionary instead of an array of repositories names. For now, the only supported option is acceptsPatch but will be extended when we add the support for rolling back system components. e.g. {"WebKit": {acceptsPatch: true}, "macOS": {}} instead of ["WebKit", "macOS"] On the UI side, InstantFileUploader has been changed to accept only one file by default, and added a new method allowMultipleFiles() to allow multiple files to be selected for custom roots. Also replaced the input element with type=file by a button with a custom label to show labels such as "Apply a patch" or "Add a new root" instead of the generic label like "choose a file". * init-database.sql: Added trigrepo_accepts_patch to triggerable_repositories to indicate whether a given repository can have a patch applied or not. Made request_test optional in build_requests for when a build request is created to build patches. Such a build request have a negative request_order. Updated the related constraints accordingly. * public/admin/triggerables.php: Added the support for updating whether a given repository can have a patch applied in each repository group. Only show the repositories in the repository group for this purpose since there is no way to accept a patch on a repository without it being a part of the group. (generate_repository_form): Now takes the markup for checkboxes instead of generating one itself. (generate_repository_checkboxes): Now takes an array of repositories to generate checkboxes. The checkbox is shown when the repository ID exists as a key in this array, and is checked when its value is true. The new capability to skip repositories not in the array is used to hide repositories not associated with the group in the list of checkboxes to indicate a repository accepts a patch. * public/api/update-triggerable.php: (main): Now updates the description and acceptsRoots states of each repository group, and sets acceptsPatch boolean for each repository in the group if set in the update. (validate_repository_groups): Use a reference to $repository_groups in order to set repository_id_list, which contains an array of repository IDs to find the existing repository group that matches the set via RepositoryGroupFinder's find_by_repositories. Also added a various validations for acceptsRoots, a dictionary specifying repository and acceptsPatch. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_commits_for_set_if_needed): Instead of returning an array of commit IDs as "commits", it now returns an array of dictionaries with "commit" and "patch" keys specifying the commit ID and the patch file's ID respectively as "revisionItems". (BuildRequestsFetcher::add_uploaded_file): Added. Extracted from fetch_commits_for_set_if_needed. Used to add either a patch file or a custom root file in the list of uploaded files in the result. * public/include/manifest-generator.php: (fetch_triggerables): Each element in repository group's "repositories" field is now an array of dictionaries with "repository" and "acceptsPatch" as keys. * public/include/repository-group-finder.php: (RepositoryGroupFinder::__construct): Added a map for boolean indicating whether a given repository group allows a patch on a repository. Used in /privileged-api/create-test-group. (RepositoryGroupFinder::accepts_patch): Added. (RepositoryGroupFinder::populate_map): Build up the map for acceptsPatch boolean per repository per group. * public/privileged-api/create-test-group.php: (main): Fixed a bug that we were not explicitly checking for a duplicate test group name (with a test). Create build requests to "build" patches if there is any patch file specified. (commit_sets_from_revision_sets): Updated to take a dictionary with "revision" and "patch" as keys to specify a revision and a patch if any instead of just a revision string for each repository. Also validate that each repository is allowed to have a patch once the repository group has been found for the set of repositories. (ensure_commit_sets): * public/v3/components/custom-analysis-task-configurator.js: (CustomAnalysisTaskConfigurator): Added _patchUploaders as an instance variable, which is a dictionary of configuration names to a map of InstantFileUploader's used to upload a patch. Also renamed _fileUploaders to _customRootUploaders for clarity. (CustomAnalysisTaskConfigurator.prototype.setCommitSets): (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree.createRootUploader): Added. (CustomAnalysisTaskConfigurator.prototype.didConstructShadowTree): (CustomAnalysisTaskConfigurator.prototype._ensurePatchUploader): Added. Creates an instant file uploader for patches. We only allow a single patch per repository. (CustomAnalysisTaskConfigurator.prototype._computeCommitSet): Include a patch in the commit set as needed. (CustomAnalysisTaskConfigurator.prototype._buildRevisionTable): Show the patch file uploader for repositories which can have patches in the current repository group. (CustomAnalysisTaskConfigurator.cssTemplate): Show borders between every rows instead of just between tbody's now that each row can have a patch file uploader. * public/v3/components/instant-file-uploader.js: (InstantFileUploader): Added _fileInput and _allowMultipleFiles as instance variables. We now show a button in the UI instead of an input with type=file. _fileInput is a hidden input with type=file used inside a click event of the button to let the user pick a file. (InstantFileUploader.prototype.allowMultipleFiles): Added. Allows this instance to accept multiple files. (InstantFileUploader.prototype.didConstructShadowTree): Synthetically click on the hidden input element when the newly added button element is clicked to open the browser's file picker. (InstantFileUploader.prototype.render): Hide the button to add a file if this instance can only select one file and there is already some file being uploaded in this instance. (InstantFileUploader.htmlTemplate): Replaced the input element with type=file with a button. Its label comes from the default slot content. * public/v3/models/build-request.js: (BuildRequest): Made the test optional. (BuildRequest.prototype.isBuild): Returns true if this is a build request for building a patch. (BuildRequest.prototype.isTest): Returns true if this is a build request for running tests. (BuildRequest.constructBuildRequestsFromData): Create each commit log here instead of relying on CommitSet's constructor to construct its commit logs. Also updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/commit-set.js: (CommitSet): Made _repositoryToCommitMap a real Map object. Also added _repositoryToPatchMap. Also got rid of the code to instantiate commit logs since that's now done in BuildRequest.constructBuildRequestsFromData. (CommitSet.prototype.commitForRepository): (CommitSet.prototype.revisionForRepository): (CommitSet.prototype.patchForRepository): Added. (CommitSet.prototype.latestCommitTime): Modernized the code. (CommitSet.prototype.equals): Modernized the code. Also added the check for patches. (MeasurementCommitSet): Updated per the change to make _repositoryToCommitMap a real Map. (CustomCommitSet.prototype.setRevisionForRepository): (CustomCommitSet.prototype.equals): Added the check for patches. (CustomCommitSet.prototype.revisionForRepository): (CustomCommitSet.prototype.patchForRepository): Added. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Updated per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * public/v3/models/repository.js: (Repository.prototype.ownerId): Renamed from owner for clarity. * public/v3/models/test-group.js: (TestGroup): Modernized the code by using LazilyEvaluatedFunction. Removed _requestsAreInOrder since it's not necessary anymore with LazilyEvaluatedFunction. (TestGroup.prototype.addBuildRequest): (TestGroup.prototype.test): Use the last build request's test since the first few requests could be requests to build patches. (TestGroup.prototype.platform): Ditto. (TestGroup.prototype._lastRequest): Added. (TestGroup.prototype._orderedBuildRequests): Added. (TestGroup.prototype.repetitionCount): Only count the build requests for testing (skipping any requests to build patches). (TestGroup.prototype.requestedCommitSets): Simply call _computeRequestedCommitSetsLazily. (TestGroup.prototype._computeRequestedCommitSets): Extracted from requestedCommitSets. (TestGroup.prototype.requestsForCommitSet): (TestGroup.prototype.labelForCommitSet): Rewritten. Just compute the label here instead of relying on _commitSetToLabel since requestedSets is always of the length two at the moment. (TestGroup._revisionSetsFromCommitSets): Specify both the revision and the patch in the revision set. * public/v3/models/triggerable.js: (TriggerableRepositoryGroup): Added _patchAcceptingSet as an instance variable. Use sortByNamePreferringOnesWithURL to sort repositories instead of simple sortByName. (TriggerableRepositoryGroup.prototype.accepts): Added checks for the custom roots and patches. (TriggerableRepositoryGroup.prototype.acceptsPatchForRepository): Added. * server-tests/api-build-requests-tests.js: Updated the test cases per the replacement of an array of commit IDs by an array of dictionaries with commit and patch properties. * server-tests/api-manifest-tests.js: Updated the test case per the name of Repository's owner to ownerId. * server-tests/api-update-triggerable.js: Updated the test case per the name of Repository's owner to ownerId, and added a test case for updating whether a given repository group allows custom roots as well as patches on repositories via /api/update-triggerable. (.updateWithOSXRepositoryGroup): Updated the sample syncing script configuration per the format change. (.refetchManifest): Added. * server-tests/privileged-api-create-test-group-tests.js: Updated per the syncing script configuration format change. Also added a test for creating a test group with a duplicate name, which is expected to fail with DuplicateTestGroupName, and creating a test group with a patch both when it's allowed and when it's not allowed in the matching repository group. (.addTriggerableAndCreateTask): Updated per the format change. * server-tests/resources/mock-data.js: (MockData.addEmptyTriggerable): Added a metric and its configuration to make it appear in the manifest file. The new test case in api-update-triggerable.js requires this. (MockData.mockTestSyncConfigWithSingleBuilder): Updated per the syncing script configuration format change. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Removed the useless assertions about test configurations, and added assertions about custom roots and patches in the test case for updateTriggerables. * tools/js/buildbot-syncer.js: (BuildbotSyncer._parseRepositoryGroup): Made each assertion explicitly refer to the specific repository group to make it more user friendly. Now each repository group uses a dictionary of repository names to its options in the syncing script configurations. When parsed, we insert it as an array of dictionaries with repository ID and acceptsPatch boolean specified separately since this is the format /api/update-triggerable expects. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): * unit-tests/build-request-tests.js: (sampleBuildRequestData): Updated per the commit sets format change in /api/build-requests. * unit-tests/buildbot-syncer-tests.js: Updated the existing tests per various format changes and added a couple of new test cases for the syncing script's configuration validation. (sampleiOSConfig): (smallConfiguration): (createSampleBuildRequest): * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Updated per the repository group format change. * unit-tests/test-groups-tests.js: (sampleTestGroup): Updated per the commit sets format change in /api/build-requests. Canonical link: https://commits.webkit.org/188378@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-30 18:11:47 +00:00
});
it('should throw when a repository group specifies non-boolean value to acceptsRoots', () => {
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {'repositories': {'WebKit': {}}, 'testProperties': {'webkit': {'revision': 'WebKit'}}, acceptsRoots: 1}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" contains invalid acceptsRoots value:/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.throws(() => {
const config = smallConfiguration();
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
config.repositoryGroups = {'some-group': {'repositories': {'WebKit': {}}, 'testProperties': {'webkit': {'revision': 'WebKit'}}, acceptsRoots: []}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" contains invalid acceptsRoots value:/);
});
it('should throw when a repository group specifies non-boolean value to acceptsPatch', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {'repositories': {'WebKit': {acceptsPatch: 1}}, 'testProperties': {'webkit': {'revision': 'WebKit'}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /"WebKit" contains invalid acceptsPatch value:/);
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {'repositories': {'WebKit': {acceptsPatch: []}}, 'testProperties': {'webkit': {'revision': 'WebKit'}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /"WebKit" contains invalid acceptsPatch value:/);
});
it('should throw when a repository group specifies a patch in testProperties', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {'repositories': {'WebKit': {acceptsPatch: true}},
'testProperties': {'webkit': {'revision': 'WebKit'}, 'webkit-patch': {'patch': 'WebKit'}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies a patch for "WebKit" in the properties for testing/);
});
it('should throw when a repository group specifies roots in buildProperties', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {acceptsPatch: true}},
testProperties: {'webkit': {revision: 'WebKit'}, 'install-roots': {'roots': {}}},
buildProperties: {'webkit': {revision: 'WebKit'}, 'patch': {patch: 'WebKit'}, 'install-roots': {roots: {}}},
acceptsRoots: true}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies roots in the properties for building/);
});
it('should throw when a repository group that does not accept roots specifies roots in testProperties', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {}},
testProperties: {'webkit': {'revision': 'WebKit'}, 'install-roots': {'roots': {}}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies roots in a property but it does not accept roots/);
});
it('should throw when a repository group specifies buildProperties but does not accept roots', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {acceptsPatch: true}},
testProperties: {'webkit': {revision: 'WebKit'}},
buildProperties: {'webkit': {revision: 'WebKit'}, 'webkit-patch': {patch: 'WebKit'}}}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies the properties for building but does not accept roots in testing/);
});
it('should throw when a repository group specifies buildProperties but does not accept any patch', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {}},
testProperties: {'webkit': {'revision': 'WebKit'}, 'install-roots': {'roots': {}}},
buildProperties: {'webkit': {'revision': 'WebKit'}},
acceptsRoots: true}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" specifies the properties for building but does not accept any patches/);
});
it('should throw when a repository group accepts roots but does not specify roots in testProperties', () => {
assert.throws(() => {
const config = smallConfiguration();
config.repositoryGroups = {'some-group': {
repositories: {'WebKit': {acceptsPatch: true}},
testProperties: {'webkit': {revision: 'WebKit'}},
buildProperties: {'webkit': {revision: 'WebKit'}, 'webkit-patch': {patch: 'WebKit'}},
acceptsRoots: true}};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
BuildbotSyncer._loadConfig(MockRemoteAPI, config, builderNameToIDMap());
Add the support for perf try bots to sync-buildbot.js https://bugs.webkit.org/show_bug.cgi?id=172529 Rubber-stamped by Chris Dumez. Make sync-buildbot.js schedule an A/B testing job with a patch or roots to buildbot. Change the buildbot property format in the syncing script's configuration again to use a dictionary with a single key of "revision", "patch", or "roots" to specify a revision, a patch, or a set of roots, and simplified the structure of the configuration by always having "types" and "builders", and make each entry in "configurations" refer to a list of types, platforms, and builders. Since now there are build requests to build patches and run tests, "configurations" has been renamed to "testConfigurations" and "buildConfigurations" have been added. Each entry in "buildConfigurations" specifies a list of platforms and builders. Similarly in repository group configurations, the buildbot properties for testing is now specified as "testProperties" and ones for building a patch is specified in newly introduced "buildProperties". * public/api/build-requests.php: (update_builds): When a build request to build a patch fails, mark all subsequent requests as failed since there is no way to run tests without a successful build. * public/api/update-triggerable.php: (main): Re-generate manifest.json after updating the triggerable. The lack of this re-generation was the reason we had to manually GET /api/manifest in api-update-triggerable-tests.js. * public/v3/models/build-request.js: (BuildRequest.prototype.hasCompleted): Added. * public/v3/models/manifest.js: (Manifest.reset): Added. Extracted from MockData.resetV3Models in unit-tests/mock-data.js and syncLoop in tools/sync-buildbot.js (Manifest.fetch): Reset V3 models before fetching the manifest. This eliminates the need to manually reset V3 models in syncLoop. * public/v3/models/uploaded-file.js: (UploadedFile.prototype.url): Use RemoteAPI.url to get the full URL instead of just a path. * public/v3/remote.js: (BrowserRemoteAPI.prototype.url): Added. Constructs the full URL. * server-tests/api-update-triggerable-tests.js: (.refetchManifest): Deleted. Now that /api/manifest re-generates manifest.json, we can simply call Manifest.fetch instead. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Calls Manifest.reset(). (MockData.addMockConfiguration): Extracted from addMockData. (MockData.addMockData): Updated per the format change. (MockData.mockTestSyncConfigWithSingleBuilder): Ditto. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. (MockData.runningBuild): Make buildNumber specifiable. (MockData.finishedBuild): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated configurations per the format change. Now that now acceptsCustomRoots() for "system-and-webkit" must be true since we can't have a repository group that which accepts a patch and not take roots. * server-tests/tools-sync-buildbot-integration-tests.js: Added. (createTriggerable): Added. (createTestGroupWihPatch): Added. (uploadRoot): Added. (.assertAndResolveRequest): Added. (.assertTestBuildHasFailed): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added. _type as an instance variable to identify whether this buildbot builder is a "builder" which builds a patch, builder, or a "tester" which runs a test. Also renamed _testConfigurations to _configurations. (BuildbotSyncer.prototype.addTestConfiguration): Assert that either the type of this syncer hasn't been set or it's a tester. (BuildbotSyncer.prototype.testConfigurations): Return [] when it's a builder. (BuildbotSyncer.prototype.addBuildConfiguration): Added. Adds a platform to a builder. (BuildbotSyncer.prototype.buildConfigurations): Added. Returns the list of configurations if this syncer is a builder. Otherwise returns []. (BuildbotSyncer.prototype.isTester): Added. (BuildbotSyncer.prototype.matchesConfiguration): (BuildbotSyncer.prototype._propertiesForBuildRequest): Updated to support the new format. (BuildbotSyncer._loadConfig): Ditto. Optionally parse buildConfigurations. (BuildbotSyncer._resolveBuildersWithPlatforms): Added. For each test or build configuration entry, creates the list of configurations per builder and platform. (BuildbotSyncer._parseRepositoryGroup): Added the support for parsing the new format with revision, roots, and patch option types with a lot of validations as we're seeing a bit of combinatorial explosion in the number of things that can go wrong. Also parse buildProperties optionally. (BuildbotSyncer._parseRepositoryGroupPropertyTemplate): Added. A helper function to parse a set of buildbot properties, validates its content, and invokes a callback if it's an dynamically resolved type such as "revision" and "patch". (BuildbotSyncer._validateAndMergeConfig): Updated per the format change. No longer allows "types", "type", "platforms", and "platform" as they're explicity resolved in _resolveBuildersWithPlatforms. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.syncOnce): (BuildbotTriggerable.prototype._validateRequests): Handle the case when a build request is not associated with any test. (BuildbotTriggerable.prototype._nextRequestInGroup): Return null when there is a build request to build a patch which has not been completed (pending, scheduled, running, or failed). Since all requests to build a patch has a negative order, those requests should all show up at the beginning. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pick a new buildbot syncer when scheduling the first request to build a patch or the first request to run a test. The first request to run a test will always have order of 0, so it's a sufficient condition to find such a request. On the other hand, the first request to build a patch can have a negative order number so we must explicitly check if it's the first item in the ordered list of requests in the test group. * tools/remote-server-relay.log: Added. * tools/sync-buildbot.js: (syncLoop): Fixed a bug we were not re-fetching the triggerable after updating the triggerable so that Triggerable and related objects we have in the memory may not reflect what we just synced to the perf dashboard. Also, we don't reset V3 models manually any more since Manifest.fetch does that. * unit-tests/buildbot-syncer-tests.js: Added more test cases and updated existing test cases to test exception messages explicitly since allowing any exception was resulting in some tests passing a result of unrelated parsing error being thrown, etc... (sampleiOSConfig): Updated per the format change. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Canonical link: https://commits.webkit.org/189454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-24 18:47:01 +00:00
}, /Repository group "some-group" accepts roots but does not specify roots in testProperties/);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
});
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
describe('_propertiesForBuildRequest', () => {
it('should include all properties specified in a given configuration', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
const properties = syncers[0]._propertiesForBuildRequest(request, [request]);
Each build request should be associated with a repository group https://bugs.webkit.org/show_bug.cgi?id=170528 Rubber-stamped by Chris Dumez. Make the buildbot syncing script use the concept of repository groups so that each repository group can post a different set of properties to buildbot. In order to do this, we associate each build request with a repository group to use. Each triggerable's repository groups is now updated by the syncing scripts via /api/update-triggerable just the same way the set of the supported platform, test pairs are updated. Each repository group specifies the list of repositories, a dictionary that maps the buildbot property name to either a string value or a repository name enclosed in < and >: ```js "repositoryGroups": { "webkit-svn": { "repositories": ["WebKit", "macOS"], "properties": {"os": "<macOS>", "wk": "<WebKit>"} } } ``` With this, removed the support for specifying a repository to use in generic dictionary of properties via a dictionary with a single key of "root", "rootOptions", and "rootsExcluding". We now validate that the list of repositories in each repository group matches exactly the ones used in buildbot properties as well as ones in build requests. After this patch, sync-with-buildbot.js will no longer schedule a build request without a repository group. Run the appropriate database queries to set the repository group on each build request. Because of this change, this patch also makes BuildbotTriggerable.prototype.syncOnce more robust against invalid build requests. Instead of throwing an exception and exiting early, it simply skips all build requests that belong to the same test group if the next build request to be scheduled does not specify a repository group. * init-database.sql: Add request_repository_group column to build_requests table, and a unique constraint for repository and group pair in triggerable_repositories table. * public/api/update-triggerable.php: (main): Validate and insert repository groups. (validate_configurations): Extracted from main. (validate_repository_groups): Added. * public/v3/models/repository.js: (Repository.findTopLevelByName): Added. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::results_internal): Include the repository group of each request in the JSON response. * public/include/repository-group-finder.php: Added. A helper class to find the repository group for a given triggerable for a list of repositories. (RepositoryGroupFinder): Added. (RepositoryGroupFinder::__construct): Added. (RepositoryGroupFinder::find_by_repositories): Added. (RepositoryGroupFinder::populate_map): Added. * public/privileged-api/create-test-group.php: (main): Each element in an array returned by ensure_commit_sets and commit_sets_from_revision_sets now contains "set", the list of commit IDs, and "repository_group", the repository group identified for each commit set. Use that to set the repository group in each new build request. (commit_sets_from_revision_sets): Use RepositoryGroupFinder to find the right repository group. (ensure_commit_sets): Ditto. There is no need to find a repository group for each commit set here since its argument is keyed by the repository name. e.g. {"WebKit": [123, 456], "macOS": ["16A323", "16A323"]} * public/v3/models/build-request.js: (BuildRequest): (BuildRequest.prototype.triggerable): Added. (BuildRequest.prototype.repositoryGroup): Added. (BuildRequest.constructBuildRequestsFromData): Resolve the triggerable and the repository group. * public/v3/models/triggerable.js: (Triggerable.prototype.name): Added. (Triggerable.prototype.acceptedRepositories): Deleted. (TriggerableRepositoryGroup): (TriggerableRepositoryGroup.prototype.accepts): Added. Retruns true if the repository group * server-tests/api-build-requests-tests.js: Added a test for getting the repository group of a build request. * server-tests/api-manifest-tests.js: Added assertions for the repository groups. * server-tests/api-report-tests.js: (.emptyReport): (.reportWithTwoLevelsOfAggregations): * server-tests/api-update-triggerable.js: Added test cases for updating the repository groups associated with a triggerable. (.updateWithOSXRepositoryGroup): (.mapRepositoriesByGroup): * server-tests/privileged-api-create-test-group-tests.js: (addTriggerableAndCreateTask): Add two repository groups for testing. Added assertions for repository groups in existing test cases, and added a test case for creating a test group with two different repository groups. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset TriggerableRepositoryGroup's static maps. (MockData.emptyTriggeragbleId): Added. (MockData.macosRepositoryId): Added. (MockData.webkitRepositoryId): Added. (MockData.gitWebkitRepositoryId): Added. (MockData.addMockData): Create repository groups as needed. Renamed the "OS X" repository to "macOS" since some tests were using the latter, and now we need mock data to be consistent across tests due to stricter checks. (MockData.addEmptyTriggerable): Added. Used in api-update-triggerable.js. (MockData.addMockTestGroupWithGitWebKit): Added. Used in api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Cleanup. (MockData.mockTestSyncConfigWithSingleBuilder): Updated the mock configuration per code changes. (MockData.mockTestSyncConfigWithTwoBuilders): Ditto. * server-tests/tools-buildbot-triggerable-tests.js: Updated a test case testing /api/update-triggerable to test updating the set of repository groups in addition to the set of test, platform pairs. (.refetchManifest): Added. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Now takes a set of configurations shared across syncers: repositoryGroups, slaveArgument, and buildRequestArgument as the third argument. (BuildbotSyncer.prototype.repositoryGroups): Added. (BuildbotSyncer.prototype._testGroupMapForBuildRequests): Cleaned up the code to use Array.prototype.find. Also added an assertion that the build request is associated with a repository group. (BuildbotSyncer.prototype._propertiesForBuildRequest): Removed the support for using an arbitary property to specify a revision in favor of explicity listing each property and repository name in a repository group. (BuildbotSyncer._loadConfig): Removed the support for "shared", which specified the set of buildbot properties shared across syncers, the name of properties which specifies the build slave name and build request ID. These values are not stored as top-level properties and superseded by the concept of repository groups. (BuildbotSyncer._parseRepositoryGroup): Parses and validates repository groups. (BuildbotSyncer._createTestConfiguration): We no longer expect each configuration to specify a dictionary of properties or buildRequestArgument (often inherited from shared). (BuildbotSyncer._validateAndMergeConfig): Removed "slaveArgument" and "buildRequestArgument" from the list of allowed proeprties in each configuration now that they're specified as top-level properties. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Update the associated repository groups. (BuildbotTriggerable.prototype.syncOnce): Skip test groups for which the next build request to be scheduled is not included in the list of valid build requests. (BuildbotTriggerable.prototype._validateRequests): Now returns the list of valid build requests, which excludes those that lack a repository group set. (BuildbotTriggerable.prototype._nextRequestInGroup): Extracted from _scheduleRequestIfSlaveIsAvailable. Finds the next build request to be scheduled for the test group. (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Renamed from _scheduleNextRequestInGroupIfSlaveIsAvailable. Now takes the syncer and the slave name as arguments instead of a test group information since syncOnce now calls _nextRequestInGroup to find the next build request. * tools/js/v3-models.js: * unit-tests/build-request-tests.js: Fixed the test name. * unit-tests/buildbot-syncer-tests.js: Removed tests for "rootOptions" and "rootsExcluding", and added tests for parsing repository groups. (sampleiOSConfig): Updated the mock configuration per code changes. (sampleiOSConfigWithExpansions): Ditto. (smallConfiguration): Ditto. Now returns the entire configuration instead of a single builder configuration. Various test cases have been updated to reflect this. (createSampleBuildRequest): Removed the git hash of WebKit to match the repository groups listed in the mock configurations. The git hash was there to test "rootOptions", which this patch removed. (samplePendingBuild): Removed "root_dict" from the list of properties. This was used to test "rootsExcluding" which, again, this patch removed. (sampleInProgressBuild): Ditto. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Added ock repository groups so that existing tests will continue to function. Canonical link: https://commits.webkit.org/187490@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-06 21:56:59 +00:00
assert.deepEqual(Object.keys(properties).sort(), ['build_request_id', 'desired_image', 'forcescheduler', 'opensource', 'test_name']);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
it('should preserve non-parametric property values', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
let request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
let properties = syncers[0]._propertiesForBuildRequest(request, [request]);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
assert.equal(properties['test_name'], 'speedometer');
assert.equal(properties['forcescheduler'], 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
request = createSampleBuildRequest(MockModels.ipad, MockModels.jetstream);
properties = syncers[1]._propertiesForBuildRequest(request, [request]);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
assert.equal(properties['test_name'], 'jetstream');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(properties['forcescheduler'], 'ABTest-iPad-RunBenchmark-Tests-ForceScheduler');
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
it('should resolve "root"', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
const properties = syncers[0]._propertiesForBuildRequest(request, [request]);
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
assert.equal(properties['desired_image'], '13A452');
});
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
it('should resolve "revision"', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
const properties = syncers[0]._propertiesForBuildRequest(request, [request]);
assert.equal(properties['opensource'], '197463');
});
it('should resolve "patch"', () => {
const config = sampleiOSConfig();
config.repositoryGroups['ios-svn-webkit'] = {
'repositories': {'WebKit': {'acceptsPatch': true}, 'Shared': {}, 'iOS': {}},
'testProperties': {
'os': {'revision': 'iOS'},
'webkit': {'revision': 'WebKit'},
'shared': {'revision': 'Shared'},
'roots': {'roots': {}},
},
'buildProperties': {
'webkit': {'revision': 'WebKit'},
'webkit-patch': {'patch': 'WebKit'},
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
'shared': {'revision': 'Shared'},
},
'acceptsRoots': true,
};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequestWithPatch(MockModels.iphone, null, -1);
const properties = syncers[2]._propertiesForBuildRequest(request, [request]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['webkit-patch'], 'http://build.webkit.org/api/uploaded-file/453.dat');
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
assert.equal(properties['checkbox'], 'build-webkit');
assert.equal(properties['build-webkit'], true);
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
});
it('should resolve "ifBuilt"', () => {
const config = sampleiOSConfig();
config.repositoryGroups['ios-svn-webkit'] = {
'repositories': {'WebKit': {}, 'Shared': {}, 'iOS': {}},
'testProperties': {
'os': {'revision': 'iOS'},
'webkit': {'revision': 'WebKit'},
'shared': {'revision': 'Shared'},
'roots': {'roots': {}},
'test-custom-build': {'ifBuilt': [], 'value': ''},
'has-built-patch': {'ifBuilt': [], 'value': 'true'},
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
},
'acceptsRoots': true,
};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const requestToBuild = createSampleBuildRequestWithPatch(MockModels.iphone, null, -1);
const requestToTest = createSampleBuildRequestWithPatch(MockModels.iphone, MockModels.speedometer, 0);
const otherRequestToTest = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
let properties = syncers[0]._propertiesForBuildRequest(requestToTest, [requestToTest]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
assert.equal(properties['test-custom-build'], undefined);
assert.equal(properties['has-built-patch'], undefined);
properties = syncers[0]._propertiesForBuildRequest(requestToTest, [requestToBuild, requestToTest]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
assert.equal(properties['test-custom-build'], '');
assert.equal(properties['has-built-patch'], 'true');
properties = syncers[0]._propertiesForBuildRequest(otherRequestToTest, [requestToBuild, otherRequestToTest, requestToTest]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['roots'], undefined);
assert.equal(properties['test-custom-build'], undefined);
assert.equal(properties['has-built-patch'], undefined);
});
it('should set the value for "ifBuilt" if the repository in the list appears', () => {
const config = sampleiOSConfig();
config.repositoryGroups['ios-svn-webkit'] = {
'repositories': {'WebKit': {'acceptsPatch': true}, 'Shared': {}, 'iOS': {}},
'testProperties': {
'os': {'revision': 'iOS'},
'webkit': {'revision': 'WebKit'},
'shared': {'revision': 'Shared'},
'roots': {'roots': {}},
'checkbox': {'ifBuilt': ['WebKit'], 'value': 'test-webkit'},
'test-webkit': {'ifBuilt': ['WebKit'], 'value': true}
},
'buildProperties': {
'webkit': {'revision': 'WebKit'},
'webkit-patch': {'patch': 'WebKit'},
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
'shared': {'revision': 'Shared'},
},
'acceptsRoots': true,
};
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
const requestToBuild = createSampleBuildRequestWithPatch(MockModels.iphone, null, -1);
const requestToTest = createSampleBuildRequestWithPatch(MockModels.iphone, MockModels.speedometer, 0);
const properties = syncers[0]._propertiesForBuildRequest(requestToTest, [requestToBuild, requestToTest]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
assert.equal(properties['checkbox'], 'test-webkit');
assert.equal(properties['test-webkit'], true);
});
it('should not set the value for "ifBuilt" if no build for the repository in the list appears', () => {
const config = sampleiOSConfig();
config.repositoryGroups['ios-svn-webkit-with-owned-commit'] = {
'repositories': {'WebKit': {'acceptsPatch': true}, 'Owner Repository': {}, 'iOS': {}},
'testProperties': {
'os': {'revision': 'iOS'},
'webkit': {'revision': 'WebKit'},
'owner-repo': {'revision': 'Owner Repository'},
'roots': {'roots': {}},
'checkbox': {'ifBuilt': ['WebKit'], 'value': 'test-webkit'},
'test-webkit': {'ifBuilt': ['WebKit'], 'value': true}
},
'buildProperties': {
'webkit': {'revision': 'WebKit'},
'webkit-patch': {'patch': 'WebKit'},
'owner-repo': {'revision': 'Owner Repository'},
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
'owned-commits': {'ownedRevisions': 'Owner Repository'}
},
'acceptsRoots': true,
};
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
const requestToBuild = createSampleBuildRequestWithOwnedCommit(MockModels.iphone, null, -1);
const requestToTest = createSampleBuildRequestWithOwnedCommit(MockModels.iphone, MockModels.speedometer, 0);
const properties = syncers[0]._propertiesForBuildRequest(requestToTest, [requestToBuild, requestToTest]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
assert.equal(properties['checkbox'], undefined);
assert.equal(properties['test-webkit'], undefined);
});
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
it('should resolve "ifRepositorySet" and "requiresBuild"', () => {
const config = sampleiOSConfig();
config.repositoryGroups['ios-svn-webkit-with-owned-commit'] = {
'repositories': {'WebKit': {'acceptsPatch': true}, 'Owner Repository': {}, 'iOS': {}},
'testProperties': {
'os': {'revision': 'iOS'},
'webkit': {'revision': 'WebKit'},
'owner-repo': {'revision': 'Owner Repository'},
'roots': {'roots': {}},
},
'buildProperties': {
'webkit': {'revision': 'WebKit'},
'webkit-patch': {'patch': 'WebKit'},
'owner-repo': {'revision': 'Owner Repository'},
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
'owned-commits': {'ownedRevisions': 'Owner Repository'}
},
'acceptsRoots': true,
};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
const request = createSampleBuildRequestWithOwnedCommit(MockModels.iphone, null, -1);
const properties = syncers[2]._propertiesForBuildRequest(request, [request]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['owner-repo'], 'owner-001');
assert.equal(properties['checkbox'], undefined);
assert.equal(properties['build-webkit'], undefined);
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
assert.deepEqual(JSON.parse(properties['owned-commits']), {'Owner Repository': [{revision: 'owned-002', repository: 'Owned Repository', ownerRevision: 'owner-001'}]});
});
it('should resolve "patch", "ifRepositorySet" and "requiresBuild"', () => {
const config = sampleiOSConfig();
config.repositoryGroups['ios-svn-webkit-with-owned-commit'] = {
'repositories': {'WebKit': {'acceptsPatch': true}, 'Owner Repository': {}, 'iOS': {}},
'testProperties': {
'os': {'revision': 'iOS'},
'webkit': {'revision': 'WebKit'},
'owner-repo': {'revision': 'Owner Repository'},
'roots': {'roots': {}},
},
'buildProperties': {
'webkit': {'revision': 'WebKit'},
'webkit-patch': {'patch': 'WebKit'},
'owner-repo': {'revision': 'Owner Repository'},
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
'owned-commits': {'ownedRevisions': 'Owner Repository'}
},
'acceptsRoots': true,
};
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
const request = createSampleBuildRequestWithOwnedCommitAndPatch(MockModels.iphone, null, -1);
const properties = syncers[2]._propertiesForBuildRequest(request, [request]);
assert.equal(properties['webkit'], '197463');
assert.equal(properties['owner-repo'], 'owner-001');
assert.equal(properties['checkbox'], 'build-webkit');
assert.equal(properties['build-webkit'], true);
Update syncing script to be able to build binary for commit set with owned commits. https://bugs.webkit.org/show_bug.cgi?id=177225 Reviewed by Ryosuke Niwa. Added support for syncing script to be able to schedule builds to build binary for owned commits. Introduces 'ifRepositorySet' and 'ownedRevisions' in 'buildProperties'. 'ifRepositorySet' will conditionaly set a build property if at least one of the repositories it specified requires build. 'ownedRevisions' specifies owned commits revision informations. * public/v3/models/commit-set.js: (CommitSet): Added '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype.updateSingleton): Reset '_ownerRepositoryToOwnedRepositoriesMap'. (CommitSet.prototype._updateFromObject): Only update '_repositoryToCommitOwnerMap' and '_ownerRepositoryToOwnedRepositoriesMap' when 'commitOwner' exists. (CommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. (CommitSet.prototype.ownedRepositoriesForOwnerRepository): Returns owned repositories given a owner repository. (CustomCommitSet.prototype.ownerCommitForRepository): Returns a sorted list of top level repositories. * public/v3/models/triggerable.js: (prototype.accepts): It should only check against top-level repositories. Removed a deprecated 'FIXME'. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit test for building owned commits binary. (createTriggerable): Added conditional 'ifRepositorySet' and 'ownedRevisions' in the repository groups. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype._propertiesForBuildRequest): Added logic to conditionaly create build property for 'ifRepositorySet'. Added logic to create 'ownedRevisions' based on the owner repositories it specified. (BuildbotSyncer._parseRepositoryGroup): Build property template should be able to handle 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/buildbot-syncer-tests.js: Added unit tests for 'ifRepositorySet' and 'ownedRevisions'. * unit-tests/commit-set-tests.js: Added unit tests for 'topLevelRepositoriesSortedByNamePreferringOnesWithURL'. * unit-tests/resources/mock-v3-models.js: Added a repository group contains 'ios', 'webkit' and 'ownerRepository'. Canonical link: https://commits.webkit.org/193932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-09-29 07:34:41 +00:00
assert.equal(properties['webkit-patch'], 'http://build.webkit.org/api/uploaded-file/453.dat');
assert.deepEqual(JSON.parse(properties['owned-commits']), {'Owner Repository': [{revision: 'owned-002', repository: 'Owned Repository', ownerRevision: 'owner-001'}]});
});
it('should allow to build with an owned component even if no repository accepts a patch in the triggerable repository group', () => {
const config = sampleiOSConfig();
config.repositoryGroups['owner-repository'] = {
'repositories': {'Owner Repository': {}},
'testProperties': {
'owner-repo': {'revision': 'Owner Repository'},
'roots': {'roots': {}},
},
'buildProperties': {
'owned-commits': {'ownedRevisions': 'Owner Repository'}
},
'acceptsRoots': true,
};
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
const owner111289 = CommitLog.ensureSingleton('111289', {'id': '111289', 'time': 1456931874000, 'repository': MockModels.ownerRepository, 'revision': 'owner-001'});
const owned111222 = CommitLog.ensureSingleton('111222', {'id': '111222', 'time': 1456932774000, 'repository': MockModels.ownedRepository, 'revision': 'owned-002'});
const commitSet = CommitSet.ensureSingleton('53246486', {customRoots: [], revisionItems: [{commit: owner111289}, {commit: owned111222, commitOwner: owner111289, requiresBuild: true}]});
const request = BuildRequest.ensureSingleton(`123123`, {'triggerable': MockModels.triggerable,
repositoryGroup: MockModels.ownerRepositoryGroup,
'commitSet': commitSet, 'status': 'pending', 'platform': MockModels.iphone, 'test': null, 'order': -1});
const properties = syncers[2]._propertiesForBuildRequest(request, [request]);
assert.deepEqual(JSON.parse(properties['owned-commits']), {'Owner Repository': [{revision: 'owned-002', repository: 'Owned Repository', ownerRevision: 'owner-001'}]});
});
it('should fail if build type build request does not have any build repository group template', () => {
const config = sampleiOSConfig();
config.repositoryGroups['owner-repository'] = {
'repositories': {'Owner Repository': {}},
'testProperties': {
'owner-repo': {'revision': 'Owner Repository'},
'roots': {'roots': {}},
},
'acceptsRoots': true,
};
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
const owner1 = CommitLog.ensureSingleton('111289', {'id': '111289', 'time': 1456931874000, 'repository': MockModels.ownerRepository, 'revision': 'owner-001'});
const owned2 = CommitLog.ensureSingleton('111222', {'id': '111222', 'time': 1456932774000, 'repository': MockModels.ownedRepository, 'revision': 'owned-002'});
const commitSet = CommitSet.ensureSingleton('53246486', {customRoots: [], revisionItems: [{commit: owner1}, {commit: owned2, commitOwner: owner1, requiresBuild: true}]});
const request = BuildRequest.ensureSingleton(`123123`, {'triggerable': MockModels.triggerable,
repositoryGroup: MockModels.ownerRepositoryGroup,
'commitSet': commitSet, 'status': 'pending', 'platform': MockModels.iphone, 'test': null, 'order': -1});
assert.throws(() => syncers[2]._propertiesForBuildRequest(request, [request]),
(error) => error.code === 'ERR_ASSERTION');
});
it('should set the property for the build request id', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
const properties = syncers[0]._propertiesForBuildRequest(request, [request]);
assert.equal(properties['build_request_id'], request.id());
Add a model for parsing buildbot JSON with unit tests https://bugs.webkit.org/show_bug.cgi?id=155814 Reviewed by Joseph Pecoraro. Added BuildbotSyncer and BuildbotBuildEntry classes to parse buildbot JSON files with unit tests. They will be used in the new syncing scripts to improve A/B testing. * public/v3/models/build-request.js: (BuildRequest): * tools/js/buildbot-syncer.js: Added. (BuildbotBuildEntry): Added. (BuildbotBuildEntry.prototype.slaveName): Added. (BuildbotBuildEntry.prototype.buildRequestId): Added. (BuildbotBuildEntry.prototype.isInProgress): Added. (BuildbotSyncer): Added. (BuildbotSyncer.prototype.testPath): Added. (BuildbotSyncer.prototype.builderName): Added. (BuildbotSyncer.prototype.platformName): Added. (BuildbotSyncer.prototype.fetchPendingRequests): Added. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added. (BuildbotSyncer.prototype._revisionSetFromRootSetWithExclusionList): Added. (BuildbotSyncer._loadConfig): Added. (BuildbotSyncer._validateAndMergeConfig): Added. (BuildbotSyncer._validateAndMergeProperties): Added. * tools/js/v3-models.js: Copied from unit-tests/resources/v3-models.js. (beforeEach): Deleted since this only defined inside mocha. * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: Added. (sampleiOSConfig): (createSampleBuildRequest): (.smallConfiguration): * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Renamed from unit-tests/resources/v3-models.js. (beforeEach): * unit-tests/test-groups-tests.js: (sampleTestGroup): Canonical link: https://commits.webkit.org/173929@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-24 03:25:10 +00:00
});
});
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
describe('BuildbotBuildEntry', () => {
it('should create BuildbotBuildEntry for pending build', () => {
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
const buildbotData = samplePendingBuildRequests();
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
const pendingEntries = buildbotData.buildrequests.map((entry) => new BuildbotBuildEntry(syncer, entry));
assert.equal(pendingEntries.length, 1);
const entry = pendingEntries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.ok(!entry.buildTag());
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
assert.ok(!entry.workerName());
assert.equal(entry.buildRequestId(), 16733);
assert.ok(entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
assert.equal(entry.statusDescription(), null);
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
});
it('should create BuildbotBuildEntry for in-progress build', () => {
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
const buildbotData = sampleInProgressBuild();
const entries = buildbotData.builds.map((entry) => new BuildbotBuildEntry(syncer, entry));
assert.equal(entries.length, 1);
const entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 614);
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
assert.equal(entry.workerName(), 'ABTest-iPad-0');
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
assert.equal(entry.statusDescription(), 'building');
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
});
it('should create BuildbotBuildEntry for finished build', () => {
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
const buildbotData = sampleFinishedBuild();
const entries = buildbotData.builds.map((entry) => new BuildbotBuildEntry(syncer, entry));
assert.deepEqual(entries.length, 1);
const entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 1755);
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
assert.equal(entry.workerName(), 'ABTest-iPad-0');
assert.equal(entry.buildRequestId(), 18935);
assert.ok(!entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
assert.equal(entry.statusDescription(), null);
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
});
it('should create BuildbotBuildEntry for mix of in-progress and finished builds', () => {
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
const buildbotData = {'builds': [sampleInProgressBuildData(), sampleFinishedBuildData()]};
const entries = buildbotData.builds.map((entry) => new BuildbotBuildEntry(syncer, entry));
assert.deepEqual(entries.length, 2);
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 614);
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
assert.equal(entry.workerName(), 'ABTest-iPad-0');
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
assert.equal(entry.statusDescription(), 'building');
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
entry = entries[1];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 1755);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
assert.equal(entry.buildRequestId(), 18935);
assert.ok(!entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
Provide build request status description information on dashboard. https://bugs.webkit.org/show_bug.cgi?id=199810 Reviewed by Ryosuke Niwa. Add build request status description to show detailed information for a build and show it in dashboard. Update SQL for existing instance: ALTER TABLE build_requests ADD COLUMN IF NOT EXISTS request_status_description varchar(1024) DEFAULT NULL; * ReadMe.md: Updated instructions for initializing a database to include running 'migrate-database.sql'. * init-database.sql: Added request_status_description column. * migrate-database.sql: A file stores migration SQL for existing instance. * public/api/build-requests.php: Added support for updating request_status_description. * public/include/build-requests-fetcher.php: Exposed `statusDescription` to API. * public/v3/components/test-group-revision-table.js: Added UI for showing build request status detail. (TestGroupRevisionTable.prototype._renderTable): (TestGroupRevisionTable.prototype._buildDescriptionCell): (TestGroupRevisionTable.cssTemplate): * public/v3/components/warning-icon.js: Extended warning icon to be able to customize information on hover. (WarningIcon): (WarningIcon.prototype.render): * public/v3/components/button-base.js: Added a instance method to set button title. (ButtonBase.prototype.setButtonTitle): * public/v3/models/build-request.js: Added 'statusDescription' field. (BuildRequest): (BuildRequest.prototype.updateSingleton): (BuildRequest.prototype.statusDescription): * server-tests/api-build-requests-tests.js: Fixed unit tests. * server-tests/resources/mock-data.js: (MockData.set mockTestSyncConfigWithSingleBuilder): Added 'status_description' in buildbot mock data. (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.initDatabase): Added code to execute 'migrate-database.sql' on initialization. * server-tests/tools-sync-buildbot-integration-tests.js: Added unit tests. * tools/js/buildbot-syncer.js: Added 'statusDescription' field to 'BuildbotBuildEntry'. (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.statusDescription): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): * unit-tests/buildbot-syncer-tests.js: Added test code for BuildbotBuildEntry.statusDescription. Canonical link: https://commits.webkit.org/215881@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-27 22:45:12 +00:00
assert.equal(entry.statusDescription(), null);
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format https://bugs.webkit.org/show_bug.cgi?id=182036 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format. (BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format. (BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format. (BuildbotSyncer.prototype.builderID): Added. (BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON. (BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber. (BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format. (BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page. * unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated. (sampleBuildData): Sample build data. Common method for in-progress and finished build data. (samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds. (sampleInProgressBuildData): Ditto for in-progress build. (sampleFinishedBuildData): Ditto for finished build. (samplePendingBuild): Sample data for single pending build. (sampleInProgressBuild): Ditto for in-progress build. (sampleFinishedBuild): Ditto for finished build. (samplePendingBuildDeprecated): Renamed from samplePendingBuild. (sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild. (sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build. (BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build. Canonical link: https://commits.webkit.org/198214@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-02 07:06:19 +00:00
});
});
describe('_pullRecentBuilds()', () => {
it('should not fetch recent builds when count is zero', async () => {
const syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
const promise = syncer._pullRecentBuilds(0);
assert.equal(requests.length, 0);
const content = await promise;
assert.deepEqual(content, []);
});
it('should pull the right number of recent builds', () => {
const syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
syncer._pullRecentBuilds(12);
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/builders/102/builds?limit=12&order=-number&property=*');
});
it('should handle unexpected error while fetching recent builds', async () => {
const syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
const promise = syncer._pullRecentBuilds(2);
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/builders/102/builds?limit=2&order=-number&property=*');
requests[0].resolve({'error': 'Unexpected error'});
const content = await promise;
assert.deepEqual(content, []);
});
it('should create BuildbotBuildEntry after fetching recent builds', async () => {
const syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
const promise = syncer._pullRecentBuilds(2);
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/builders/102/builds?limit=2&order=-number&property=*');
requests[0].resolve({'builds': [sampleFinishedBuildData(), sampleInProgressBuildData()]});
const entries = await promise;
assert.deepEqual(entries.length, 2);
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 1755);
assert.equal(entry.workerName(), 'ABTest-iPad-0');
assert.equal(entry.buildRequestId(), 18935);
assert.ok(!entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
entry = entries[1];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 614);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
});
});
describe('pullBuildbot', () => {
it('should fetch pending builds from the right URL', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(syncer.builderName(), 'ABTest-iPad-RunBenchmark-Tests');
let expectedURL = '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*';
assert.equal(syncer.pathForPendingBuilds(), expectedURL);
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
syncer.pullBuildbot();
assert.equal(requests.length, 1);
assert.equal(requests[0].url, expectedURL);
});
it('should fetch recent builds once pending builds have been fetched', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(syncer.builderName(), 'ABTest-iPad-RunBenchmark-Tests');
syncer.pullBuildbot(1);
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
requests[0].resolve([]);
return MockRemoteAPI.waitForRequest().then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(requests.length, 2);
assert.equal(requests[1].url, '/api/v2/builders/102/builds?limit=1&order=-number&property=*');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
it('should fetch the right number of recent builds', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
syncer.pullBuildbot(3);
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
requests[0].resolve([]);
return MockRemoteAPI.waitForRequest().then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(requests.length, 2);
assert.equal(requests[1].url, '/api/v2/builders/102/builds?limit=3&order=-number&property=*');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
it('should create BuildbotBuildEntry for pending builds', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
let promise = syncer.pullBuildbot();
requests[0].resolve(samplePendingBuildRequests());
return promise.then((entries) => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entries.length, 1);
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.ok(!entry.buildTag());
[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.ok(!entry.workerName());
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 16733);
assert.ok(entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
it('should create BuildbotBuildEntry for in-progress builds', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
let promise = syncer.pullBuildbot(1);
assert.equal(requests.length, 1);
requests[0].resolve([]);
return MockRemoteAPI.waitForRequest().then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(requests.length, 2);
requests[1].resolve(sampleInProgressBuild());
return promise;
}).then((entries) => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entries.length, 1);
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 614);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
it('should create BuildbotBuildEntry for finished builds', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
let promise = syncer.pullBuildbot(1);
assert.equal(requests.length, 1);
requests[0].resolve([]);
return MockRemoteAPI.waitForRequest().then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(requests.length, 2);
requests[1].resolve(sampleFinishedBuild());
return promise;
}).then((entries) => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.deepEqual(entries.length, 1);
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 1755);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 18935);
assert.ok(!entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
it('should create BuildbotBuildEntry for mixed pending, in-progress, finished, and missing builds', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
let promise = syncer.pullBuildbot(5);
assert.equal(requests.length, 1);
requests[0].resolve(samplePendingBuildRequests(123));
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
return MockRemoteAPI.waitForRequest().then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(requests.length, 2);
requests[1].resolve({'builds': [sampleFinishedBuildData(), sampleInProgressBuildData()]});
return promise;
}).then((entries) => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.deepEqual(entries.length, 3);
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), null);
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
assert.equal(entry.workerName(), null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entry.buildRequestId(), 123);
assert.ok(entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
entry = entries[1];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 614);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
entry = entries[2];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 1755);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entry.buildRequestId(), 18935);
assert.ok(!entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
});
it('should sort BuildbotBuildEntry by order', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
let promise = syncer.pullBuildbot(5);
assert.equal(requests.length, 1);
requests[0].resolve({"buildrequests": [samplePendingBuildRequestData(456, 2), samplePendingBuildRequestData(123, 1)]});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
return MockRemoteAPI.waitForRequest().then(() => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 2);
requests[1].resolve({'builds': [sampleFinishedBuildData(), sampleInProgressBuildData()]});
return promise;
}).then((entries) => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.deepEqual(entries.length, 4);
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), null);
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
assert.equal(entry.workerName(), null);
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 123);
assert.ok(entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
entry = entries[1];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), null);
[perf dashboard] Remove non-inclusive words from perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=223505 Reviewed by Ryosuke Niwa. Removed most of non-inclusive terminology and replaced it with 'worker'. Make impacted APIs backward compatible during transition. The non-inclusive terminology will be removed after transition. * ReadMe.md: Removed non-inclusive words. * init-database.sql: Rename tables with non-inclusive words. * migrate-database.sql: Added migration SQL for existing database. * public/admin/build-workers.php: Renamed from Websites/perf.webkit.org/public/admin/build-slaves.php. * public/api/build-requests.php: * public/api/measurement-set.php: * public/api/report-commits.php: * public/api/runs.php: * public/api/update-triggerable.php: * public/api/upload-root.php: * public/include/admin-header.php: * public/include/json-header.php: * public/include/report-processor.php: * public/privileged-api/add-build-requests.php: * public/privileged-api/create-analysis-task.php: * public/privileged-api/create-test-group.php: * public/privileged-api/update-test-group.php: * public/v2/js/ember.js: * server-tests/api-build-requests-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-report-commits-tests.js: * server-tests/api-report-tests.js: (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptyWorkerReport): (emptySlaveReport): Deleted. * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (updateWithOSXRepositoryGroup): (updateWithMacWebKitRepositoryGroups): * server-tests/api-upload-root-tests.js: (makeReport): (addWorkerAndCreateRootFile): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): (async addTriggerableAndCreateTask): * server-tests/resources/common-operations.js: * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.set mockTestSyncConfigWithSingleBuilder): (MockData.sampleBuildData): * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): * server-tests/tools-buildbot-triggerable-tests.js: * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (createTriggerable): * tools/detect-changes.js: (loadServerConfig): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.buildTag): (BuildbotSyncer): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): (BuildbotSyncer.prototype.pullBuildbot): (BuildbotSyncer._loadConfig): (BuildbotSyncer._validateAndMergeConfig): (BuildbotBuildEntry.prototype.slaveName): Deleted. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable): (BuildbotTriggerable.prototype.updateTriggerable): (BuildbotTriggerable.prototype.async syncOnce): (BuildbotTriggerable.prototype.async _scheduleRequest): (BuildbotTriggerable.prototype._scheduleRequestIfWorkerIsAvailable): (BuildbotTriggerable.prototype._scheduleRequestWithLog): (BuildbotTriggerable._testGroupMapForBuildRequests): (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Deleted. * tools/js/database.js: * tools/js/os-build-fetcher.js: (prototype.async _reportCommits): * tools/js/privileged-api.js: (NodePrivilegedAPI.prototype.sendRequest): (NodePrivilegedAPI.configure): (NodePrivilegedAPI): * tools/pull-os-versions.py: (OSBuildFetcher.fetch_and_report_new_builds): * tools/run-analysis.js: (async analysisLoop): * tools/sync-buildbot.js: (syncLoop.const.makeTriggerable): (syncLoop): * tools/sync-commits.py: (Repository.fetch_commits_and_submit): * tools/sync-os-versions.js: (syncLoop): * tools/util.py: (submit_commits): * unit-tests/analysis-task-tests.js: * unit-tests/buildbot-syncer-tests.js: (sampleiOSConfig): (sampleBuildData): (async const): * unit-tests/checkconfig.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/privileged-api-tests.js: * unit-tests/retry-failed-build-requests-tests.js: * unit-tests/test-groups-tests.js: Canonical link: https://commits.webkit.org/235601@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-22 21:23:38 +00:00
assert.equal(entry.workerName(), null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entry.buildRequestId(), 456);
assert.ok(entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
entry = entries[2];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 614);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
entry = entries[3];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 1755);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 18935);
assert.ok(!entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
it('should override BuildbotBuildEntry for pending builds by in-progress builds', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
let promise = syncer.pullBuildbot(5);
assert.equal(requests.length, 1);
requests[0].resolve(samplePendingBuildRequests());
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
return MockRemoteAPI.waitForRequest().then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(requests.length, 2);
requests[1].resolve(sampleInProgressBuild());
return promise;
}).then((entries) => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entries.length, 1);
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 614);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(entry.isInProgress());
assert.ok(!entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
it('should override BuildbotBuildEntry for pending builds by finished builds', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
let promise = syncer.pullBuildbot(5);
assert.equal(requests.length, 1);
requests[0].resolve(samplePendingBuildRequests());
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
return MockRemoteAPI.waitForRequest().then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(requests.length, 2);
requests[1].resolve(sampleFinishedBuild(16733));
return promise;
}).then((entries) => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(entries.length, 1);
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
let entry = entries[0];
assert.ok(entry instanceof BuildbotBuildEntry);
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.equal(entry.buildTag(), 1755);
[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.equal(entry.workerName(), 'ABTest-iPad-0');
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
assert.equal(entry.buildRequestId(), 16733);
assert.ok(!entry.isPending());
assert.ok(!entry.isInProgress());
assert.ok(entry.hasFinished());
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
});
describe('scheduleBuildOnBuildbot', () => {
it('should schedule a build request on Buildbot', async () => {
const syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[0];
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
const properties = syncer._propertiesForBuildRequest(request, [request]);
const promise = syncer.scheduleBuildOnBuildbot(properties);
assert.equal(requests.length, 1);
assert.equal(requests[0].method, 'POST');
assert.equal(requests[0].url, '/api/v2/forceschedulers/ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
requests[0].resolve();
await promise;
assert.deepEqual(requests[0].data, {
'id': '16733-' + MockModels.iphone.id(),
'jsonrpc': '2.0',
'method': 'force',
'params': {
'build_request_id': '16733-' + MockModels.iphone.id(),
'desired_image': '13A452',
'opensource': '197463',
'forcescheduler': 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler',
'test_name': 'speedometer'
}
});
});
});
describe('scheduleRequest', () => {
[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 schedule a build request on a specified worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[0];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
const waitForRequest = MockRemoteAPI.waitForRequest();
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
[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
syncer.scheduleRequest(request, [request], 'some-worker');
return waitForRequest.then(() => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/forceschedulers/ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests[0].method, 'POST');
assert.deepEqual(requests[0].data, {
'id': '16733-' + MockModels.iphone.id(),
'jsonrpc': '2.0',
'method': 'force',
'params': {
'build_request_id': '16733-' + MockModels.iphone.id(),
'desired_image': '13A452',
'opensource': '197463',
'forcescheduler': 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler',
[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': 'some-worker',
'test_name': 'speedometer'
}
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
});
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
});
});
describe('scheduleRequestInGroupIfAvailable', () => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
function pullBuildbotWithAssertion(syncer, pendingBuilds, inProgressAndFinishedBuilds)
{
const promise = syncer.pullBuildbot(5);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
requests[0].resolve(pendingBuilds);
return MockRemoteAPI.waitForRequest().then(() => {
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 2);
requests[1].resolve(inProgressAndFinishedBuilds);
requests.length = 0;
return promise;
});
}
[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 schedule a build if builder has no builds if workerList is not specified', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
syncer.scheduleRequestInGroupIfAvailable(request, [request]);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/forceschedulers/some-builder-ForceScheduler');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests[0].method, 'POST');
assert.deepEqual(requests[0].data, {id: '16733-' + MockModels.somePlatform.id(), 'jsonrpc': '2.0', 'method': 'force',
'params': {id: '16733-' + MockModels.somePlatform.id(), 'forcescheduler': 'some-builder-ForceScheduler', 'os': '13A452', 'wk': '197463'}});
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 schedule a build if builder only has finished builds if workerList is not specified', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
return pullBuildbotWithAssertion(syncer, {}, smallFinishedBuild()).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
syncer.scheduleRequestInGroupIfAvailable(request, [request]);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/forceschedulers/some-builder-ForceScheduler');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests[0].method, 'POST');
assert.deepEqual(requests[0].data, {id: '16733-' + MockModels.somePlatform.id(), 'jsonrpc': '2.0', 'method': 'force',
'params': {id: '16733-' + MockModels.somePlatform.id(), 'forcescheduler': 'some-builder-ForceScheduler', 'os': '13A452', 'wk': '197463'}});
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 not schedule a build if builder has a pending build if workerList is not specified', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
return pullBuildbotWithAssertion(syncer, smallPendingBuild(), {}).then(() => {
Make sync-buildbot.js fault safe https://bugs.webkit.org/show_bug.cgi?id=156498 Reviewed by Chris Dumez. Fixed a bug that sync-buildbot.js will continue to schedule build requests from multiple test groups if multiple test groups are simultaneously in-progress on the same builder. Also fixed a bug that if a build request had failed without leaving a trace (i.e. no entry on any of the builders we know of), sync-buildbot.js throws an exception. * server-tests/tools-buildbot-triggerable-tests.js: Added test cases. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Renamed. Optionally takes the slave name. When this parameter is specified, schedule the request only if the specified slave is available. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Always use scheduleRequestInGroupIfAvailable to schedule a new build request. Using scheduleRequest for non-first build requests was problematic when there were multiple test groups with pending requests because then we would schedule those pending requests without checking whether there is already a pending job or if we have previously scheduled a job. Also fallback to use any syncer / builder when groupInfo.syncer is not set even if the next request was not the first one in the test group since we can't determine on which builder preceding requests are processed in such cases. * unit-tests/buildbot-syncer-tests.js: Canonical link: https://commits.webkit.org/174622@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-12 21:04:09 +00:00
syncer.scheduleRequestInGroupIfAvailable(createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest));
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 0);
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 schedule a build if builder does not have pending or completed builds on the matching worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[0];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/forceschedulers/ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests[0].method, 'POST');
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 schedule a build if builder only has finished builds on the matching worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
pullBuildbotWithAssertion(syncer, {}, sampleFinishedBuild()).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
assert.equal(requests[0].url, '/api/v2/forceschedulers/ABTest-iPad-RunBenchmark-Tests-ForceScheduler');
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests[0].method, 'POST');
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 not schedule a build if builder has a pending build on the maching worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
pullBuildbotWithAssertion(syncer, samplePendingBuildRequests(), {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 0);
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 schedule a build if builder only has a pending build on a non-maching worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 pullBuildbotWithAssertion(syncer, samplePendingBuildRequests(1, 1, 'another-worker'), {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 schedule a build if builder only has an in-progress build on the matching worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
return pullBuildbotWithAssertion(syncer, {}, sampleInProgressBuild()).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 schedule a build if builder has an in-progress build on another worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +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 pullBuildbotWithAssertion(syncer, {}, sampleInProgressBuild('other-worker')).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 1);
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
});
it('should not schedule a build if the request does not match any configuration', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[0];
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
assert.equal(requests.length, 0);
});
New buildbot syncing scripts that supports multiple builders and slaves https://bugs.webkit.org/show_bug.cgi?id=156269 Reviewed by Chris Dumez. Add sync-buildbot.js that supports scheduling A/B testing jobs on multiple builders and slaves. The old python script (sync-with-buildbot.py) could only support a single builder and slave for each platform, test pair. The main logic is implemented in BuildbotTriggerable.syncOnce. Various helper methods are added throughout the codebase and tests have been refactored. BuildbotSyncer has been updated to support multiple platform, test pairs. It's now responsible for syncing everything on each builder (on a buildbot). Added more unit tests for BuildbotSyncer and server tests for BuildbotTriggerable, and refactored test helpers and mocks as needed. * public/v3/models/build-request.js: (BuildRequest.prototype.status): Added. (BuildRequest.prototype.isScheduled): Added. * public/v3/models/metric.js: (Metric.prototype.fullName): Added. * public/v3/models/platform.js: (Platform): Added the map based on platform name. (Platform.findByName): Added. * public/v3/models/test.js: (Test.topLevelTests): (Test.findByPath): Added. Finds a test based on an array of test names; e.g. ['A', 'B'] would find the test whose name is "B" which has a parent test named "A". (Test.prototype.fullName): Added. * server-tests/api-build-requests-tests.js: (addMockData): Moved to resources/mock-data.js. (addAnotherMockTestGroup): Ditto. * server-tests/resources/mock-data.js: Added. (MockData.resetV3Models): Added. (MockData.addMockData): Moved from api-build-requests-tests.js. (MockData.addAnotherMockTestGroup): Ditto. (MockData.mockTestSyncConfigWithSingleBuilder): Added. (MockData.mockTestSyncConfigWithTwoBuilders): Added. (MockData.pendingBuild): Added. (MockData.runningBuild): Added. (MockData.finishedBuild): Added. * server-tests/resources/test-server.js: (TestServer): (TestServer.prototype.remoteAPI): (TestServer.prototype._ensureTestDatabase): Don't fail even if the test database doesn't exit. (TestServer.prototype._startApache): Create a RemoteAPI instance to access the test sever. (TestServer.prototype._waitForPid): Increase the timeout. (TestServer.prototype.inject): Replace global.RemoteAPI during the test and restore it afterwards. * server-tests/tools-buildbot-triggerable-tests.js: Added. Tests BuildbotTriggerable.syncOnce. (MockLogger): Added. (MockLogger.prototype.log): Added. (MockLogger.prototype.error): Added. * tools/detect-changes.js: (parseArgument): Moved to js/parse-arguments.js. * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): (BuildbotBuildEntry.prototype.syncer): Added. (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): Added. Returns a new status for a build request (of the matching build request ID) if it needs to be updated in the server. (BuildbotSyncer): This class (BuildbotSyncer.prototype.addTestConfiguration): Added. (BuildbotSyncer.prototype.testConfigurations): Returns the list of test configurations. (BuildbotSyncer.prototype.matchesConfiguration): Returns true iff the request can be scheduled on this builder. (BuildbotSyncer.prototype.scheduleRequest): Added. Schedules a new job on buildbot for a request. (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Added. Schedules a new job for the specified build request on the first slave that's available. (BuildbotSyncer.prototype.pullBuildbot): Return a list of BuildbotBuildEntry instead of an object. Also store it on an instance variable so that scheduleFirstRequestInGroupIfAvailable could use it. (BuildbotSyncer.prototype._pullRecentBuilds): (BuildbotSyncer.prototype.pathForPendingBuildsJSON): Renamed from urlForPendingBuildsJSON and now only returns the path instead of the full URL since RemoteAPI takes a path, not full URL. (BuildbotSyncer.prototype.pathForBuildJSON): Ditto from pathForBuildJSON. (BuildbotSyncer.prototype.pathForForceBuild): Added. (BuildbotSyncer.prototype.url): Use RemoteAPI's url method instead of manually constructing URL. (BuildbotSyncer.prototype.urlForBuildNumber): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Now that each syncer can have multiple test configurations associated with it, find the one matching for this request. (BuildbotSyncer._loadConfig): Create a syncer per builder and add all test configurations to it. (BuildbotSyncer._validateAndMergeConfig): Added the support for 'SlaveList', which is a list of slave names present on this builder. * tools/js/buildbot-triggerable.js: Added. (BuildbotTriggerable): Added. (BuildbotTriggerable.prototype.name): Added. (BuildbotTriggerable.prototype.syncOnce): Added. The main logic for the syncing script. It pulls existing build requests from the perf dashboard, pulls buildbot for pending and running/completed builds on each builder (represented by each syncer), schedules build requests on buildbot if there is any builder/slave available, and updates the status of build requests in the database. (BuildbotTriggerable.prototype._validateRequests): Added. (BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added. (BuildbotTriggerable.prototype._scheduleNextRequestInGroupIfSlaveIsAvailable): Added. (BuildbotTriggerable._testGroupMapForBuildRequests): Added. * tools/js/database.js: * tools/js/parse-arguments.js: Added. Extracted out of tools/detect-changes.js. (parseArguments): * tools/js/remote.js: (RemoteAPI): Now optionally takes the server configuration. (RemoteAPI.prototype.url): Added. (RemoteAPI.prototype.getJSON): Removed the code for specifying request content. (RemoteAPI.prototype.getJSONWithStatus): Ditto. (RemoteAPI.prototype.postJSON): Added. (RemoteAPI.prototype.postFormUrlencodedData): Added. (RemoteAPI.prototype.sendHttpRequest): Fixed the code to specify auth. * tools/js/v3-models.js: Don't include RemoteAPI here as they require a configuration for each host. * tools/sync-buildbot.js: Added. (main): Added. Parse the arguments and start the loop. (syncLoop): Added. * unit-tests/buildbot-syncer-tests.js: Added tests for pullBuildbot, scheduleRequest, as well as scheduleFirstRequestInGroupIfAvailable. Refactored helper functions as needed. (sampleiOSConfig): (smallConfiguration): Added. (smallPendingBuild): Added. (smallInProgressBuild): Added. (smallFinishedBuild): Added. (createSampleBuildRequest): Create a unique build request for each platform. (samplePendingBuild): Optionally specify build time and slave name. (sampleInProgressBuild): Optionally specify slave name. (sampleFinishedBuild): Ditto. * unit-tests/resources/mock-remote-api.js: (assert.notReached.assert.notReached): (MockRemoteAPI.url): Added. (MockRemoteAPI.postFormUrlencodedData): Added. (MockRemoteAPI._addRequest): Extracted from getJSONWithStatus. (MockRemoteAPI.waitForRequest): Extracted from inject. For tools-buildbot-triggerable-tests.js, we need to instantiate a RemoteAPI for buildbot without replacing global.RemoteAPI. (MockRemoteAPI.inject): (MockRemoteAPI.reset): Added. Canonical link: https://commits.webkit.org/174395@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-06 23:19:29 +00:00
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +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 not schedule a build if a new request had been submitted to the same worker', (done) => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
let request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequest(request, [request], 'ABTest-iPad-0');
request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequest(request, [request], 'ABTest-iPad-1');
}).then(() => {
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
assert.equal(requests.length, 2);
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
}).then(() => {
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
assert.equal(requests.length, 2);
done();
}).catch(done);
});
[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 schedule a build if a new request had been submitted to another worker', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
let request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
syncer.scheduleRequest(request, [request], 'ABTest-iPad-0');
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
assert.equal(requests.length, 1);
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer)
syncer.scheduleRequestInGroupIfAvailable(request, [request], 'ABTest-iPad-1');
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
assert.equal(requests.length, 2);
});
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +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 not schedule a build if a new request had been submitted to the same builder without workerList', () => {
Add support for builderNameToIDMap in BuildbotSyncer https://bugs.webkit.org/show_bug.cgi?id=176526 Reviewed by Ryosuke Niwa. * tools/js/buildbot-syncer.js: (BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on. (BuildbotSyncer._resolveBuildersWithPlatforms): Ditto. (BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9. (BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8. (BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap. * unit-tests/buildbot-syncer-tests.js: Updated unit-tests. * server-tests/resources/mock-data.js: (MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list. (MockData.buildbotBuildersURL): Ditto for Buildbot 0.9 (MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8 (MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9 * server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle newly added promise for fetching builders list from Buildbot. * server-tests/tools-sync-buildbot-integration-tests.js: Ditto. Canonical link: https://commits.webkit.org/197660@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-01-19 05:42:39 +00:00
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
let request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
syncer.scheduleRequest(request, [request], null);
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
assert.equal(requests.length, 1);
Allow sync-buildbot.js to set a buildbot property only when patches are built https://bugs.webkit.org/show_bug.cgi?id=172743 Rubber-stamped by Chris Dumez. Added the ability to specify a buildbot property only when there are build requests to build a patch. * tools/js/buildbot-syncer.js: (BuildbotSyncer.prototype.scheduleRequest): Pass in the list of build requests that belong to the same test group. (BuildbotSyncer.prototype.scheduleRequestInGroupIfAvailable): Ditto. (BuildbotSyncer.prototype._propertiesForBuildRequest): Added the support for specifying a conditional property. For the condition type of "built", we check if there was any other (BuildbotSyncer._parseRepositoryGroup): Added the support for "ifBuilt" conditional. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._scheduleRequestIfSlaveIsAvailable): Pass in the list of build requests that belong to the same test group. (BuildbotTriggerable.prototype._scheduleRequestWithLog): Ditto. * unit-tests/buildbot-syncer-tests.js: Added test case for newly added "ifBuilt" as well as specifying a patch. Updated the various test cases per the addition of new argument to scheduleRequest, _propertiesForBuildRequest, and scheduleRequestInGroupIfAvailable. (createSampleBuildRequestWithPatch): Added. * unit-tests/resources/mock-v3-models.js: (MockModels.inject): Made "ios-svn-webkit" accept a WebKit patch and roots to allow new testing. Canonical link: https://commits.webkit.org/189670@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-05-31 20:24:59 +00:00
request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
assert.equal(requests.length, 1);
});
A/B testing bots should prioritize user created test groups https://bugs.webkit.org/show_bug.cgi?id=156375 Reviewed by Chris Dumez. Order build requests preferring user created ones over ones automatically created by detect-changes.js. Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new build request on a builder/slave even when we had previously scheduled another build request. * public/include/build-requests-fetcher.php: (BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js. Since we're using ascending order, this would put user created test groups first. * server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case for testing that build requests for an user created test group shows up first. * server-tests/resources/mock-data.js: (MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name. * server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests for an user created test group shows up first. * tools/js/buildbot-syncer.js: (BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already scheduled new build requests. Don't schedule more requests on these slaves. (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null when slaveList is not specified) to _slavesWithNewRequests. (BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request we have previously scheduled should be included in one of the entires now. * unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug. (sampleiOSConfig): Added a second slave for new test cases. Canonical link: https://commits.webkit.org/174479@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-08 03:19:22 +00:00
});
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
});
});