2016-03-24 03:25:10 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
let assert = require('assert');
|
|
|
|
|
|
|
|
require('../tools/js/v3-models.js');
|
2018-04-30 23:43:45 +00:00
|
|
|
const BrowserPrivilegedAPI = require('../public/v3/privileged-api.js').PrivilegedAPI;
|
2016-03-24 03:25:10 +00:00
|
|
|
|
2018-04-30 23:43:45 +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;
|
2016-03-24 03:25:10 +00:00
|
|
|
|
|
|
|
function sampleiOSConfig()
|
|
|
|
{
|
|
|
|
return {
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2016-03-24 03:25:10 +00:00
|
|
|
'types': {
|
|
|
|
'speedometer': {
|
|
|
|
'test': ['Speedometer'],
|
2017-05-11 23:46:23 +00:00
|
|
|
'properties': {'test_name': 'speedometer'}
|
2016-03-24 03:25:10 +00:00
|
|
|
},
|
|
|
|
'jetstream': {
|
|
|
|
'test': ['JetStream'],
|
2017-05-11 23:46:23 +00:00
|
|
|
'properties': {'test_name': 'jetstream'}
|
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'],
|
2017-05-11 23:46:23 +00:00
|
|
|
'properties': {'tests': 'dromaeo-dom'}
|
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'},
|
2021-03-22 21:23:38 +00:00
|
|
|
'workerList': ['ABTest-iPhone-0'],
|
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'},
|
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'},
|
|
|
|
},
|
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']},
|
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"],
|
2017-05-11 23:46:23 +00:00
|
|
|
"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"],
|
2017-05-11 23:46:23 +00:00
|
|
|
"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"],
|
2017-05-11 23:46:23 +00:00
|
|
|
"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',
|
2018-02-05 17:14:13 +00:00
|
|
|
'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
|
|
|
}
|
|
|
|
|
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'
|
2018-03-20 00:20:46 +00:00
|
|
|
};
|
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()
|
2018-03-20 00:20:46 +00:00
|
|
|
{
|
|
|
|
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()
|
2018-03-20 00:20:46 +00:00
|
|
|
{
|
|
|
|
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()
|
2018-03-20 00:20:46 +00:00
|
|
|
{
|
|
|
|
return sampleFinishedBuild(null, null, "some builder");
|
|
|
|
}
|
|
|
|
|
2016-03-31 04:18:39 +00:00
|
|
|
function createSampleBuildRequest(platform, test)
|
2016-03-24 03:25:10 +00:00
|
|
|
{
|
2016-03-31 04:18:39 +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}]});
|
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,
|
2021-05-26 01:23:22 +00:00
|
|
|
'commitSet': commitSet, 'status': 'pending', 'platform': platform, 'test': test, order: 0});
|
2016-03-24 03:25:10 +00:00
|
|
|
}
|
|
|
|
|
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'});
|
|
|
|
|
2017-06-30 04:43:00 +00:00
|
|
|
const patch = new UploadedFile(453, {'createdAt': new Date('2017-05-01T19:16:53Z'), 'filename': 'patch.dat', 'extension': '.dat', 'author': 'some user',
|
2017-05-31 20:24:59 +00:00
|
|
|
size: 534637, sha256: '169463c8125e07c577110fe144ecd63942eb9472d438fc0014f474245e5df8a1'});
|
|
|
|
|
2017-06-30 04:43:00 +00:00
|
|
|
const root = new UploadedFile(456, {'createdAt': new Date('2017-05-01T21:03:27Z'), 'filename': 'root.dat', 'extension': '.dat', 'author': 'some user',
|
2017-05-31 20:24:59 +00:00
|
|
|
size: 16452234, sha256: '03eed7a8494ab8794c44b7d4308e55448fc56f4d6c175809ba968f78f656d58d'});
|
|
|
|
|
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}]});
|
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});
|
|
|
|
}
|
|
|
|
|
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'});
|
|
|
|
|
2018-01-22 22:08:03 +00:00
|
|
|
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}]});
|
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});
|
|
|
|
}
|
|
|
|
|
2018-03-09 23:45:11 +00:00
|
|
|
function samplePendingBuildRequestData(buildRequestId, buildTime, workerName, builderId)
|
2018-02-02 07:06:19 +00:00
|
|
|
{
|
|
|
|
return {
|
|
|
|
"builderid": builderId || 102,
|
2018-03-09 23:45:11 +00:00
|
|
|
"buildrequestid": 17,
|
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,
|
2018-03-09 23:45:11 +00:00
|
|
|
"waited_for": false,
|
|
|
|
"properties": {
|
|
|
|
"build_request_id": [buildRequestId || 16733, "Force Build Form"],
|
|
|
|
"scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
|
2021-03-22 21:23:38 +00:00
|
|
|
"workername": [workerName, "Worker (deprecated)"],
|
2018-03-09 23:45:11 +00:00
|
|
|
"workername": [workerName, "Worker"]
|
|
|
|
}
|
2018-02-02 07:06:19 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-03-09 23:45:11 +00:00
|
|
|
function samplePendingBuildRequests(buildRequestId, buildTime, workerName, builderName)
|
2018-02-02 07:06:19 +00:00
|
|
|
{
|
|
|
|
return {
|
2018-03-09 23:45:11 +00:00
|
|
|
"buildrequests" : [samplePendingBuildRequestData(buildRequestId, buildTime, workerName, builderNameToIDMap()[builderName])]
|
2018-02-02 07:06:19 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-10-24 22:00:37 +00:00
|
|
|
function sampleBuildData(workerName, isComplete, buildRequestId, buildTag, builderId, state_string)
|
2018-02-02 07:06:19 +00:00
|
|
|
{
|
|
|
|
return {
|
|
|
|
"builderid": builderId || 102,
|
2019-10-24 22:00:37 +00:00
|
|
|
"number": buildTag || 614,
|
2018-03-09 23:45:11 +00:00
|
|
|
"buildrequestid": 17,
|
2018-02-02 07:06:19 +00:00
|
|
|
"complete": isComplete,
|
|
|
|
"complete_at": null,
|
|
|
|
"buildid": 418744,
|
|
|
|
"masterid": 1,
|
|
|
|
"results": null,
|
|
|
|
"started_at": 1513725109,
|
2019-09-27 22:45:12 +00:00
|
|
|
state_string,
|
2018-02-02 07:06:19 +00:00
|
|
|
"workerid": 41,
|
|
|
|
"properties": {
|
2018-03-09 23:45:11 +00:00
|
|
|
"build_request_id": [buildRequestId || 16733, "Force Build Form"],
|
2018-02-02 07:06:19 +00:00
|
|
|
"platform": ["mac", "Unknown"],
|
|
|
|
"scheduler": ["ABTest-iPad-RunBenchmark-Tests-ForceScheduler", "Scheduler"],
|
2021-03-22 21:23:38 +00:00
|
|
|
"workername": [workerName || "ABTest-iPad-0", "Worker (deprecated)"],
|
2019-09-27 22:45:12 +00:00
|
|
|
"workername": [workerName || "ABTest-iPad-0", "Worker"],
|
2018-02-02 07:06:19 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function sampleInProgressBuildData(workerName)
|
|
|
|
{
|
2019-09-27 22:45:12 +00:00
|
|
|
return sampleBuildData(workerName, false, null, null, null, 'building');
|
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)]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
describe('BuildbotSyncer', () => {
|
2016-03-30 04:16:48 +00:00
|
|
|
MockModels.inject();
|
2018-04-30 23:43:45 +00:00
|
|
|
const requests = MockRemoteAPI.inject('http://build.webkit.org', BrowserPrivilegedAPI);
|
2016-03-30 04:16:48 +00:00
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
describe('_loadConfig', () => {
|
2016-03-24 03:25:10 +00:00
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should create BuildbotSyncer objects for a configuration that specify all required options', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
assert.equal(BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap()).length, 1);
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +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;
|
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;
|
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/);
|
2017-03-15 18:15:33 +00:00
|
|
|
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;
|
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/);
|
2017-03-15 18:15:33 +00:00
|
|
|
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;
|
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;
|
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/);
|
2017-03-15 18:15:33 +00:00
|
|
|
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;
|
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/);
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +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';
|
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/);
|
2017-03-15 18:15:33 +00:00
|
|
|
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];
|
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/);
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-05-11 23:46:23 +00:00
|
|
|
it('should throw when properties is not an object', () => {
|
2017-03-15 18:15:33 +00:00
|
|
|
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';
|
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';
|
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 = {};
|
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 = {};
|
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 = {};
|
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 = {};
|
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"/);
|
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];
|
2017-03-15 18:15:33 +00:00
|
|
|
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';
|
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'}};
|
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"/);
|
2017-03-15 18:15:33 +00:00
|
|
|
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'}};
|
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"/);
|
2017-03-15 18:15:33 +00:00
|
|
|
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'}};
|
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};
|
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';
|
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'}};
|
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'}};
|
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'}};
|
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};
|
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"/);
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should create BuildbotSyncer objects for valid configurations', () => {
|
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);
|
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);
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should parse builder names correctly', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
|
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');
|
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', () => {
|
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;
|
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
|
|
|
});
|
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
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should parse test configurations with types and platforms expansions correctly', () => {
|
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;
|
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';
|
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: {}}};
|
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: {}};
|
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: {}}};
|
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': {}}}};
|
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}}};
|
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}};
|
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]}};
|
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}};
|
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'}};
|
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'}}}};
|
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'}}}};
|
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}};
|
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}};
|
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}};
|
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: {}}};
|
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}};
|
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}};
|
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: []}};
|
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'}}}};
|
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'}}}};
|
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'}}}};
|
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}};
|
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': {}}}}};
|
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'}}}};
|
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}};
|
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}};
|
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
|
|
|
});
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
describe('_propertiesForBuildRequest', () => {
|
|
|
|
it('should include all properties specified in a given configuration', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
|
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']);
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should preserve non-parametric property values', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
|
2017-05-31 20:24:59 +00:00
|
|
|
let request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
|
|
|
|
let properties = syncers[0]._propertiesForBuildRequest(request, [request]);
|
2016-03-24 03:25:10 +00:00
|
|
|
assert.equal(properties['test_name'], 'speedometer');
|
|
|
|
assert.equal(properties['forcescheduler'], 'ABTest-iPhone-RunBenchmark-Tests-ForceScheduler');
|
|
|
|
|
2017-05-31 20:24:59 +00:00
|
|
|
request = createSampleBuildRequest(MockModels.ipad, MockModels.jetstream);
|
|
|
|
properties = syncers[1]._propertiesForBuildRequest(request, [request]);
|
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');
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should resolve "root"', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
|
2017-05-31 20:24:59 +00:00
|
|
|
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
|
|
|
|
const properties = syncers[0]._propertiesForBuildRequest(request, [request]);
|
2016-03-24 03:25:10 +00:00
|
|
|
assert.equal(properties['desired_image'], '13A452');
|
|
|
|
});
|
|
|
|
|
2017-05-31 20:24:59 +00:00
|
|
|
it('should resolve "revision"', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
|
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'},
|
2017-09-29 07:34:41 +00:00
|
|
|
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
|
2018-03-15 03:17:37 +00:00
|
|
|
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
|
2017-05-31 20:24:59 +00:00
|
|
|
'shared': {'revision': 'Shared'},
|
|
|
|
},
|
|
|
|
'acceptsRoots': true,
|
|
|
|
};
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
|
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');
|
2017-06-30 04:43:00 +00:00
|
|
|
assert.equal(properties['webkit-patch'], 'http://build.webkit.org/api/uploaded-file/453.dat');
|
2017-09-29 07:34:41 +00:00
|
|
|
assert.equal(properties['checkbox'], 'build-webkit');
|
2018-03-15 03:17:37 +00:00
|
|
|
assert.equal(properties['build-webkit'], true);
|
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': {}},
|
2018-01-22 22:08:03 +00:00
|
|
|
'test-custom-build': {'ifBuilt': [], 'value': ''},
|
|
|
|
'has-built-patch': {'ifBuilt': [], 'value': 'true'},
|
2017-05-31 20:24:59 +00:00
|
|
|
},
|
|
|
|
'acceptsRoots': true,
|
|
|
|
};
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
|
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);
|
2017-06-30 04:43:00 +00:00
|
|
|
|
2017-05-31 20:24:59 +00:00
|
|
|
let properties = syncers[0]._propertiesForBuildRequest(requestToTest, [requestToTest]);
|
|
|
|
assert.equal(properties['webkit'], '197463');
|
2017-06-30 04:43:00 +00:00
|
|
|
assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
|
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');
|
2017-06-30 04:43:00 +00:00
|
|
|
assert.equal(properties['roots'], '[{"url":"http://build.webkit.org/api/uploaded-file/456.dat"}]');
|
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);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2018-01-22 22:08:03 +00:00
|
|
|
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': {}},
|
2018-03-15 03:17:37 +00:00
|
|
|
'checkbox': {'ifBuilt': ['WebKit'], 'value': 'test-webkit'},
|
|
|
|
'test-webkit': {'ifBuilt': ['WebKit'], 'value': true}
|
2018-01-22 22:08:03 +00:00
|
|
|
},
|
|
|
|
'buildProperties': {
|
|
|
|
'webkit': {'revision': 'WebKit'},
|
|
|
|
'webkit-patch': {'patch': 'WebKit'},
|
|
|
|
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
|
2018-03-15 03:17:37 +00:00
|
|
|
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
|
2018-01-22 22:08:03 +00:00
|
|
|
'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');
|
2018-03-15 03:17:37 +00:00
|
|
|
assert.equal(properties['test-webkit'], true);
|
2018-01-22 22:08:03 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
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': {}},
|
2018-03-15 03:17:37 +00:00
|
|
|
'checkbox': {'ifBuilt': ['WebKit'], 'value': 'test-webkit'},
|
|
|
|
'test-webkit': {'ifBuilt': ['WebKit'], 'value': true}
|
2018-01-22 22:08:03 +00:00
|
|
|
},
|
|
|
|
'buildProperties': {
|
|
|
|
'webkit': {'revision': 'WebKit'},
|
|
|
|
'webkit-patch': {'patch': 'WebKit'},
|
|
|
|
'owner-repo': {'revision': 'Owner Repository'},
|
|
|
|
'checkbox': {'ifRepositorySet': ['WebKit'], 'value': 'build-webkit'},
|
2018-03-15 03:17:37 +00:00
|
|
|
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
|
2018-01-22 22:08:03 +00:00
|
|
|
'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);
|
2018-03-15 03:17:37 +00:00
|
|
|
assert.equal(properties['test-webkit'], undefined);
|
2018-01-22 22:08:03 +00:00
|
|
|
});
|
|
|
|
|
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'},
|
2018-03-15 03:17:37 +00:00
|
|
|
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
|
2017-09-29 07:34:41 +00:00
|
|
|
'owned-commits': {'ownedRevisions': 'Owner Repository'}
|
|
|
|
},
|
|
|
|
'acceptsRoots': true,
|
|
|
|
};
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
|
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);
|
2018-03-15 03:17:37 +00:00
|
|
|
assert.equal(properties['build-webkit'], undefined);
|
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'},
|
2018-03-15 03:17:37 +00:00
|
|
|
'build-webkit': {'ifRepositorySet': ['WebKit'], 'value': true},
|
2017-09-29 07:34:41 +00:00
|
|
|
'owned-commits': {'ownedRevisions': 'Owner Repository'}
|
|
|
|
},
|
|
|
|
'acceptsRoots': true,
|
|
|
|
};
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, config, builderNameToIDMap());
|
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');
|
2018-03-15 03:17:37 +00:00
|
|
|
assert.equal(properties['build-webkit'], true);
|
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'}]});
|
|
|
|
});
|
|
|
|
|
2019-05-22 06:15:58 +00:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should set the property for the build request id', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
const syncers = BuildbotSyncer._loadConfig(RemoteAPI, sampleiOSConfig(), builderNameToIDMap());
|
2017-05-31 20:24:59 +00:00
|
|
|
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
|
|
|
|
const properties = syncers[0]._propertiesForBuildRequest(request, [request]);
|
2016-03-31 04:18:39 +00:00
|
|
|
assert.equal(properties['build_request_id'], request.id());
|
2016-03-24 03:25:10 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
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];
|
2018-02-28 21:54:56 +00:00
|
|
|
const buildbotData = samplePendingBuildRequests();
|
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);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.ok(!entry.buildTag());
|
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());
|
2018-03-16 23:48:37 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
|
2019-09-27 22:45:12 +00:00
|
|
|
assert.equal(entry.statusDescription(), null);
|
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);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 614);
|
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');
|
2019-09-27 22:45:12 +00:00
|
|
|
assert.equal(entry.statusDescription(), 'building');
|
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);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 1755);
|
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');
|
2019-09-27 22:45:12 +00:00
|
|
|
assert.equal(entry.statusDescription(), null);
|
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);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 614);
|
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');
|
2019-09-27 22:45:12 +00:00
|
|
|
assert.equal(entry.statusDescription(), 'building');
|
2018-02-02 07:06:19 +00:00
|
|
|
|
|
|
|
entry = entries[1];
|
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 1755);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
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');
|
2019-09-27 22:45:12 +00:00
|
|
|
assert.equal(entry.statusDescription(), null);
|
2018-02-02 07:06:19 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-02-05 16:53:22 +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);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 1755);
|
2018-02-05 16:53:22 +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');
|
|
|
|
|
|
|
|
entry = entries[1];
|
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 614);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
2018-02-05 16:53:22 +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');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
describe('pullBuildbot', () => {
|
|
|
|
it('should fetch pending builds from the right URL', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(syncer.builderName(), 'ABTest-iPad-RunBenchmark-Tests');
|
2018-03-20 00:20:46 +00:00
|
|
|
let expectedURL = '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*';
|
|
|
|
assert.equal(syncer.pathForPendingBuilds(), expectedURL);
|
2016-03-30 03:16:29 +00:00
|
|
|
syncer.pullBuildbot();
|
|
|
|
assert.equal(requests.length, 1);
|
|
|
|
assert.equal(requests[0].url, expectedURL);
|
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should fetch recent builds once pending builds have been fetched', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(syncer.builderName(), 'ABTest-iPad-RunBenchmark-Tests');
|
|
|
|
|
|
|
|
syncer.pullBuildbot(1);
|
|
|
|
assert.equal(requests.length, 1);
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(requests[0].url, '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*');
|
2016-03-30 03:16:29 +00:00
|
|
|
requests[0].resolve([]);
|
2017-03-15 18:15:33 +00:00
|
|
|
return MockRemoteAPI.waitForRequest().then(() => {
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(requests[1].url, '/api/v2/builders/102/builds?limit=1&order=-number&property=*');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should fetch the right number of recent builds', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
|
|
|
|
syncer.pullBuildbot(3);
|
|
|
|
assert.equal(requests.length, 1);
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(requests[0].url, '/api/v2/builders/102/buildrequests?complete=false&claimed=false&property=*');
|
2016-03-30 03:16:29 +00:00
|
|
|
requests[0].resolve([]);
|
2017-03-15 18:15:33 +00:00
|
|
|
return MockRemoteAPI.waitForRequest().then(() => {
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(requests[1].url, '/api/v2/builders/102/builds?limit=3&order=-number&property=*');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should create BuildbotBuildEntry for pending builds', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
let promise = syncer.pullBuildbot();
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[0].resolve(samplePendingBuildRequests());
|
2017-03-15 18:15:33 +00:00
|
|
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.ok(!entry.buildTag());
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.ok(!entry.workerName());
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should create BuildbotBuildEntry for in-progress builds', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
|
|
|
|
let promise = syncer.pullBuildbot(1);
|
|
|
|
assert.equal(requests.length, 1);
|
|
|
|
requests[0].resolve([]);
|
2017-03-15 18:15:33 +00:00
|
|
|
return MockRemoteAPI.waitForRequest().then(() => {
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[1].resolve(sampleInProgressBuild());
|
2017-03-15 18:15:33 +00:00
|
|
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 614);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should create BuildbotBuildEntry for finished builds', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
|
|
|
|
let promise = syncer.pullBuildbot(1);
|
|
|
|
assert.equal(requests.length, 1);
|
|
|
|
requests[0].resolve([]);
|
2017-03-15 18:15:33 +00:00
|
|
|
return MockRemoteAPI.waitForRequest().then(() => {
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[1].resolve(sampleFinishedBuild());
|
2017-03-15 18:15:33 +00:00
|
|
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 1755);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should create BuildbotBuildEntry for mixed pending, in-progress, finished, and missing builds', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
|
|
|
|
let promise = syncer.pullBuildbot(5);
|
|
|
|
assert.equal(requests.length, 1);
|
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[0].resolve(samplePendingBuildRequests(123));
|
2016-03-30 03:16:29 +00:00
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
return MockRemoteAPI.waitForRequest().then(() => {
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[1].resolve({'builds': [sampleFinishedBuildData(), sampleInProgressBuildData()]});
|
2017-03-15 18:15:33 +00:00
|
|
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), null);
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 614);
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 1755);
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should sort BuildbotBuildEntry by order', () => {
|
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);
|
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
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
|
|
|
|
2017-03-15 18:15:33 +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);
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[1].resolve({'builds': [sampleFinishedBuildData(), sampleInProgressBuildData()]});
|
2017-03-15 18:15:33 +00:00
|
|
|
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);
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), null);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), null);
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/buildrequests/17');
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), null);
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 614);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 1755);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should override BuildbotBuildEntry for pending builds by in-progress builds', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
|
|
|
|
let promise = syncer.pullBuildbot(5);
|
|
|
|
assert.equal(requests.length, 1);
|
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[0].resolve(samplePendingBuildRequests());
|
2016-03-30 03:16:29 +00:00
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
return MockRemoteAPI.waitForRequest().then(() => {
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[1].resolve(sampleInProgressBuild());
|
2017-03-15 18:15:33 +00:00
|
|
|
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);
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 614);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/614');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should override BuildbotBuildEntry for pending builds by finished builds', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-03-30 03:16:29 +00:00
|
|
|
|
|
|
|
let promise = syncer.pullBuildbot(5);
|
|
|
|
assert.equal(requests.length, 1);
|
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[0].resolve(samplePendingBuildRequests());
|
2016-03-30 03:16:29 +00:00
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
return MockRemoteAPI.waitForRequest().then(() => {
|
2016-03-30 03:16:29 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2018-03-20 00:20:46 +00:00
|
|
|
requests[1].resolve(sampleFinishedBuild(16733));
|
2017-03-15 18:15:33 +00:00
|
|
|
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);
|
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];
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.ok(entry instanceof BuildbotBuildEntry);
|
2019-10-24 22:00:37 +00:00
|
|
|
assert.equal(entry.buildTag(), 1755);
|
2021-03-22 21:23:38 +00:00
|
|
|
assert.equal(entry.workerName(), 'ABTest-iPad-0');
|
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());
|
2018-03-20 00:20:46 +00:00
|
|
|
assert.equal(entry.url(), 'http://build.webkit.org/#/builders/102/builds/1755');
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
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
|
|
|
});
|
|
|
|
|
2018-02-05 17:14:13 +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'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
describe('scheduleRequest', () => {
|
2021-03-22 21:23:38 +00:00
|
|
|
it('should schedule a build request on a specified worker', () => {
|
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
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
const waitForRequest = MockRemoteAPI.waitForRequest();
|
2017-05-31 20:24:59 +00:00
|
|
|
const request = createSampleBuildRequest(MockModels.iphone, MockModels.speedometer);
|
2021-03-22 21:23:38 +00:00
|
|
|
syncer.scheduleRequest(request, [request], 'some-worker');
|
2017-03-15 18:15:33 +00:00
|
|
|
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);
|
2018-03-20 00:20:46 +00:00
|
|
|
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, {
|
2018-03-20 00:20:46 +00:00
|
|
|
'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',
|
2021-03-22 21:23:38 +00:00
|
|
|
'workername': 'some-worker',
|
2018-03-20 00:20:46 +00:00
|
|
|
'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
|
|
|
});
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +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)
|
|
|
|
{
|
2017-03-15 18:15:33 +00:00
|
|
|
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);
|
2017-03-15 18:15:33 +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(inProgressAndFinishedBuilds);
|
|
|
|
requests.length = 0;
|
|
|
|
return promise;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
it('should schedule a build if builder has no builds if workerList is not specified', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
|
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);
|
2018-03-20 00:20:46 +00:00
|
|
|
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');
|
2018-03-20 00:20:46 +00:00
|
|
|
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'}});
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
it('should schedule a build if builder only has finished builds if workerList is not specified', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, smallFinishedBuild()).then(() => {
|
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);
|
2018-03-20 00:20:46 +00:00
|
|
|
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');
|
2018-03-20 00:20:46 +00:00
|
|
|
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'}});
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
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', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, smallPendingBuild(), {}).then(() => {
|
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);
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
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', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
|
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);
|
2018-03-20 00:20:46 +00:00
|
|
|
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');
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
it('should schedule a build if builder only has finished builds on the matching worker', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
pullBuildbotWithAssertion(syncer, {}, sampleFinishedBuild()).then(() => {
|
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);
|
2018-03-20 00:20:46 +00:00
|
|
|
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');
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
it('should not schedule a build if builder has a pending build on the maching worker', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
pullBuildbotWithAssertion(syncer, samplePendingBuildRequests(), {}).then(() => {
|
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);
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
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', () => {
|
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
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, samplePendingBuildRequests(1, 1, 'another-worker'), {}).then(() => {
|
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);
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
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', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, sampleInProgressBuild()).then(() => {
|
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);
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
it('should schedule a build if builder has an in-progress build on another worker', () => {
|
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
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, sampleInProgressBuild('other-worker')).then(() => {
|
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);
|
2017-03-15 18:15:33 +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
|
|
|
});
|
|
|
|
|
2017-03-15 18:15:33 +00:00
|
|
|
it('should not schedule a build if the request does not match any configuration', () => {
|
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
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
|
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);
|
2017-03-15 18:15:33 +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
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
|
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) => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-04-08 03:19:22 +00:00
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
|
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');
|
2017-03-15 18:15:33 +00:00
|
|
|
}).then(() => {
|
2016-04-08 03:19:22 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2017-05-31 20:24:59 +00:00
|
|
|
const request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
|
|
|
|
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
|
2017-03-15 18:15:33 +00:00
|
|
|
}).then(() => {
|
2016-04-08 03:19:22 +00:00
|
|
|
assert.equal(requests.length, 2);
|
|
|
|
done();
|
|
|
|
}).catch(done);
|
|
|
|
});
|
|
|
|
|
2021-03-22 21:23:38 +00:00
|
|
|
it('should schedule a build if a new request had been submitted to another worker', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, sampleiOSConfig(), builderNameToIDMap())[1];
|
2016-04-08 03:19:22 +00:00
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
|
2017-05-31 20:24:59 +00:00
|
|
|
let request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer);
|
|
|
|
syncer.scheduleRequest(request, [request], 'ABTest-iPad-0');
|
2016-04-08 03:19:22 +00:00
|
|
|
assert.equal(requests.length, 1);
|
2017-05-31 20:24:59 +00:00
|
|
|
request = createSampleBuildRequest(MockModels.ipad, MockModels.speedometer)
|
|
|
|
syncer.scheduleRequestInGroupIfAvailable(request, [request], 'ABTest-iPad-1');
|
2016-04-08 03:19:22 +00:00
|
|
|
assert.equal(requests.length, 2);
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-04-08 03:19:22 +00:00
|
|
|
});
|
|
|
|
|
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', () => {
|
2018-01-19 05:42:39 +00:00
|
|
|
let syncer = BuildbotSyncer._loadConfig(MockRemoteAPI, smallConfiguration(), builderNameToIDMap())[0];
|
2016-04-08 03:19:22 +00:00
|
|
|
|
2018-03-20 00:20:46 +00:00
|
|
|
return pullBuildbotWithAssertion(syncer, {}, {}).then(() => {
|
2017-05-31 20:24:59 +00:00
|
|
|
let request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
|
|
|
|
syncer.scheduleRequest(request, [request], null);
|
2016-04-08 03:19:22 +00:00
|
|
|
assert.equal(requests.length, 1);
|
2017-05-31 20:24:59 +00:00
|
|
|
request = createSampleBuildRequest(MockModels.somePlatform, MockModels.someTest);
|
|
|
|
syncer.scheduleRequestInGroupIfAvailable(request, [request], null);
|
2016-04-08 03:19:22 +00:00
|
|
|
assert.equal(requests.length, 1);
|
2017-03-15 18:15:33 +00:00
|
|
|
});
|
2016-04-08 03:19:22 +00:00
|
|
|
});
|
2016-03-30 03:16:29 +00:00
|
|
|
});
|
|
|
|
});
|