haikuwebkit/Websites/perf.webkit.org/server-tests/admin-reprocess-report-test...

120 lines
4.9 KiB
JavaScript
Raw Permalink Normal View History

Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
'use strict';
const assert = require('assert');
const TestServer = require('./resources/test-server.js');
const addBuilderForReport = require('./resources/common-operations.js').addBuilderForReport;
const prepareServerTest = require('./resources/common-operations.js').prepareServerTest;
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
describe("/admin/reprocess-report", function () {
prepareServerTest(this);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
const simpleReport = [{
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
"buildTag": "1986",
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
"buildTime": "2013-02-28T10:12:03",
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"test": {
"metrics": {"FrameRate": { "current": [[1, 2, 3], [4, 5, 6]] }}
},
},
}];
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
const simpleReportWithRevisions = [{
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
"buildTag": "1986",
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
"buildTime": "2013-02-28T10:12:03",
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"test": {
"metrics": {"FrameRate": { "current": [[1, 2, 3], [4, 5, 6]] }}
},
},
"revisions": {
"WebKit": {
"timestamp": "2017-03-01T09:38:44.826833Z",
"revision": "213214"
}
}
}];
it("should still create new repository when repository ownerships are different", () => {
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
let db = TestServer.database();
return addBuilderForReport(simpleReportWithRevisions[0]).then(() => {
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
return db.insert('repositories', {'name': 'WebKit', 'owner': 1});
}).then(() => {
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
return TestServer.remoteAPI().postJSON('/api/report/', simpleReportWithRevisions);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Add 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
return db.selectRows('repositories', {'name': 'WebKit'});
}).then((repositories) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-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(repositories.length, 2);
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
const webkitRepsitoryId = repositories[0].owner == 1 ? repositories[1].id : repositories[0].id;
return db.selectRows('commits', {'revision': '213214', 'repository': webkitRepsitoryId});
}).then((result) => {
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
assert(result.length, 1);
});
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
});
it("should add build", () => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
let db = TestServer.database();
let reportId;
return addBuilderForReport(simpleReport[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', simpleReport);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return Promise.all([db.selectAll('builds'), db.selectAll('reports')]);
}).then((result) => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
const builds = result[0];
const reports = result[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(builds.length, 1);
assert.strictEqual(builds[0]['tag'], '1986');
assert.strictEqual(reports.length, 1);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
reportId = reports[0]['id'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-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(reports[0]['build_tag'], '1986');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return db.query('UPDATE reports SET report_build = NULL; DELETE FROM builds');
}).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return db.selectAll('builds');
}).then((builds) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-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(builds.length, 0);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().getJSONWithStatus(`/admin/reprocess-report?report=${reportId}`);
}).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return db.selectAll('builds');
}).then((builds) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-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(builds.length, 1);
assert.strictEqual(builds[0]['tag'], '1986');
});
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
});
it("should not duplicate the reprocessed report", () => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
let db = TestServer.database();
let originalReprot;
return addBuilderForReport(simpleReport[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', simpleReport);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return db.selectAll('reports');
}).then((reports) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-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(reports.length, 1);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
originalReprot = reports[0];
return db.query('UPDATE reports SET report_build = NULL; DELETE FROM builds');
}).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().getJSONWithStatus(`/admin/reprocess-report?report=${originalReprot['id']}`);
}).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return db.selectAll('reports');
}).then((reports) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-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(reports.length, 1);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
const newPort = reports[0];
originalReprot['committed_at'] = null;
newPort['committed_at'] = 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.notStrictEqual(originalReprot['build'], newPort['build']);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
originalReprot['build'] = null;
newPort['build'] = 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(originalReprot, newPort);
});
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
});
});