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

481 lines
26 KiB
JavaScript
Raw Permalink Normal View History

Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
'use strict';
sync-buildbot.js should update the list of tests and platforms associated with a triggerable https://bugs.webkit.org/show_bug.cgi?id=158406 <rdar://problem/26185737> Reviewed by Darin Adler. Added /api/update-triggerable to update the list of configurations (platform and test pairs) associated with a given triggerable, and make sync-buildbot.js use this JSON API before each syncing cycle so that the association gets updated automatically by simply updating the JSON. * server-tests/api-manifest.js: Use const for imported modules. * server-tests/api-report-commits-tests.js: Removed unnecessary importing of crypto. * server-tests/resources/mock-data.js: (MockData.someTestId): Added. (MockData.somePlatformId): Added. (MockData.addMockData): * server-tests/tools-buildbot-triggerable-tests.js: Use const for imported modules. Also added a test for BuildbotTriggerable's updateTriggerable. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Added. Find the list of all configurations associated with this triggeerable and post it to /api/update-triggerable. * tools/js/database.js: Added triggerable_configurations to the list of tables. * tools/js/remote.js: (RemoteAPI.prototype.postJSON): Print the whole response when JSON parsing fails for debugging. * tools/sync-buildbot.js: (syncLoop): Call BuildbotTriggerable's updateTriggerable before syncing. Canonical link: https://commits.webkit.org/176504@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-06 18:51:23 +00:00
const assert = require('assert');
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
require('../tools/js/v3-models.js');
sync-buildbot.js should update the list of tests and platforms associated with a triggerable https://bugs.webkit.org/show_bug.cgi?id=158406 <rdar://problem/26185737> Reviewed by Darin Adler. Added /api/update-triggerable to update the list of configurations (platform and test pairs) associated with a given triggerable, and make sync-buildbot.js use this JSON API before each syncing cycle so that the association gets updated automatically by simply updating the JSON. * server-tests/api-manifest.js: Use const for imported modules. * server-tests/api-report-commits-tests.js: Removed unnecessary importing of crypto. * server-tests/resources/mock-data.js: (MockData.someTestId): Added. (MockData.somePlatformId): Added. (MockData.addMockData): * server-tests/tools-buildbot-triggerable-tests.js: Use const for imported modules. Also added a test for BuildbotTriggerable's updateTriggerable. * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype.updateTriggerable): Added. Find the list of all configurations associated with this triggeerable and post it to /api/update-triggerable. * tools/js/database.js: Added triggerable_configurations to the list of tables. * tools/js/remote.js: (RemoteAPI.prototype.postJSON): Print the whole response when JSON parsing fails for debugging. * tools/sync-buildbot.js: (syncLoop): Call BuildbotTriggerable's updateTriggerable before syncing. Canonical link: https://commits.webkit.org/176504@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-06 18:51:23 +00:00
const MockData = require('./resources/mock-data.js');
const TestServer = require('./resources/test-server.js');
const prepareServerTest = require('./resources/common-operations.js').prepareServerTest;
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
describe('/api/manifest', function () {
prepareServerTest(this);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
it("should generate an empty manifest when database is empty", () => {
return TestServer.remoteAPI().getJSON('/api/manifest').then((manifest) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(Object.keys(manifest).sort(), ['all', 'bugTrackers', 'builders', 'dashboard', 'dashboards',
'fileUploadSizeLimit', 'maxRootReuseAgeInDays', 'metrics', 'platformGroups', 'repositories', 'siteTitle',
'status', 'summaryPages', 'testAgeToleranceInHours', 'tests', 'triggerables']);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert.deepStrictEqual(manifest, {
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
siteTitle: TestServer.testConfig().siteTitle,
all: {},
bugTrackers: {},
builders: {},
dashboard: {},
dashboards: {},
Add the file uploading capability to the perf dashboard. https://bugs.webkit.org/show_bug.cgi?id=169737 Reviewed by Chris Dumez. Added /privileged-api/upload-file to upload a file, and /api/uploaded-file/ to download the file and retrieve its meta data based on its SHA256. We treat two files with the identical SHA256 as identical since anyone who can upload a file using this mechanism can execute arbitrary code in our bots anyway. This is important for avoiding uploading a large darwinup roots multiple times to the server, saving both user's time/bandwidth and server's disk space. * config.json: Added uploadDirectory, uploadFileLimitInMB, and uploadUserQuotaInMB as options. * init-database.sql: Added uploaded_files table. * public/api/uploaded-file.php: Added. (main): /api/uploaded-file/N would download uploaded_file with id=N. /api/uploaded-file/?sha256=X would return the meta data for uploaded_file with sha256=X. (stream_file_content): Streams the file content in 64KB chunks. We support Range & If-Range HTTP request headers so that browsers can pause and resume downloading of a large root file. (parse_range_header): Parses Range HTTP request header. * public/include/json-header.php: (remote_user_name): Use the default argument of NULL. * public/include/manifest-generator.php: (ManifestGenerator::generate): Include the maximum upload size in the manifest file to let the frontend code preemptively check the file size before attempting to submit a file. * public/include/uploaded-file-helpers.php: Added. (format_uploaded_file): (uploaded_file_path_for_row): * public/privileged-api/upload-file-form.html: Added. For debugging purposes. (fetchCSRFfToken): (upload): * public/privileged-api/upload-file.php: Added. (main): (query_total_file_size): (create_uploaded_file_from_form_data): * public/shared/common-remote.js: (CommonRemoteAPI.prototype.postFormData): Added. (CommonRemoteAPI.prototype.postFormDataWithStatus): Added. (CommonRemoteAPI.prototype.sendHttpRequestWithFormData): Added. (CommonRemoteAPI.prototype._asJSON): Throw an exception instead of calling a non-existent reject. * public/v3/models/uploaded-file.js: Added. (UploadedFile): Added. (UploadedFile.uploadFile): Added. (UploadedFile.fetchUnloadedFileWithIdenticalHash): Added. Finds the file with the same SHA256 in the server to avoid uploading a large custom root multiple times. (UploadedFile._computeSHA256Hash): Added. * public/v3/privileged-api.js: (PrivilegedAPI.prototype.sendRequest): Added the options dictionary as a third argument. For now, only support useFormData boolean. * public/v3/remote.js: (BrowserRemoteAPI.prototype.sendHttpRequestWithFormData): Added. * server-tests/api-manifest.js: Updated per the inclusion of fileUploadSizeLimit in the manifest. * server-tests/api-uploaded-file.js: Added. * server-tests/privileged-api-upload-file-tests.js: Added. * server-tests/resources/temporary-file.js: Added. (TemporaryFile): Added. A helper class for creating a temporary file to upload. (TemporaryFile.makeTemporaryFileOfSizeInMB): (TemporaryFile.makeTemporaryFile): (TemporaryFile.inject): * server-tests/resources/test-server.conf: Set upload_max_filesize and post_max_size for testing. * server-tests/resources/test-server.js: (TestServer.prototype.testConfig): Use uploadFileLimitInMB and uploadUserQuotaInMB of 2MB and 5MB. (TestServer.prototype._ensureDataDirectory): Create a directory to store uploaded files inside the data directory. In a production server, we can place it outside ServerRoot / DocumentRoot. (TestServer.prototype.cleanDataDirectory): Delete the aforementioned directory as needed. * tools/js/database.js: (tableToPrefixMap): Added uploaded_files. * tools/js/remote.js: (NodeRemoteAPI.prototype.sendHttpRequest): Added a dictionary to specify request headers and a callback to process the response as arguments. Fixed the bug that any 2xx code other than 200 was resulting in a rejected promise. Also include the response headers in the result for tests. Finally, when content is a function, call that instead of writing the content since FormData requires a custom logic. (NodeRemoteAPI.prototype.sendHttpRequestWithFormData): Added. * tools/js/v3-models.js: Include uploaded-file.js. * tools/run-tests.py: (main): Add form-data as a new dependency. Canonical link: https://commits.webkit.org/186730@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-16 20:53:35 +00:00
fileUploadSizeLimit: 2097152, // 2MB during testing.
maxRootReuseAgeInDays: null,
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
metrics: {},
Refactor 'platforms' table to contain group information. https://bugs.webkit.org/show_bug.cgi?id=193132 Reviewed by Ryosuke Niwa. Group 'platforms' so that bisecting can use commit sets from other platforms which are in the same platform group. This will help to enhance the bisecting capability to higher granularity. Added admin page to manage platform groups. Updated platform admin page to allow update platform group. SQL query to update existing database: ''' BEGIN; CREATE TABLE platform_groups ( platformgroup_id serial PRIMARY KEY, platformgroup_name varchar(64) NOT NULL, CONSTRAINT platform_group_name_must_be_unique UNIQUE (platformgroup_name)); ALTER TABLE platforms ADD COLUMN platform_group integer REFERENCES platform_groups DEFAULT NULL; END; ''' * init-database.sql: Added 'platform_group' column to 'platforms' table. Added 'platform_groups' table. * migrate-database.sql: Updated migration script accordingly. * public/admin/platform-groups.php: Added a page to manage platform groups. * public/admin/platforms.php: Added support to update platform group in admin page. * public/include/admin-header.php: Added link to page that maneges platform groups. * public/include/manifest-generator.php: Added 'platformGroup' in manifest. * public/v3/index.html: Included 'platform-groups.js'. * public/v3/models/analysis-task.js: (AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Included measurement commit sets from other platforms in the same platform group. (AnalysisTask.prototype._commitSetForOtherPlatformsInSameGroup): Helper function to find measurment commit set for other platforms in same platform group. * public/v3/models/manifest.js: Added step to build 'PlatformGroup' instances. * public/v3/models/platform-group.js: Added 'PlatformGroup' to represent entries in 'platform_groups' table. (PlatformGroup): (PlatformGroup.prototype.addPlatform): (PlatformGroup.prototype.platforms): * public/v3/models/platform.js: Added itself to 'PlatformGroup' in constructor if it belongs to a group. (Platform.prototype.group): Return the platform group of current platform. * public/v3/models/time-series.js: Added helper function to show view between a given time range. (TimeSeries.prototype.viewBetweenTime): * server-tests/api-manifest-tests.js: Updated unit test to also test platform group initialization. * tools/js/database.js: Added prefix for 'platform_groups'. * tools/js/v3-models.js: Added import for platform group. Canonical link: https://commits.webkit.org/230971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-28 01:00:35 +00:00
platformGroups: {},
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
repositories: {},
Add a test freshness page. https://bugs.webkit.org/show_bug.cgi?id=180126 Reviewed by Ryosuke Niwa. Added a page to show freshness of a test. The test freshness page reports on the same set of tests as the one shown in the summary page. Use a logistic function to evaluate the freshness of the data points. This function has the desired property which increase dramatically when it close to the center of the graph. 'acceptableLastDataPointDurationInHour' configs the center of the graph. * public/include/manifest-generator.php: * public/v3/components/freshness-indicator.js: Added. (FreshnessIndicator): A cell of the test freshness table, color will transit from green to red. (FreshnessIndicator.prototype.update): Update the the data point information and triggers the cell to re-render if anything changes. (FreshnessIndicator.prototype._renderIndicator): Re-render the indicator. (FreshnessIndicator.prototype.render): Render the box color base on a logistic function. (FreshnessIndicator.prototype._createIndicator): (FreshnessIndicator.htmlTemplate): (FreshnessIndicator.cssTemplate): * public/v3/index.html: * public/v3/main.js: Added test freshness page. (main): * public/v3/models/build-request.js: Refactored waitingTime function to make it reusable. (BuildRequest.formatTimeInterval): Format time interval in million seconds to more user friendly text. (BuildRequest.prototype.waitingTime): * public/v3/pages/test-freshness-page.js: Added. (TestFreshnessPage): (TestFreshnessPage.prototype.name): (TestFreshnessPage.prototype._loadConfig): Load config from summary page configurations. (TestFreshnessPage.prototype.open): (TestFreshnessPage.prototype._fetchTestResults): (TestFreshnessPage.prototype.render): (TestFreshnessPage.prototype._renderTable): (TestFreshnessPage.prototype._isValidPlatformMetricCombination): Return whether a platform and metric combination is valid. (TestFreshnessPage.prototype._constructTableCell): (TestFreshnessPage.cssTemplate): (TestFreshnessPage.prototype.routeName): * server-tests/api-manifest-tests.js: Added 'warningHourBaseline' so that we can config the parameter of logistic funciton. * unit-tests/build-request-tests.js: Added unit tests for formatTimeInterval. Canonical link: https://commits.webkit.org/196700@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-14 09:49:37 +00:00
testAgeToleranceInHours: null,
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
tests: {},
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
triggerables: {},
summaryPages: [],
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
status: 'OK'
});
});
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
});
const bugzillaData = {id: 1, name: 'Bugzilla', bug_url: 'https://webkit.org/b/$number', new_bug_url: 'https://bugs.webkit.org/'};
const radarData = {id: 2, name: 'Radar'};
it("should generate manifest with bug trackers without repositories", () => {
return TestServer.database().insert('bug_trackers', bugzillaData).then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
return TestServer.remoteAPI().getJSON('/api/manifest');
}).then((content) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(content.bugTrackers, {1: {name: 'Bugzilla', bugUrl: 'https://webkit.org/b/$number',
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
newBugUrl: 'https://bugs.webkit.org/', repositories: null}});
let manifest = Manifest._didFetchManifest(content);
let tracker = BugTracker.findById(1);
assert(tracker);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(tracker.name(), 'Bugzilla');
assert.strictEqual(tracker.bugUrl(123), 'https://webkit.org/b/123');
assert.strictEqual(tracker.newBugUrl(), 'https://bugs.webkit.org/');
});
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
});
it("should clear Bug and BugTracker static maps when reset", async () => {
await TestServer.database().insert('bug_trackers', bugzillaData);
const content = await TestServer.remoteAPI().getJSON('/api/manifest');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(content.bugTrackers, {1: {name: 'Bugzilla', bugUrl: 'https://webkit.org/b/$number',
newBugUrl: 'https://bugs.webkit.org/', repositories: null}});
Manifest._didFetchManifest(content);
const trackerFromFirstFetch = BugTracker.findById(1);
Manifest.reset();
assert(!BugTracker.findById(1));
Manifest._didFetchManifest(content);
const trackerFromSecondFetch = BugTracker.findById(1);
assert(trackerFromFirstFetch != trackerFromSecondFetch);
});
it("should generate manifest with bug trackers and repositories", () => {
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
let db = TestServer.database();
return Promise.all([
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
db.insert('bug_trackers', bugzillaData),
db.insert('bug_trackers', radarData),
db.insert('repositories', {id: 11, name: 'WebKit', url: 'https://trac.webkit.org/$1'}),
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
db.insert('repositories', {id: 9, name: 'macOS'}),
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
db.insert('repositories', {id: 22, name: 'iOS'}),
db.insert('tracker_repositories', {tracker: bugzillaData.id, repository: 11}),
db.insert('tracker_repositories', {tracker: radarData.id, repository: 9}),
db.insert('tracker_repositories', {tracker: radarData.id, repository: 22}),
]).then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
return TestServer.remoteAPI().getJSON('/api/manifest');
}).then((content) => {
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
let manifest = Manifest._didFetchManifest(content);
let webkit = Repository.findById(11);
assert(webkit);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(webkit.name(), 'WebKit');
assert.strictEqual(webkit.urlForRevision(123), 'https://trac.webkit.org/123');
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +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
let macos = Repository.findById(9);
assert(macos);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(macos.name(), 'macOS');
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
let ios = Repository.findById(22);
assert(ios);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(ios.name(), 'iOS');
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
let tracker = BugTracker.findById(1);
assert(tracker);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(tracker.name(), 'Bugzilla');
assert.strictEqual(tracker.bugUrl(123), 'https://webkit.org/b/123');
assert.strictEqual(tracker.newBugUrl(), 'https://bugs.webkit.org/');
assert.deepStrictEqual(tracker.repositories(), [webkit]);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
tracker = BugTracker.findById(2);
assert(tracker);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(tracker.name(), 'Radar');
assert.deepStrictEqual(Repository.sortByName(tracker.repositories()), [ios, macos]);
});
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
});
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
it("should generate manifest with repositories and each repository should know its owned repositories", () => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {id: 11, name: 'WebKit', url: 'https://trac.webkit.org/$1'}),
db.insert('repositories', {id: 9, name: 'OS X'}),
db.insert('repositories', {id: 22, name: 'iOS'}),
db.insert('repositories', {id: 35, name: 'JavaScriptCore', owner: 9}),
]).then(() => {
return TestServer.remoteAPI().getJSON('/api/manifest');
}).then((content) => {
let manifest = Manifest._didFetchManifest(content);
let webkit = Repository.findById(11);
assert(webkit);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(webkit.name(), 'WebKit');
assert.strictEqual(webkit.urlForRevision(123), 'https://trac.webkit.org/123');
assert.ok(!webkit.ownedRepositories());
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
let osx = Repository.findById(9);
assert(osx);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(osx.name(), 'OS X');
assert.deepStrictEqual(osx.ownedRepositories(), [Repository.findById(35)]);
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
let ios = Repository.findById(22);
assert(ios);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(ios.name(), 'iOS');
assert.ok(!ios.ownedRepositories());
Add sub-commit UI in commit log viewer. https://bugs.webkit.org/show_bug.cgi?id=170379 Reviewed by Ryosuke Niwa. Add an API to return sub-commits for a given commit. Add sub-commit difference viewer into commit log viewer to show changed sub-commits between two commits. Add 'ownsSubCommits' info in 'api/commits' return values. Extend 'api/manifest' to include whether a repositories owns other repositories. Only show this sub-commit difference viewer when a repository owns other repositories and both commits owns sub-commits. Add unit tests for those new features. * browser-tests/commit-log-viewer-tests.js: Updated test cases. * public/api/commits.php: Added 'sub-commits' to provide sub-commit for a given commit. * public/include/commit-log-fetcher.php: Added function to query sub-commit from database. Added 'repository' and 'ownsSubCommits' fields in returning commits. * public/v3/components/expand-collapse-button.js: Added. (ExpandCollapseButton): (ExpandCollapseButton.prototype.didConstructShadowTree): Changes state on click and dispatches 'toggle' event. (ExpandCollapseButton.sizeFactor): (ExpandCollapseButton.buttonContent): (ExpandCollapseButton.cssTemplate): * public/v3/components/commit-log-viewer.js: (CommitLogViewer.prototype._renderCommitList): Added sub-commit viewer if two adjacent commits both have sub-commits. (CommitLogViewer.cssTemplate): * public/v3/components/sub-commit-viewer.js: Added. (SubCommitViewer): Added 'SubCommitViewer' class to represent the sub-commit differences between two given commits.` (SubCommitViewer.prototype.didConstructShadowTree): Makes 'expand-collapse' button listen to 'toggle' event. (SubCommitViewer.prototype._toggleVisibility): Updates UI once 'expand-collapse' button is clicked. (SubCommitViewer.prototype.render): Render sub-commit view based on the state. (SubCommitViewer.prototype._renderSubcommitTable): Generates sub-commits difference table entries. (SubCommitViewer.htmlTemplate): (SubCommitViewer.cssTemplate): * public/v3/index.html: Added 'sub-commit-viewer.js' and 'expand-collapse-button.js'. * public/v3/models/commit-log.js: (CommitLog): Added '_subCommits'. (CommitLog.prototype.updateSingleton): Updates 'rawData.ownsSubCommits' as well. (CommitLog.prototype.ownsSubCommits): (CommitLog.prototype.subCommits): Added. Returns sub-commits. (CommitLog.prototype.fetchSubCommits): Added. Fetches sub-commits if haven't fetched them before. (CommitLog.prototype._buildSubCommitMap): Added. Creates a map which maps repositories to commits. (CommitLog.diffSubCommits): Added. Finds difference between two given commits. (CommitLog.fetchBetweenRevisions): Updated due to '_constructFromRawData' change. (CommitLog.fetchForSingleRevision): Updated due to '_constructFromRawData' change. (CommitLog._constructFromRawData): Removed first argument 'repository' as it can be determined by calling 'Repository.findById'. * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): Returns the owner id. (Repository.prototype.ownedRepositories): Returns a list of repositories owned by this repository. * server-tests/api-commits-tests.js: Added tests for 'sub-commits' filter. * server-tests/api-manifest-tests.js: Added a test. * unit-tests/commit-log-tests.js: Added tests for 'fetchSubCommits' and 'diffSubCommits'. * unit-tests/resources/mock-v3-models.js: Added 'ownerRepository' and 'ownedRepository'. Canonical link: https://commits.webkit.org/187795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-14 23:03:19 +00:00
});
});
it("should generate manifest with builders", () => {
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
let db = TestServer.database();
return Promise.all([
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
db.insert('builders', {id: 1, name: 'SomeBuilder', password_hash: 'a',
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
build_url: 'https://build.webkit.org/builders/$builderName/build/$buildTag'}),
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
db.insert('builders', {id: 2, name: 'SomeOtherBuilder', password_hash: 'b'})
]).then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
return TestServer.remoteAPI().getJSON('/api/manifest');
}).then((content) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(content.builders, {
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
'1': {name: 'SomeBuilder', buildUrl: 'https://build.webkit.org/builders/$builderName/build/$buildTag'},
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
'2': {name: 'SomeOtherBuilder', buildUrl: null}
});
let manifest = Manifest._didFetchManifest(content);
let builder = Builder.findById(1);
assert(builder);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(builder.name(), 'SomeBuilder');
assert.strictEqual(builder.urlForBuild(123), 'https://build.webkit.org/builders/SomeBuilder/build/123');
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
builder = Builder.findById(2);
assert(builder);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(builder.name(), 'SomeOtherBuilder');
assert.strictEqual(builder.urlForBuild(123), null);
});
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
});
it("should generate manifest with tests, metrics, and platforms", () => {
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
let db = TestServer.database();
return Promise.all([
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
db.insert('tests', {id: 1, name: 'SomeTest'}),
db.insert('tests', {id: 2, name: 'SomeOtherTest'}),
db.insert('tests', {id: 3, name: 'ChildTest', parent: 1}),
db.insert('tests', {id: 4, name: 'GrandChild', parent: 3}),
db.insert('aggregators', {id: 200, name: 'Total'}),
db.insert('test_metrics', {id: 5, test: 1, name: 'Time'}),
db.insert('test_metrics', {id: 6, test: 2, name: 'Time', aggregator: 200}),
db.insert('test_metrics', {id: 7, test: 2, name: 'Malloc', aggregator: 200}),
db.insert('test_metrics', {id: 8, test: 3, name: 'Time'}),
db.insert('test_metrics', {id: 9, test: 4, name: 'Time'}),
Refactor 'platforms' table to contain group information. https://bugs.webkit.org/show_bug.cgi?id=193132 Reviewed by Ryosuke Niwa. Group 'platforms' so that bisecting can use commit sets from other platforms which are in the same platform group. This will help to enhance the bisecting capability to higher granularity. Added admin page to manage platform groups. Updated platform admin page to allow update platform group. SQL query to update existing database: ''' BEGIN; CREATE TABLE platform_groups ( platformgroup_id serial PRIMARY KEY, platformgroup_name varchar(64) NOT NULL, CONSTRAINT platform_group_name_must_be_unique UNIQUE (platformgroup_name)); ALTER TABLE platforms ADD COLUMN platform_group integer REFERENCES platform_groups DEFAULT NULL; END; ''' * init-database.sql: Added 'platform_group' column to 'platforms' table. Added 'platform_groups' table. * migrate-database.sql: Updated migration script accordingly. * public/admin/platform-groups.php: Added a page to manage platform groups. * public/admin/platforms.php: Added support to update platform group in admin page. * public/include/admin-header.php: Added link to page that maneges platform groups. * public/include/manifest-generator.php: Added 'platformGroup' in manifest. * public/v3/index.html: Included 'platform-groups.js'. * public/v3/models/analysis-task.js: (AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Included measurement commit sets from other platforms in the same platform group. (AnalysisTask.prototype._commitSetForOtherPlatformsInSameGroup): Helper function to find measurment commit set for other platforms in same platform group. * public/v3/models/manifest.js: Added step to build 'PlatformGroup' instances. * public/v3/models/platform-group.js: Added 'PlatformGroup' to represent entries in 'platform_groups' table. (PlatformGroup): (PlatformGroup.prototype.addPlatform): (PlatformGroup.prototype.platforms): * public/v3/models/platform.js: Added itself to 'PlatformGroup' in constructor if it belongs to a group. (Platform.prototype.group): Return the platform group of current platform. * public/v3/models/time-series.js: Added helper function to show view between a given time range. (TimeSeries.prototype.viewBetweenTime): * server-tests/api-manifest-tests.js: Updated unit test to also test platform group initialization. * tools/js/database.js: Added prefix for 'platform_groups'. * tools/js/v3-models.js: Added import for platform group. Canonical link: https://commits.webkit.org/230971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-28 01:00:35 +00:00
db.insert('platform_groups', {id: 1, name: 'ios'}),
db.insert('platform_groups', {id: 2, name: 'mac'}),
db.insert('platforms', {id: 23, name: 'iOS 9 iPhone 5s', group: 1}),
db.insert('platforms', {id: 46, name: 'Trunk Mavericks', group: 2}),
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
db.insert('test_configurations', {id: 101, metric: 5, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 102, metric: 6, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 103, metric: 7, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 104, metric: 8, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 105, metric: 9, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 106, metric: 5, platform: 23, type: 'current'}),
db.insert('test_configurations', {id: 107, metric: 5, platform: 23, type: 'baseline'}),
]).then(() => {
BuildbotSyncer should be able to fetch JSON from buildbot https://bugs.webkit.org/show_bug.cgi?id=155921 Reviewed by Joseph Pecoraro. Added BuildbotSyncer.pullBuildbot which fetches pending, in-progress, and finished builds from buildbot with lots of unit tests as this has historically been a source of subtle bugs in the old script. New implementation fixes a subtle bug in the old pythons script which overlooked the possibility that the state of some builds may change between each HTTP request. In the old script, we fetched the list of the pending builds, and requested -1, -2, etc... builds for N times. But between each request, a pending build may start running or an in-progress build finish and shift the offset by one. The new script avoids this problem by first requesting all pending builds, then all in-progress and finished builds in a single HTTP request. The results are then merged so that entries for in-progress and finished builds would override the entries for pending builds if they overlap. Also renamed RemoteAPI.fetchJSON to RemoteAPI.getJSON to match v3 UI's RemoteAPI. This change makes the class interchangeable between frontend (public/v3/remote.js) and backend (tools/js/remote.js). * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry): Removed the unused argument "type". Store the syncer as an instance variable as we'd need to query for the buildbot URL. Also fixed a bug that _isInProgress was true for finished builds as 'currentStep' is always defined but null in those builds. (BuildbotBuildEntry.prototype.buildNumber): Added. (BuildbotBuildEntry.prototype.isPending): Added. (BuildbotBuildEntry.prototype.hasFinished): Added. (BuildbotSyncer.prototype.pullBuildbot): Added. Fetches pending builds first and then finished builds. (BuildbotSyncer.prototype._pullRecentBuilds): Added. Fetches in-progress and finished builds. (BuildbotSyncer.prototype.urlForPendingBuildsJSON): Added. (BuildbotSyncer.prototype.urlForBuildJSON): Added. (BuildbotSyncer.prototype.url): Added. (BuildbotSyncer.prototype.urlForBuildNumber): Added. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Renamed from fetchJSON. (RemoteAPI.prototype.getJSONWithStatus): Renamed from fetchJSONWithStatus. * tools/js/v3-models.js: Load tools/js/remote.js instead of public/v3/remote.js inside node. * unit-tests/buildbot-syncer-tests.js: Added a lot of unit tests for BuildbotSyncer.pullBuildbot (samplePendingBuild): (sampleInProgressBuild): Added. (sampleFinishedBuild): Added. * unit-tests/resources/mock-remote-api.js: (global.RemoteAPI.getJSON): Use the same mock as getJSONWithStatus. Canonical link: https://commits.webkit.org/174123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-30 03:16:29 +00:00
return TestServer.remoteAPI().getJSON('/api/manifest');
}).then((content) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(content.tests, {
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
"1": {"name": "SomeTest", "parentId": null, "url": null},
"2": {"name": "SomeOtherTest", "parentId": null, "url": null},
"3": {"name": "ChildTest", "parentId": "1", "url": null},
"4": {"name": "GrandChild", "parentId": "3", "url": null},
});
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(content.metrics, {
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
'5': {name: 'Time', test: '1', aggregator: null},
'6': {name: 'Time', test: '2', aggregator: 'Total'},
'7': {name: 'Malloc', test: '2', aggregator: 'Total'},
'8': {name: 'Time', test: '3', aggregator: null},
'9': {name: 'Time', test: '4', aggregator: null},
});
let manifest = Manifest._didFetchManifest(content);
Refactor 'platforms' table to contain group information. https://bugs.webkit.org/show_bug.cgi?id=193132 Reviewed by Ryosuke Niwa. Group 'platforms' so that bisecting can use commit sets from other platforms which are in the same platform group. This will help to enhance the bisecting capability to higher granularity. Added admin page to manage platform groups. Updated platform admin page to allow update platform group. SQL query to update existing database: ''' BEGIN; CREATE TABLE platform_groups ( platformgroup_id serial PRIMARY KEY, platformgroup_name varchar(64) NOT NULL, CONSTRAINT platform_group_name_must_be_unique UNIQUE (platformgroup_name)); ALTER TABLE platforms ADD COLUMN platform_group integer REFERENCES platform_groups DEFAULT NULL; END; ''' * init-database.sql: Added 'platform_group' column to 'platforms' table. Added 'platform_groups' table. * migrate-database.sql: Updated migration script accordingly. * public/admin/platform-groups.php: Added a page to manage platform groups. * public/admin/platforms.php: Added support to update platform group in admin page. * public/include/admin-header.php: Added link to page that maneges platform groups. * public/include/manifest-generator.php: Added 'platformGroup' in manifest. * public/v3/index.html: Included 'platform-groups.js'. * public/v3/models/analysis-task.js: (AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Included measurement commit sets from other platforms in the same platform group. (AnalysisTask.prototype._commitSetForOtherPlatformsInSameGroup): Helper function to find measurment commit set for other platforms in same platform group. * public/v3/models/manifest.js: Added step to build 'PlatformGroup' instances. * public/v3/models/platform-group.js: Added 'PlatformGroup' to represent entries in 'platform_groups' table. (PlatformGroup): (PlatformGroup.prototype.addPlatform): (PlatformGroup.prototype.platforms): * public/v3/models/platform.js: Added itself to 'PlatformGroup' in constructor if it belongs to a group. (Platform.prototype.group): Return the platform group of current platform. * public/v3/models/time-series.js: Added helper function to show view between a given time range. (TimeSeries.prototype.viewBetweenTime): * server-tests/api-manifest-tests.js: Updated unit test to also test platform group initialization. * tools/js/database.js: Added prefix for 'platform_groups'. * tools/js/v3-models.js: Added import for platform group. Canonical link: https://commits.webkit.org/230971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-28 01:00:35 +00:00
const someTest = Test.findById(1);
const someTestMetric = Metric.findById(5);
const someOtherTest = Test.findById(2);
const someOtherTestTime = Metric.findById(6);
const someOtherTestMalloc = Metric.findById(7);
const childTest = Test.findById(3);
const childTestMetric = Metric.findById(8);
const grandChildTest = Test.findById(4);
const ios9iphone5s = Platform.findById(23);
const mavericks = Platform.findById(46);
const iosGroup = PlatformGroup.findById(1);
const macGroup = PlatformGroup.findById(2);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert(someTest);
assert(someTestMetric);
assert(someOtherTest);
assert(someOtherTestTime);
assert(someOtherTestMalloc);
assert(childTest);
assert(childTestMetric);
assert(grandChildTest);
assert(ios9iphone5s);
assert(mavericks);
Refactor 'platforms' table to contain group information. https://bugs.webkit.org/show_bug.cgi?id=193132 Reviewed by Ryosuke Niwa. Group 'platforms' so that bisecting can use commit sets from other platforms which are in the same platform group. This will help to enhance the bisecting capability to higher granularity. Added admin page to manage platform groups. Updated platform admin page to allow update platform group. SQL query to update existing database: ''' BEGIN; CREATE TABLE platform_groups ( platformgroup_id serial PRIMARY KEY, platformgroup_name varchar(64) NOT NULL, CONSTRAINT platform_group_name_must_be_unique UNIQUE (platformgroup_name)); ALTER TABLE platforms ADD COLUMN platform_group integer REFERENCES platform_groups DEFAULT NULL; END; ''' * init-database.sql: Added 'platform_group' column to 'platforms' table. Added 'platform_groups' table. * migrate-database.sql: Updated migration script accordingly. * public/admin/platform-groups.php: Added a page to manage platform groups. * public/admin/platforms.php: Added support to update platform group in admin page. * public/include/admin-header.php: Added link to page that maneges platform groups. * public/include/manifest-generator.php: Added 'platformGroup' in manifest. * public/v3/index.html: Included 'platform-groups.js'. * public/v3/models/analysis-task.js: (AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Included measurement commit sets from other platforms in the same platform group. (AnalysisTask.prototype._commitSetForOtherPlatformsInSameGroup): Helper function to find measurment commit set for other platforms in same platform group. * public/v3/models/manifest.js: Added step to build 'PlatformGroup' instances. * public/v3/models/platform-group.js: Added 'PlatformGroup' to represent entries in 'platform_groups' table. (PlatformGroup): (PlatformGroup.prototype.addPlatform): (PlatformGroup.prototype.platforms): * public/v3/models/platform.js: Added itself to 'PlatformGroup' in constructor if it belongs to a group. (Platform.prototype.group): Return the platform group of current platform. * public/v3/models/time-series.js: Added helper function to show view between a given time range. (TimeSeries.prototype.viewBetweenTime): * server-tests/api-manifest-tests.js: Updated unit test to also test platform group initialization. * tools/js/database.js: Added prefix for 'platform_groups'. * tools/js/v3-models.js: Added import for platform group. Canonical link: https://commits.webkit.org/230971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-28 01:00:35 +00:00
assert(iosGroup);
assert(macGroup);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(mavericks.name(), 'Trunk Mavericks');
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert(mavericks.hasTest(someTest));
assert(mavericks.hasTest(someOtherTest));
assert(mavericks.hasTest(childTest));
assert(mavericks.hasTest(grandChildTest));
assert(mavericks.hasMetric(someTestMetric));
assert(mavericks.hasMetric(someOtherTestTime));
assert(mavericks.hasMetric(someOtherTestMalloc));
assert(mavericks.hasMetric(childTestMetric));
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(mavericks.group(), macGroup);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(ios9iphone5s.name(), 'iOS 9 iPhone 5s');
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert(ios9iphone5s.hasTest(someTest));
assert(!ios9iphone5s.hasTest(someOtherTest));
assert(!ios9iphone5s.hasTest(childTest));
assert(!ios9iphone5s.hasTest(grandChildTest));
assert(ios9iphone5s.hasMetric(someTestMetric));
assert(!ios9iphone5s.hasMetric(someOtherTestTime));
assert(!ios9iphone5s.hasMetric(someOtherTestMalloc));
assert(!ios9iphone5s.hasMetric(childTestMetric));
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(ios9iphone5s.group(), iosGroup);
Refactor 'platforms' table to contain group information. https://bugs.webkit.org/show_bug.cgi?id=193132 Reviewed by Ryosuke Niwa. Group 'platforms' so that bisecting can use commit sets from other platforms which are in the same platform group. This will help to enhance the bisecting capability to higher granularity. Added admin page to manage platform groups. Updated platform admin page to allow update platform group. SQL query to update existing database: ''' BEGIN; CREATE TABLE platform_groups ( platformgroup_id serial PRIMARY KEY, platformgroup_name varchar(64) NOT NULL, CONSTRAINT platform_group_name_must_be_unique UNIQUE (platformgroup_name)); ALTER TABLE platforms ADD COLUMN platform_group integer REFERENCES platform_groups DEFAULT NULL; END; ''' * init-database.sql: Added 'platform_group' column to 'platforms' table. Added 'platform_groups' table. * migrate-database.sql: Updated migration script accordingly. * public/admin/platform-groups.php: Added a page to manage platform groups. * public/admin/platforms.php: Added support to update platform group in admin page. * public/include/admin-header.php: Added link to page that maneges platform groups. * public/include/manifest-generator.php: Added 'platformGroup' in manifest. * public/v3/index.html: Included 'platform-groups.js'. * public/v3/models/analysis-task.js: (AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Included measurement commit sets from other platforms in the same platform group. (AnalysisTask.prototype._commitSetForOtherPlatformsInSameGroup): Helper function to find measurment commit set for other platforms in same platform group. * public/v3/models/manifest.js: Added step to build 'PlatformGroup' instances. * public/v3/models/platform-group.js: Added 'PlatformGroup' to represent entries in 'platform_groups' table. (PlatformGroup): (PlatformGroup.prototype.addPlatform): (PlatformGroup.prototype.platforms): * public/v3/models/platform.js: Added itself to 'PlatformGroup' in constructor if it belongs to a group. (Platform.prototype.group): Return the platform group of current platform. * public/v3/models/time-series.js: Added helper function to show view between a given time range. (TimeSeries.prototype.viewBetweenTime): * server-tests/api-manifest-tests.js: Updated unit test to also test platform group initialization. * tools/js/database.js: Added prefix for 'platform_groups'. * tools/js/v3-models.js: Added import for platform group. Canonical link: https://commits.webkit.org/230971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-28 01:00:35 +00:00
const macPlatforms = macGroup.platforms();
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(macPlatforms.length, 1);
assert.strictEqual(macPlatforms[0], mavericks);
Refactor 'platforms' table to contain group information. https://bugs.webkit.org/show_bug.cgi?id=193132 Reviewed by Ryosuke Niwa. Group 'platforms' so that bisecting can use commit sets from other platforms which are in the same platform group. This will help to enhance the bisecting capability to higher granularity. Added admin page to manage platform groups. Updated platform admin page to allow update platform group. SQL query to update existing database: ''' BEGIN; CREATE TABLE platform_groups ( platformgroup_id serial PRIMARY KEY, platformgroup_name varchar(64) NOT NULL, CONSTRAINT platform_group_name_must_be_unique UNIQUE (platformgroup_name)); ALTER TABLE platforms ADD COLUMN platform_group integer REFERENCES platform_groups DEFAULT NULL; END; ''' * init-database.sql: Added 'platform_group' column to 'platforms' table. Added 'platform_groups' table. * migrate-database.sql: Updated migration script accordingly. * public/admin/platform-groups.php: Added a page to manage platform groups. * public/admin/platforms.php: Added support to update platform group in admin page. * public/include/admin-header.php: Added link to page that maneges platform groups. * public/include/manifest-generator.php: Added 'platformGroup' in manifest. * public/v3/index.html: Included 'platform-groups.js'. * public/v3/models/analysis-task.js: (AnalysisTask.prototype.async.commitSetsFromTestGroupsAndMeasurementSet): Included measurement commit sets from other platforms in the same platform group. (AnalysisTask.prototype._commitSetForOtherPlatformsInSameGroup): Helper function to find measurment commit set for other platforms in same platform group. * public/v3/models/manifest.js: Added step to build 'PlatformGroup' instances. * public/v3/models/platform-group.js: Added 'PlatformGroup' to represent entries in 'platform_groups' table. (PlatformGroup): (PlatformGroup.prototype.addPlatform): (PlatformGroup.prototype.platforms): * public/v3/models/platform.js: Added itself to 'PlatformGroup' in constructor if it belongs to a group. (Platform.prototype.group): Return the platform group of current platform. * public/v3/models/time-series.js: Added helper function to show view between a given time range. (TimeSeries.prototype.viewBetweenTime): * server-tests/api-manifest-tests.js: Updated unit test to also test platform group initialization. * tools/js/database.js: Added prefix for 'platform_groups'. * tools/js/v3-models.js: Added import for platform group. Canonical link: https://commits.webkit.org/230971@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-28 01:00:35 +00:00
const iosPlatforms = iosGroup.platforms();
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(iosPlatforms.length, 1);
assert.strictEqual(iosPlatforms[0], ios9iphone5s);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(someTest.name(), 'SomeTest');
assert.ok(!someTest.parentTest());
assert.deepStrictEqual(someTest.path(), [someTest]);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert(!someTest.onlyContainsSingleMetric());
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(someTest.childTests(), [childTest]);
assert.deepStrictEqual(someTest.metrics(), [someTestMetric]);
assert.strictEqual(someTestMetric.name(), 'Time');
assert.strictEqual(someTestMetric.aggregatorName(), null);
assert.strictEqual(someTestMetric.label(), 'Time');
assert.deepStrictEqual(someTestMetric.childMetrics(), childTest.metrics());
assert.strictEqual(someTestMetric.fullName(), 'SomeTest : Time');
assert.strictEqual(someOtherTest.name(), 'SomeOtherTest');
assert.ok(!someOtherTest.parentTest());
assert.deepStrictEqual(someOtherTest.path(), [someOtherTest]);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert(!someOtherTest.onlyContainsSingleMetric());
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(someOtherTest.childTests(), []);
assert.strictEqual(someOtherTest.metrics().length, 2);
assert.strictEqual(someOtherTest.metrics()[0].name(), 'Time');
assert.strictEqual(someOtherTest.metrics()[0].aggregatorName(), 'Total');
assert.strictEqual(someOtherTest.metrics()[0].label(), 'Time : Total');
assert.strictEqual(someOtherTest.metrics()[0].childMetrics().length, 0);
assert.strictEqual(someOtherTest.metrics()[0].fullName(), 'SomeOtherTest : Time : Total');
assert.strictEqual(someOtherTest.metrics()[1].name(), 'Malloc');
assert.strictEqual(someOtherTest.metrics()[1].aggregatorName(), 'Total');
assert.strictEqual(someOtherTest.metrics()[1].label(), 'Malloc : Total');
assert.strictEqual(someOtherTest.metrics()[1].childMetrics().length, 0);
assert.strictEqual(someOtherTest.metrics()[1].fullName(), 'SomeOtherTest : Malloc : Total');
assert.strictEqual(childTest.name(), 'ChildTest');
assert.strictEqual(childTest.parentTest(), someTest);
assert.deepStrictEqual(childTest.path(), [someTest, childTest]);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert(!childTest.onlyContainsSingleMetric());
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(childTest.childTests(), [grandChildTest]);
assert.strictEqual(childTest.metrics().length, 1);
assert.strictEqual(childTest.metrics()[0].label(), 'Time');
assert.strictEqual(childTest.metrics()[0].fullName(), 'SomeTest \u220B ChildTest : Time');
assert.strictEqual(grandChildTest.name(), 'GrandChild');
assert.strictEqual(grandChildTest.parentTest(), childTest);
assert.deepStrictEqual(grandChildTest.path(), [someTest, childTest, grandChildTest]);
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
assert(grandChildTest.onlyContainsSingleMetric());
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(grandChildTest.childTests(), []);
assert.strictEqual(grandChildTest.metrics().length, 1);
assert.strictEqual(grandChildTest.metrics()[0].label(), 'Time');
assert.strictEqual(grandChildTest.metrics()[0].fullName(), 'SomeTest \u220B ChildTest \u220B GrandChild : Time');
});
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
});
it("should generate manifest with triggerables", () => {
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
let db = TestServer.database();
return Promise.all([
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
db.insert('repositories', {id: 11, name: 'WebKit', url: 'https://trac.webkit.org/$1'}),
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
db.insert('repositories', {id: 9, name: 'macOS'}),
db.insert('repositories', {id: 16, name: 'Shared'}),
Add the ability to report a commit with sub-commits. https://bugs.webkit.org/show_bug.cgi?id=168962 Reviewed by Ryosuke Niwa. Introduce 'commit_ownerships' which records ownership between commits. On existing production server, run ``` CREATE TABLE commit_ownerships ( commit_owner integer NOT NULL REFERENCES commits ON DELETE CASCADE, commit_ownee integer NOT NULL REFERENCES commits ON DELETE CASCADE, PRIMARY KEY (commit_owner, commit_ownee) ); ALTER TABLE repositories RENAME repository_parent TO repository_owner; ALTER TABLE repositories DROP repository_name_must_be_unique; CREATE UNIQUE INDEX repository_name_owner_unique_index ON repositories (repository_owner, repository_name) WHERE repository_owner IS NOT NULL; CREATE UNIQUE INDEX repository_name_unique_index ON repositories (repository_name) WHERE repository_owner IS NULL; ``` to update database. Add unit-tests to cover this change. * init-database.sql: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: * public/include/manifest-generator.php: * public/include/report-processor.php: * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): * server-tests/admin-reprocess-report-tests.js: (addBuilderForReport.simpleReportWithRevisions.0.then): (then): * server-tests/api-manifest.js: (then): * server-tests/api-report-commits-tests.js: (addSlaveForReport.sameRepositoryNameInSubCommitAndMajorCommit.then): (then): (addSlaveForReport.systemVersionCommitWithSubcommits.then): (addSlaveForReport.multipleSystemVersionCommitsWithSubcommits.then): (addSlaveForReport.systemVersionCommitWithEmptySubcommits.then): (addSlaveForReport.systemVersionCommitAndSubcommitWithTimestamp.then): * tools/js/database.js: Canonical link: https://commits.webkit.org/186535@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-13 09:10:29 +00:00
db.insert('repositories', {id: 101, name: 'WebKit', owner: 9, url: 'https://trac.webkit.org/$1'}),
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
db.insert('build_triggerables', {id: 200, name: 'build.webkit.org'}),
db.insert('build_triggerables', {id: 201, name: 'ios-build.webkit.org'}),
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
db.insert('build_triggerables', {id: 202, name: 'mac-build.webkit.org', disabled: true}),
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
db.insert('tests', {id: 1, name: 'SomeTest'}),
db.insert('tests', {id: 2, name: 'SomeOtherTest'}),
db.insert('tests', {id: 3, name: 'ChildTest', parent: 1}),
db.insert('platforms', {id: 23, name: 'iOS 9 iPhone 5s'}),
db.insert('platforms', {id: 46, name: 'Trunk Mavericks'}),
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
db.insert('platforms', {id: 104, name: 'Trunk Sierra MacBookPro11,2'}),
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
db.insert('test_metrics', {id: 5, test: 1, name: 'Time'}),
db.insert('test_metrics', {id: 8, test: 2, name: 'FrameRate'}),
db.insert('test_metrics', {id: 9, test: 3, name: 'Time'}),
db.insert('test_configurations', {id: 101, metric: 5, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 102, metric: 8, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 103, metric: 9, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 104, metric: 5, platform: 23, type: 'current'}),
db.insert('test_configurations', {id: 105, metric: 8, platform: 23, type: 'current'}),
db.insert('test_configurations', {id: 106, metric: 9, platform: 23, type: 'current'}),
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
db.insert('test_configurations', {id: 107, metric: 5, platform: 104, type: 'current'}),
db.insert('test_configurations', {id: 108, metric: 8, platform: 104, type: 'current'}),
db.insert('test_configurations', {id: 109, metric: 9, platform: 104, type: 'current'}),
db.insert('triggerable_repository_groups', {id: 300, triggerable: 200, name: 'default'}),
db.insert('triggerable_repository_groups', {id: 301, triggerable: 201, name: 'default'}),
db.insert('triggerable_repository_groups', {id: 302, triggerable: 202, name: 'system-and-webkit'}),
db.insert('triggerable_repository_groups', {id: 303, triggerable: 202, name: 'system-and-roots', accepts_roots: true}),
db.insert('triggerable_repository_groups', {id: 304, triggerable: 202, name: 'webkit-and-shared', hidden: true}),
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
db.insert('triggerable_repositories', {group: 300, repository: 11}),
db.insert('triggerable_repositories', {group: 301, repository: 11}),
db.insert('triggerable_repositories', {group: 302, repository: 11}),
db.insert('triggerable_repositories', {group: 304, repository: 11}),
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
db.insert('triggerable_repositories', {group: 302, repository: 9}),
db.insert('triggerable_repositories', {group: 303, repository: 9}),
db.insert('triggerable_repositories', {group: 304, repository: 16}),
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
db.insert('triggerable_configurations', {triggerable: 200, test: 1, platform: 46}),
db.insert('triggerable_configurations', {triggerable: 200, test: 2, platform: 46}),
db.insert('triggerable_configurations', {triggerable: 201, test: 1, platform: 23}),
db.insert('triggerable_configurations', {triggerable: 201, test: 2, platform: 23}),
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
db.insert('triggerable_configurations', {triggerable: 202, test: 1, platform: 104}),
db.insert('triggerable_configurations', {triggerable: 202, test: 2, platform: 104}),
]).then(() => {
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
return Manifest.fetch();
}).then(() => {
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const webkit = Repository.findById(11);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(webkit.name(), 'WebKit');
assert.strictEqual(webkit.urlForRevision(123), 'https://trac.webkit.org/123');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const osWebkit1 = Repository.findById(101);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(osWebkit1.name(), 'WebKit');
assert.strictEqual(parseInt(osWebkit1.ownerId()), 9);
assert.strictEqual(osWebkit1.urlForRevision(123), 'https://trac.webkit.org/123');
Add the ability to report a commit with sub-commits. https://bugs.webkit.org/show_bug.cgi?id=168962 Reviewed by Ryosuke Niwa. Introduce 'commit_ownerships' which records ownership between commits. On existing production server, run ``` CREATE TABLE commit_ownerships ( commit_owner integer NOT NULL REFERENCES commits ON DELETE CASCADE, commit_ownee integer NOT NULL REFERENCES commits ON DELETE CASCADE, PRIMARY KEY (commit_owner, commit_ownee) ); ALTER TABLE repositories RENAME repository_parent TO repository_owner; ALTER TABLE repositories DROP repository_name_must_be_unique; CREATE UNIQUE INDEX repository_name_owner_unique_index ON repositories (repository_owner, repository_name) WHERE repository_owner IS NOT NULL; CREATE UNIQUE INDEX repository_name_unique_index ON repositories (repository_name) WHERE repository_owner IS NULL; ``` to update database. Add unit-tests to cover this change. * init-database.sql: * public/api/report-commits.php: * public/include/commit-log-fetcher.php: * public/include/db.php: * public/include/manifest-generator.php: * public/include/report-processor.php: * public/v3/models/repository.js: (Repository): (Repository.prototype.owner): * server-tests/admin-reprocess-report-tests.js: (addBuilderForReport.simpleReportWithRevisions.0.then): (then): * server-tests/api-manifest.js: (then): * server-tests/api-report-commits-tests.js: (addSlaveForReport.sameRepositoryNameInSubCommitAndMajorCommit.then): (then): (addSlaveForReport.systemVersionCommitWithSubcommits.then): (addSlaveForReport.multipleSystemVersionCommitsWithSubcommits.then): (addSlaveForReport.systemVersionCommitWithEmptySubcommits.then): (addSlaveForReport.systemVersionCommitAndSubcommitWithTimestamp.then): * tools/js/database.js: Canonical link: https://commits.webkit.org/186535@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-13 09:10:29 +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
const macos = Repository.findById(9);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(macos.name(), 'macOS');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
const shared = Repository.findById(16);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(shared.name(), 'Shared');
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const someTest = Test.findById(1);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(someTest.name(), 'SomeTest');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const someOtherTest = Test.findById(2);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(someOtherTest.name(), 'SomeOtherTest');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const childTest = Test.findById(3);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(childTest.name(), 'ChildTest');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const ios9iphone5s = Platform.findById(23);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(ios9iphone5s.name(), 'iOS 9 iPhone 5s');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const mavericks = Platform.findById(46);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(mavericks.name(), 'Trunk Mavericks');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const sierra = Platform.findById(104);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(sierra.name(), 'Trunk Sierra MacBookPro11,2');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(Triggerable.all().length, 3);
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +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
const macosTriggerable = Triggerable.findByTestConfiguration(someTest, mavericks);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(macosTriggerable.name(), 'build.webkit.org');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(Triggerable.findByTestConfiguration(someOtherTest, mavericks), macosTriggerable);
assert.strictEqual(Triggerable.findByTestConfiguration(childTest, mavericks), macosTriggerable);
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const iosTriggerable = Triggerable.findByTestConfiguration(someOtherTest, ios9iphone5s);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.notStrictEqual(iosTriggerable, macosTriggerable);
assert.strictEqual(iosTriggerable.name(), 'ios-build.webkit.org');
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(Triggerable.findByTestConfiguration(someOtherTest, ios9iphone5s), iosTriggerable);
assert.strictEqual(Triggerable.findByTestConfiguration(childTest, ios9iphone5s), iosTriggerable);
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const macTriggerable = Triggerable.findByTestConfiguration(someTest, sierra);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(macTriggerable.name(), 'mac-build.webkit.org');
assert(macTriggerable.acceptedTests().has(someTest));
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
const groups = macTriggerable.repositoryGroups();
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(groups.length, 3);
Introduce the notion of repository groups to triggerables https://bugs.webkit.org/show_bug.cgi?id=170228 Reviewed by Chris Dumez. On some triggerable, it's desirable to specify multiple sets of repositories that are accepted. For example, if a repository X transitioned from Subversion to Git, and if a triggerable accepted X and some other repository Y, then it's desirable to two sets: (X-Subversion, Y) and (X-Git, Y) since neither (X-Subversion, X-Git) nor (X-Subversion, X-Git, Y) makes sense as a set. This patch introduces triggerable_repository_groups table to represent a set of repositories accepted by a triggerable. It has many to one relationship to build_triggerables and triggerable_repositories in turn now has many to one relationship to triggerable_repository_groups instead of build_triggerables. Also make it possible to disable a triggerable e.g. a set of tests and platforms are no longer supported. We don't want to delete the triggerable completely from the database since it would result in the associated A/B testing results being purged, which is not desirale. To migrate an existing database, run the following transaction: ```sql BEGIN; ALTER TABLE build_triggerables ADD COLUMN triggerable_disabled boolean NOT NULL DEFAULT FALSE; CREATE TABLE triggerable_repository_groups ( repositorygroup_id serial PRIMARY KEY, repositorygroup_triggerable integer REFERENCES build_triggerables NOT NULL, repositorygroup_name varchar(256) NOT NULL, repositorygroup_description varchar(256), repositorygroup_accepts_roots boolean NOT NULL DEFAULT FALSE, CONSTRAINT repository_group_name_must_be_unique_for_triggerable UNIQUE(repositorygroup_triggerable, repositorygroup_name)); INSERT INTO triggerable_repository_groups (repositorygroup_triggerable, repositorygroup_name) SELECT triggerable_id, 'default' FROM build_triggerables; ALTER TABLE triggerable_repositories ADD COLUMN trigrepo_group integer REFERENCES triggerable_repository_groups; UPDATE triggerable_repositories SET trigrepo_group = repositorygroup_id FROM triggerable_repository_groups WHERE trigrepo_triggerable = repositorygroup_triggerable; ALTER TABLE triggerable_repositories ALTER COLUMN trigrepo_group SET NOT NULL; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_triggerable; ALTER TABLE triggerable_repositories DROP COLUMN trigrepo_sub_roots; END; ``` * init-database.sql: * public/admin/triggerables.php: Use a custom column to make forms to add and configure repository groups. (insert_triggerable_repositories): Added. (generate_repository_list): Added. (generate_repository_form): Added. (generate_repository_checkboxes): Now generates checkboxes for a repository group instead of a triggerable. * public/include/manifest-generator.php: (fetch_triggerables): Fixed the bug that we were not filtering results with query in /api/triggerable. Rewrote it to include an array of repository groups, which in turn contains an array of repositories along with its name and a description, and a boolean indicating whether it accepts a custom root file or not. The boolean will be used when we're adding the support for perf try bots. We will keep acceptedRepositories since it's still used by detect-changes.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Resolve repositoriy, test, and platform IDs to their respective objects. * public/v3/models/triggerable.js: (Triggerable): (Triggerable.prototype.isDisabled): Added. (Triggerable.prototype.repositoryGroups): Added. (Triggerable.prototype.acceptsTest): Added. (TriggerableRepositoryGroup): Added. (TriggerableRepositoryGroup.prototype.description): Added. (TriggerableRepositoryGroup.prototype.acceptsCustomRoots): Added. (TriggerableRepositoryGroup.prototype.repositories): Added. * public/v3/pages/analysis-task-page.js: (AnalysisTaskPage.prototype._didFetchTask): Don't use a disabled triggerable. * server-tests/api-manifest-tests.js: Updated a test case to test repository groups. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repository_groups. * tools/js/v3-models.js: Imported TriggerableRepositoryGroup from triggerable.js. Canonical link: https://commits.webkit.org/187454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-05 23:12:46 +00:00
TriggerableRepositoryGroup.sortByName(groups);
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 emptyCustomSet = new CustomCommitSet;
const customSetWithOSX = new CustomCommitSet;
customSetWithOSX.setRevisionForRepository(macos, '10.11 15A284');
const cusomSetWithOSXAndWebKit = new CustomCommitSet;
cusomSetWithOSXAndWebKit.setRevisionForRepository(webkit, '191622');
cusomSetWithOSXAndWebKit.setRevisionForRepository(macos, '10.11 15A284');
const cusomSetWithWebKit = new CustomCommitSet;
cusomSetWithWebKit.setRevisionForRepository(webkit, '191622');
const cusomSetWithWebKitAndShared = new CustomCommitSet;
cusomSetWithWebKitAndShared.setRevisionForRepository(webkit, '191622');
cusomSetWithWebKitAndShared.setRevisionForRepository(shared, '86456');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(groups[0].name(), 'system-and-roots');
assert.strictEqual(groups[0].isHidden(), false);
assert.strictEqual(groups[0].acceptsCustomRoots(), true);
assert.deepStrictEqual(Repository.sortByName(groups[0].repositories()), [macos]);
assert.strictEqual(groups[0].accepts(emptyCustomSet), false);
assert.strictEqual(groups[0].accepts(customSetWithOSX), true);
assert.strictEqual(groups[0].accepts(cusomSetWithOSXAndWebKit), false);
assert.strictEqual(groups[0].accepts(cusomSetWithWebKitAndShared), false);
assert.strictEqual(groups[0].accepts(cusomSetWithWebKit), false);
assert.strictEqual(groups[1].name(), 'system-and-webkit');
assert.strictEqual(groups[1].isHidden(), false);
assert.strictEqual(groups[1].acceptsCustomRoots(), false);
assert.deepStrictEqual(Repository.sortByName(groups[1].repositories()), [webkit, macos]);
assert.strictEqual(groups[1].accepts(emptyCustomSet), false);
assert.strictEqual(groups[1].accepts(customSetWithOSX), false);
assert.strictEqual(groups[1].accepts(cusomSetWithOSXAndWebKit), true);
assert.strictEqual(groups[1].accepts(cusomSetWithWebKitAndShared), false);
assert.strictEqual(groups[1].accepts(cusomSetWithWebKit), false);
assert.strictEqual(groups[2].name(), 'webkit-and-shared');
assert.strictEqual(groups[2].isHidden(), true);
assert.strictEqual(groups[2].acceptsCustomRoots(), false);
assert.deepStrictEqual(Repository.sortByName(groups[2].repositories()), [shared, webkit]);
assert.strictEqual(groups[2].accepts(emptyCustomSet), false);
assert.strictEqual(groups[2].accepts(customSetWithOSX), false);
assert.strictEqual(groups[2].accepts(cusomSetWithOSXAndWebKit), false);
assert.strictEqual(groups[2].accepts(cusomSetWithWebKitAndShared), true);
assert.strictEqual(groups[2].accepts(cusomSetWithWebKit), false);
});
Hide the UI to trigger an A/B testing when there are no triggerables https://bugs.webkit.org/show_bug.cgi?id=166964 Reviewed by Yusuke Suzuki. Hide the "Start A/B Testing" button on analysis task pages instead of showing it and failing later when the user tries to create one it with a TriggerableNotFound error. Added the list of triggerables to the manifest JSON so that we can determine this condition without having to fetch /api/triggerable for each analysis task as done in v2 UI. * public/admin/reprocess-report.php: * public/api/manifest.php: * public/api/report.php: * public/include/admin-header.php: * public/include/manifest-generator.php: Moved from public/include/manifest.php. (ManifestGenerator::generate): (ManifestGenerator::triggerables): Added. Include the list of repositories this triggerable accepts as well as the list of (test, platform) pairs on which this triggerable is available. Use [testId, platformId] instead of a dictionary to reduce the file size. * public/v3/components/customizable-test-group-form.js: (CustomizableTestGroupForm): Removed this._disabled. This variable was used in TestGroupFrom to disable the "Start A/B Testing" button when no range is selected but this ended up racy. Compute the visibility of the button in render() function instead. (CustomizableTestGroupForm.prototype.setRootSetMap): (CustomizableTestGroupForm.prototype._submitted): (CustomizableTestGroupForm.prototype.render): Hide the customize link and the button as needed. The "Start A/B Testing" button must be hidden when either no range is selected or no title is typed. "Customize" button must be hidden when no range is selected. * public/v3/components/test-group-form.js: (TestGroupForm): Removed _disabled since it's no longer used. (TestGroupForm.prototype.setDisabled): Ditto. (TestGroupForm.prototype.render): Ditto. * public/v3/index.html: Include triggerable.js. * public/v3/models/manifest.js: (Manifest._didFetchManifest): Modernized. Create Triggerable objects from the manifest JSON. * public/v3/models/triggerable.js: Added. (Triggerable): Add this triggerable object to the static map of (test id, platform id) pair. (Triggerable.prototype.acceptedRepositories): Added. (Triggerable.findByTestConfiguration): Added. Finds a triggerable in the aforementioned static map. * public/v3/pages/analysis-task-page.js: (AnalysisTaskChartPane.prototype._updateStatus): Added. Re-render the page since time series data points that were previously not available may have become available. The lack of this update was causing a race condition in which the "Start A/B Testing" button for the charts is disabled even after a group name had been specified because setRootSetMap was never called with a valid set. (AnalysisTaskPage): Added this._triggerable. (AnalysisTaskPage.prototype._didFetchTask): Find the triggerable now that we've fetched the task. (AnalysisTaskPage.prototype.render): Hide the group view (the table of A/B testing results) entirely when there are no groups to show. Also hide the forms to start A/B testing when there are no matching triggerable, which is the main feature of this patch. * server-tests/api-manifest.js: Added a test for including a list of triggerables in the manifest JSON. * server-tests/resources/mock-data.js: (MockData.resetV3Models): Reset Triggerable's static map. * server-tests/tools-buildbot-triggerable-tests.js: Assert that Triggerable objects are constructed with appropriate list of repositories and (test, platform) associations. * tools/js/database.js: (tableToPrefixMap): Added triggerable_repositories's prefix. * tools/js/remote.js: (RemoteAPI.prototype.getJSON): Log the entire response to stderr when JSON.parse fails to aid debugging. * tools/js/v3-models.js: Import triggerable.js. Canonical link: https://commits.webkit.org/184066@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-12 07:18:28 +00:00
});
Migrate admin-regenerate-manifest.js to mocha.js and test v3 UI code https://bugs.webkit.org/show_bug.cgi?id=155863 Reviewed by Joseph Pecoraro. Replaced admin-regenerate-manifest.js by a new mocha.js tests using the new server testing capability added in r198642 and tested v3 UI code (parsing manifest.json and creating models). Also removed /admin/regenerate-manifest since it has been superseded by /api/manifest. This patch also extracts manifest.js out of main.js so that it could be used and tested without the DOM support in node. * public/admin/regenerate-manifest.php: Deleted. * public/include/db.php: Fixed a regression from r198642 since CONFIG_DIR now doesn't end with a trailing backslash. * public/include/manifest.php: (ManifestGenerator::bug_trackers): Avoid a warning message when there are no repositories. * public/v3/index.html: * public/v3/main.js: (main): * public/v3/models/bug-tracker.js: (BugTracker.prototype.newBugUrl): Added. (BugTracker.prototype.repositories): Added. * public/v3/models/manifest.js: Added. Extracted from main.js. (Manifest.fetch): Moved from main.js' fetchManifest. (Manifest._didFetchManifest): Moved from main.js' didFetchManifest. * public/v3/models/platform.js: (Platform.prototype.hasTest): Fixed the bug that "test" here was shadowing the function parameter of the same name. This is tested by the newly added test cases. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Added. Migrated test cases from tests/admin-regenerate-manifest.js with additional assertions for v3 UI model objects. * server-tests/resources/test-server.js: (TestServer.prototype.start): (TestServer.prototype.testConfig): Renamed from _constructTestConfig now that this is a public API. Also no longer takes dataDirectory as an argument since it's always the same. (TestServer.prototype._ensureDataDirectory): Fixed a bug that we weren't making public/data. (TestServer.prototype.cleanDataDirectory): Added. Remove all files inside public/data between tests. (TestServer.prototype.inject): Added. Calls before, etc... because always calling before had an unintended side effect of slowing down unit tests even through they don't need Postgres or Apache. * tests/admin-regenerate-manifest.js: Removed. * tools/js/database.js: * tools/js/v3-models.js: Canonical link: https://commits.webkit.org/173998@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-25 21:55:34 +00:00
});