haikuwebkit/Websites/perf.webkit.org/server-tests/admin-platforms-tests.js

142 lines
7.5 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 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
const submitReport = require('./resources/common-operations.js').submitReport;
describe("/admin/platforms", 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
function reportsForDifferentPlatforms()
{
return [
{
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": "3001",
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-28T09:01:47",
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mavericks",
"tests": {"test": { "metrics": {"FrameRate": { "current": [[1, 1, 1], [1, 1, 1]] } } } },
},
{
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": "3001",
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": [[2, 2, 2], [2, 2, 2]] }, "Combined": { "current": [[3, 3, 3], [3, 3, 3]] }} } },
},
{
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": "3003",
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-28T12:56:26",
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Trunk Mountain Lion",
"tests": {"test": { "metrics": {"FrameRate": { "current": [[4, 4, 4], [4, 4, 4]] } } } }
}];
}
it("should delete the platform that got merged into another one", () => {
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 db = TestServer.database();
let oldPlatforms;
return submitReport(reportsForDifferentPlatforms()).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('platforms', 'name');
}).then((platforms) => {
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
oldPlatforms = platforms;
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(oldPlatforms.length, 3);
assert.strictEqual(oldPlatforms[0]['name'], 'Mavericks');
assert.strictEqual(oldPlatforms[1]['name'], 'Mountain Lion');
assert.strictEqual(oldPlatforms[2]['name'], 'Trunk Mountain Lion');
}).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().postFormUrlencodedData('/admin/platforms.php',
{'action': 'merge', 'id': oldPlatforms[1]['id'], 'destination': oldPlatforms[2]['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('platforms');
}).then((newPlatforms) => {
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(newPlatforms.length, 2);
assert.deepStrictEqual(newPlatforms[0], oldPlatforms[0]);
assert.deepStrictEqual(newPlatforms[1], oldPlatforms[2]);
});
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 move test runs from the merged platform to the destination platform", () => {
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 oldTestRuns;
const queryForRuns = 'SELECT * FROM test_runs, test_configurations, platforms WHERE run_config = config_id AND config_platform = platform_id ORDER by run_mean_cache';
const db = TestServer.database();
return submitReport(reportsForDifferentPlatforms()).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.query(queryForRuns);
}).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
oldTestRuns = result.rows;
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(oldTestRuns.length, 4);
assert.strictEqual(oldTestRuns[0]['platform_name'], 'Mavericks');
assert.strictEqual(oldTestRuns[0]['run_sum_cache'], 6);
assert.strictEqual(oldTestRuns[1]['platform_name'], 'Mountain Lion');
assert.strictEqual(oldTestRuns[1]['run_sum_cache'], 12);
assert.strictEqual(oldTestRuns[2]['platform_name'], 'Mountain Lion');
assert.strictEqual(oldTestRuns[2]['run_sum_cache'], 18);
assert.strictEqual(oldTestRuns[3]['platform_name'], 'Trunk Mountain Lion');
assert.strictEqual(oldTestRuns[3]['run_sum_cache'], 24);
}).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().postFormUrlencodedData('/admin/platforms.php',
{'action': 'merge', 'id': oldTestRuns[1]['platform_id'], 'destination': oldTestRuns[3]['platform_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.query(queryForRuns);
}).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 newTestRuns = result.rows;
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(newTestRuns.length, 4);
assert.strictEqual(newTestRuns[0]['run_id'], oldTestRuns[0]['run_id']);
assert.strictEqual(newTestRuns[0]['platform_name'], 'Mavericks');
assert.strictEqual(newTestRuns[0]['run_sum_cache'], 6);
assert.strictEqual(newTestRuns[1]['run_id'], oldTestRuns[1]['run_id']);
assert.strictEqual(newTestRuns[1]['platform_name'], 'Trunk Mountain Lion');
assert.strictEqual(newTestRuns[1]['run_sum_cache'], 12);
assert.strictEqual(newTestRuns[2]['run_id'], oldTestRuns[2]['run_id']);
assert.strictEqual(newTestRuns[2]['platform_name'], 'Trunk Mountain Lion');
assert.strictEqual(newTestRuns[2]['run_sum_cache'], 18);
assert.strictEqual(newTestRuns[3]['run_id'], oldTestRuns[3]['run_id']);
assert.strictEqual(newTestRuns[3]['platform_name'], 'Trunk Mountain Lion');
assert.strictEqual(newTestRuns[3]['run_sum_cache'], 24);
assert.strictEqual(newTestRuns[1]['run_config'], newTestRuns[3]['run_config']);
});
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 move test configurations from the merged platform to the destination platform", () => {
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 oldConfigs;
const reports = reportsForDifferentPlatforms();
reports[0]['tests'] = {"test": { "metrics": {"FrameRate": { "baseline": [[1, 1, 1], [1, 1, 1]] } } } };
const queryForConfig = 'SELECT * from test_configurations, platforms, test_metrics'
+ ' where config_platform = platform_id and config_metric = metric_id and platform_name in ($1, $2) order by config_id';
const db = TestServer.database();
return submitReport(reports).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.query(queryForConfig, [reports[0]['platform'], reports[2]['platform']]);
}).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
oldConfigs = result.rows;
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(oldConfigs.length, 2);
assert.strictEqual(oldConfigs[0]['platform_name'], reports[0]['platform']);
assert.strictEqual(oldConfigs[0]['metric_name'], 'FrameRate');
assert.strictEqual(oldConfigs[0]['config_type'], 'baseline');
assert.strictEqual(oldConfigs[1]['platform_name'], reports[2]['platform']);
assert.strictEqual(oldConfigs[1]['metric_name'], 'FrameRate');
assert.strictEqual(oldConfigs[1]['config_type'], 'current');
}).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().postFormUrlencodedData('/admin/platforms.php',
{'action': 'merge', 'id': oldConfigs[0]['platform_id'], 'destination': oldConfigs[1]['platform_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.query(queryForConfig, [reports[0]['platform'], reports[2]['platform']]);
}).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 newConfigs = result.rows;
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(newConfigs.length, 2);
assert.strictEqual(newConfigs[0]['platform_name'], reports[2]['platform']);
assert.strictEqual(newConfigs[0]['metric_name'], 'FrameRate');
assert.strictEqual(newConfigs[0]['config_type'], 'baseline');
assert.strictEqual(newConfigs[1]['platform_name'], reports[2]['platform']);
assert.strictEqual(newConfigs[1]['metric_name'], 'FrameRate');
assert.strictEqual(newConfigs[1]['config_type'], 'current');
});
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
});
});