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

830 lines
36 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');
require('../tools/js/v3-models.js');
const MockData = require('./resources/mock-data.js');
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 TestServer = require('./resources/test-server.js');
const addBuilderForReport = require('./resources/common-operations.js').addBuilderForReport;
const prepareServerTest = require('./resources/common-operations.js').prepareServerTest;
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
describe("/api/measurement-set", 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 queryPlatformAndMetric(platformName, metricName)
{
const db = TestServer.database();
return Promise.all([
db.selectFirstRow('platforms', {name: platformName}),
db.selectFirstRow('test_metrics', {name: metricName}),
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
]).then(function (result) {
return {platformId: result[0]['id'], metricId: result[1]['id']};
});
}
function format(formatMap, row)
{
var result = {};
for (var i = 0; i < formatMap.length; i++) {
var key = formatMap[i];
if (key == 'id' || key == 'build' || key == 'builder')
continue;
result[key] = row[i];
}
return result;
}
let clusterStart = TestServer.testConfig().clusterStart;
clusterStart = +Date.UTC(clusterStart[0], clusterStart[1] - 1, clusterStart[2], clusterStart[3], clusterStart[4]);
let clusterSize = TestServer.testConfig().clusterSize;
const DAY = 24 * 3600 * 1000;
const YEAR = 365.24 * DAY;
const MONTH = 30 * DAY;
clusterSize = clusterSize[0] * YEAR + clusterSize[1] * MONTH + clusterSize[2] * DAY;
function clusterTime(index) { return new Date(clusterStart + clusterSize * index); }
const reportWithBuildTime = [{
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": "123",
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": clusterTime(7.8).toISOString(),
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "current": [1, 2, 3, 4, 5] }}
},
}
},
}}];
reportWithBuildTime.startTime = +clusterTime(7);
const reportWithRevision = [{
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": "124",
"buildTime": "2013-02-28T15:34:51Z",
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
"revisions": {
"WebKit": {
"revision": "144000",
"timestamp": clusterTime(10.35645364537).toISOString(),
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
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "current": [11, 12, 13, 14, 15] }}
}
}
},
}}];
const reportWithRevisionIdentifier = [{
"buildTag": "124",
"buildTime": "2013-02-28T15:34:51Z",
"revisions": {
"WebKit": {
"revision": "144000",
"revisionIdentifier": "129103@main",
"timestamp": clusterTime(10.35645364537).toISOString(),
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "current": [11, 12, 13, 14, 15] }}
}
}
},
}}];
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 reportWithNewRevision = [{
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": "125",
"buildTime": "2013-02-28T21:45:17Z",
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
"revisions": {
"WebKit": {
"revision": "160609",
"timestamp": clusterTime(12.1).toISOString()
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "current": [16, 17, 18, 19, 20] }}
}
}
},
}}];
const reportWithAncientRevision = [{
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": "126",
"buildTime": "2013-02-28T23:07:25Z",
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
"revisions": {
"WebKit": {
"revision": "137793",
"timestamp": clusterTime(1.8).toISOString()
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "current": [21, 22, 23, 24, 25] }}
}
}
},
}}];
const secondReportWithRevision = [{
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": "127",
"buildTime": "2013-02-28T23:07:25Z",
"revisions": {
"WebKit": {
"revision": "137794",
"timestamp": clusterTime(11.1).toISOString()
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "current": [21, 22, 23, 24, 25] }}
}
}
},
}}];
const thirdReportWithRevision = [{
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": "128",
"buildTime": "2013-02-28T23:07:25Z",
"revisions": {
"WebKit": {
"revision": "137795",
"timestamp": clusterTime(11.2).toISOString()
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "current": [21, 22, 23, 24, 25] }}
}
}
},
}}];
const reportBaselineWithRevision = [{
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": "129",
"buildTime": "2013-02-28T15:35:51Z",
"revisions": {
"WebKit": {
"revision": "144001",
"timestamp": clusterTime(13.35645364537).toISOString(),
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "baseline": [11, 12, 13, 14, 15] }}
}
}
},
}}];
const secondReportBaselineWithRevision = [{
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": "130",
"buildTime": "2013-02-28T23:01:25Z",
"revisions": {
"WebKit": {
"revision": "137784",
"timestamp": clusterTime(11.12).toISOString()
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "baseline": [21, 22, 23, 24, 25] }}
}
}
},
}}];
const thirdReportBaselineWithRevision = [{
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": "131",
"buildTime": "2013-02-28T23:01:25Z",
"revisions": {
"WebKit": {
"revision": "137884",
"timestamp": clusterTime(11.22).toISOString()
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"Suite": {
"tests": {
"test1": {
"metrics": {"Time": { "baseline": [21, 22, 23, 24, 25] }}
}
}
},
}}];
it("should reject when platform ID is missing", () => {
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', reportWithBuildTime);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
return TestServer.remoteAPI().getJSON(`/api/measurement-set/?metric=${result.metricId}`);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'AmbiguousRequest');
});
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 reject when metric ID is missing", () => {
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', reportWithBuildTime);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
return TestServer.remoteAPI().getJSON(`/api/measurement-set/?platform=${result.platformId}`);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'AmbiguousRequest');
});
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 reject an invalid platform name", () => {
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', reportWithBuildTime);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
return TestServer.remoteAPI().getJSON(`/api/measurement-set/?platform=${result.platformId}a&metric=${result.metricId}`);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidPlatform');
});
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 reject an invalid metric name", () => {
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', reportWithBuildTime);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
return TestServer.remoteAPI().getJSON(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}b`);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'InvalidMetric');
});
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 return 404 when the report is empty", () => {
const db = TestServer.database();
return Promise.all([
db.insert('tests', {id: 1, name: 'SomeTest'}),
db.insert('tests', {id: 2, name: 'SomeOtherTest'}),
db.insert('tests', {id: 3, name: 'ChildTest', parent: 1}),
db.insert('tests', {id: 4, name: 'GrandChild', parent: 3}),
db.insert('aggregators', {id: 200, name: 'Total'}),
db.insert('test_metrics', {id: 5, test: 1, name: 'Time'}),
db.insert('test_metrics', {id: 6, test: 2, name: 'Time', aggregator: 200}),
db.insert('test_metrics', {id: 7, test: 2, name: 'Malloc', aggregator: 200}),
db.insert('test_metrics', {id: 8, test: 3, name: 'Time'}),
db.insert('test_metrics', {id: 9, test: 4, name: 'Time'}),
db.insert('platforms', {id: 23, name: 'iOS 9 iPhone 5s'}),
db.insert('platforms', {id: 46, name: 'Trunk Mavericks'}),
db.insert('test_configurations', {id: 101, metric: 5, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 102, metric: 6, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 103, metric: 7, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 104, metric: 8, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 105, metric: 9, platform: 46, type: 'current'}),
db.insert('test_configurations', {id: 106, metric: 5, platform: 23, type: 'current'}),
db.insert('test_configurations', {id: 107, metric: 5, platform: 23, type: 'baseline'}),
]).then(() => {
return TestServer.remoteAPI().getJSONWithStatus(`/api/measurement-set/?platform=46&metric=5`).then((response) => {
assert(false);
}, (error) => {
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(error, 404);
});
});
});
it("should be able to retrieve a reported value", () => {
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', reportWithBuildTime);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
return TestServer.remoteAPI().getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
}).then((response) => {
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 buildTime = +(new Date(reportWithBuildTime[0]['buildTime']));
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(Object.keys(response).sort(),
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
['clusterCount', 'clusterSize', 'clusterStart',
'configurations', 'elapsedTime', 'endTime', 'formatMap', 'lastModified', 'startTime', 'status']);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.strictEqual(response['clusterCount'], 1);
assert.deepStrictEqual(response['formatMap'], [
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
'id', 'mean', 'iterationCount', 'sum', 'squareSum', 'markedOutlier',
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
'revisions', 'commitTime', 'build', 'buildTime', 'buildTag', 'builder']);
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
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['startTime'], reportWithBuildTime.startTime);
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
assert(typeof(response['lastModified']) == 'number', 'lastModified time should be a numeric');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(Object.keys(response['configurations']), ['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
const currentRows = response['configurations']['current'];
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(currentRows.length, 1);
assert.strictEqual(currentRows[0].length, response['formatMap'].length);
assert.deepStrictEqual(format(response['formatMap'], currentRows[0]), {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
mean: 3,
iterationCount: 5,
sum: 15,
squareSum: 55,
markedOutlier: false,
revisions: [],
commitTime: buildTime,
buildTime: buildTime,
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: '123'});
});
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 return return the right IDs for measurement, build, and builder", () => {
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return TestServer.remoteAPI().postJSON('/api/report/', reportWithBuildTime);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return queryPlatformAndMetric('Mountain Lion', 'Time');
}).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 db = TestServer.database();
return Promise.all([
db.selectAll('test_runs'),
db.selectAll('builds'),
db.selectAll('builders'),
TestServer.remoteAPI().getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`),
]);
}).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 runs = result[0];
const builds = result[1];
const builders = result[2];
const response = result[3];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(runs.length, 1);
assert.strictEqual(builds.length, 1);
assert.strictEqual(builders.length, 1);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
const measurementId = runs[0]['id'];
const buildId = builds[0]['id'];
const builderId = builders[0]['id'];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['configurations']['current'].length, 1);
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
const measurement = response['configurations']['current'][0];
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
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(measurement[response['formatMap'].indexOf('id')], measurementId);
assert.strictEqual(measurement[response['formatMap'].indexOf('build')], buildId);
assert.strictEqual(measurement[response['formatMap'].indexOf('builder')], builderId);
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
});
});
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 queryPlatformAndMetricWithRepository(platformName, metricName, repositoryName)
{
const db = TestServer.database();
return Promise.all([
db.selectFirstRow('platforms', {name: platformName}),
db.selectFirstRow('test_metrics', {name: metricName}),
db.selectFirstRow('repositories', {name: repositoryName}),
]).then((result) => ({platformId: result[0]['id'], metricId: result[1]['id'], repositoryId: result[2]['id']}));
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 order results by commit time", () => {
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 remote = TestServer.remoteAPI();
let repositoryId;
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return remote.postJSON('/api/report/', reportWithBuildTime);
}).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 remote.postJSON('/api/report/', reportWithRevision);
}).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 queryPlatformAndMetricWithRepository('Mountain Lion', 'Time', 'WebKit');
}).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
repositoryId = result.repositoryId;
return remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
}).then((response) => {
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 currentRows = response['configurations']['current'];
const buildTime = +(new Date(reportWithBuildTime[0]['buildTime']));
const revisionTime = +(new Date(reportWithRevision[0]['revisions']['WebKit']['timestamp']));
const revisionBuildTime = +(new Date(reportWithRevision[0]['buildTime']));
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(currentRows.length, 2);
assert.deepStrictEqual(format(response['formatMap'], currentRows[0]), {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
mean: 13,
iterationCount: 5,
sum: 65,
squareSum: 855,
markedOutlier: false,
revisions: [[1, repositoryId, '144000', null, null, revisionTime]],
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
commitTime: revisionTime,
buildTime: revisionBuildTime,
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: '124' });
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(format(response['formatMap'], currentRows[1]), {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
mean: 3,
iterationCount: 5,
sum: 15,
squareSum: 55,
markedOutlier: false,
revisions: [],
commitTime: buildTime,
buildTime: buildTime,
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: '123' });
});
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 include revision identifier", async () => {
const remote = TestServer.remoteAPI();
await addBuilderForReport(reportWithBuildTime[0]);
await remote.postJSON('/api/report/', reportWithBuildTime);
await remote.postJSON('/api/report/', reportWithRevisionIdentifier);
const result = await queryPlatformAndMetricWithRepository('Mountain Lion', 'Time', 'WebKit');
const repositoryId = result.repositoryId;
const response = await remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
const currentRows = response['configurations']['current'];
const buildTime = +(new Date(reportWithBuildTime[0]['buildTime']));
const revisionTime = +(new Date(reportWithRevision[0]['revisions']['WebKit']['timestamp']));
const revisionBuildTime = +(new Date(reportWithRevision[0]['buildTime']));
assert.strictEqual(currentRows.length, 2);
assert.deepStrictEqual(format(response['formatMap'], currentRows[0]), {
mean: 13,
iterationCount: 5,
sum: 65,
squareSum: 855,
markedOutlier: false,
revisions: [[1, repositoryId, '144000', '129103@main', null, revisionTime]],
commitTime: revisionTime,
buildTime: revisionBuildTime,
buildTag: '124' });
assert.deepStrictEqual(format(response['formatMap'], currentRows[1]), {
mean: 3,
iterationCount: 5,
sum: 15,
squareSum: 55,
markedOutlier: false,
revisions: [],
commitTime: buildTime,
buildTime: buildTime,
buildTag: '123' });
});
it("should keep 'carry_over' points up to date", async () => {
const remote = TestServer.remoteAPI();
await addBuilderForReport(reportWithRevision[0]);
await remote.postJSON('/api/report/', reportWithRevision);
await remote.postJSON('/api/report/', secondReportWithRevision);
await remote.postJSON('/api/report/', thirdReportWithRevision);
await remote.postJSON('/api/report/', reportBaselineWithRevision);
await remote.postJSON('/api/report/', secondReportBaselineWithRevision);
await remote.postJSON('/api/report/', thirdReportBaselineWithRevision);
const result = await queryPlatformAndMetricWithRepository('Mountain Lion', 'Time', 'WebKit');
const response = await remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
const currentRows = response['configurations']['current'];
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(currentRows.length, 2);
assert.deepStrictEqual(format(response['formatMap'], currentRows[0]).buildTag, '127');
assert.deepStrictEqual(format(response['formatMap'], currentRows[1]).buildTag, '128');
assert(format(response['formatMap'], currentRows[0]).commitTime < response.startTime);
assert(format(response['formatMap'], currentRows[1]).commitTime < response.startTime);
const baselineRows = response['configurations']['baseline'];
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(baselineRows.length, 2);
assert.deepStrictEqual(format(response['formatMap'], baselineRows[0]).buildTag, '131');
assert.deepStrictEqual(format(response['formatMap'], baselineRows[1]).buildTag, '129');
});
it("should order results by build time when commit times are missing", () => {
const remote = TestServer.remoteAPI();
let repositoryId;
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
const db = TestServer.database();
return Promise.all([
db.insert('repositories', {'id': 1, 'name': 'macOS'}),
db.insert('commits', {'id': 2, 'repository': 1, 'revision': 'macOS 16A323', 'order': 0}),
db.insert('commits', {'id': 3, 'repository': 1, 'revision': 'macOS 16C68', 'order': 1}),
]);
}).then(() => {
return remote.postJSON('/api/report/', [{
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": "1001",
"buildTime": '2017-01-19 15:28:01',
"revisions": {
"macOS": {
"revision": "macOS 16C68",
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Sierra",
"tests": { "Test": {"metrics": {"Time": { "baseline": [1, 2, 3, 4, 5] } } } },
}]);
}).then(() => {
return remote.postJSON('/api/report/', [{
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": "1002",
"buildTime": '2017-01-19 19:46:37',
"revisions": {
"macOS": {
"revision": "macOS 16A323",
},
},
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Sierra",
"tests": { "Test": {"metrics": {"Time": { "baseline": [5, 6, 7, 8, 9] } } } },
}]);
}).then(() => {
return queryPlatformAndMetricWithRepository('Sierra', 'Time', 'macOS');
}).then((result) => {
return remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
}).then((response) => {
const currentRows = response['configurations']['baseline'];
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(currentRows.length, 2);
assert.deepStrictEqual(format(response['formatMap'], currentRows[0]), {
mean: 3,
iterationCount: 5,
sum: 15,
squareSum: 55,
markedOutlier: false,
revisions: [[3, 1, 'macOS 16C68', null, 1, 0]],
commitTime: +Date.UTC(2017, 0, 19, 15, 28, 1),
buildTime: +Date.UTC(2017, 0, 19, 15, 28, 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: '1001' });
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(format(response['formatMap'], currentRows[1]), {
mean: 7,
iterationCount: 5,
sum: 35,
squareSum: 255,
markedOutlier: false,
revisions: [[2, 1, 'macOS 16A323', null, 0, 0]],
commitTime: +Date.UTC(2017, 0, 19, 19, 46, 37),
buildTime: +Date.UTC(2017, 0, 19, 19, 46, 37),
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: '1002' });
});
});
Refactor "builds" table "build_number" row to "build_tag" to fit more generic use cases. https://bugs.webkit.org/show_bug.cgi?id=203270 Reviewed by Ryosuke Niwa. Rename "build_number" to "build_tag" to fit more generic use cases. Add support to be backward compatible to accept reports contain either "buildNumber" or "buildTag". * browser-tests/index.html: * init-database.sql: * migrate-database.sql: Updated migration sql for this change. * public/admin/test-configurations.php: * public/api/measurement-set.php: * public/api/runs.php: * public/api/upload-root.php: Added support for both "buildNumber" and "buildTag". * public/include/report-processor.php: Added support for both "buildNumber" and "buildTag". * public/v3/models/builder.js: (Builder.prototype.urlForBuild): (Builder): (Build): (Build.prototype.buildTag): (Build.prototype.label): (Build.prototype.url): (Build.prototype.buildNumber): Deleted. * public/v3/models/measurement-adaptor.js: (MeasurementAdaptor): (MeasurementAdaptor.prototype.applyTo.return.build): * public/v3/pages/chart-pane-status-view.js: * public/v3/pages/test-freshness-page.js: (TestFreshnessPage.prototype._renderTooltip): * server-tests/admin-platforms-tests.js: (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: * server-tests/api-commits-tests.js: * server-tests/api-manifest-tests.js: * server-tests/api-measurement-set-tests.js: * server-tests/api-report-tests.js: Added unit tests for testing "buildNumber" and "buildTag". (emptyReport): (reportWitMismatchingCommitTime): (reportWithOneSecondCommitTimeDifference): (emptySlaveReport): (makeReport): (reportWithSameSubtestName): * server-tests/api-upload-root-tests.js: Added unit tests for testing "buildNumber" and "buildTag". * server-tests/privileged-api-add-build-requests-tests.js: * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async.createAnalysisTask): * server-tests/resources/mock-data.js: (MockData.addMockConfiguration): (MockData.sampleBuildData): (MockData.finishedBuildData): * server-tests/tools-sync-buildbot-integration-tests.js: * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildTag): (BuildbotBuildEntry.prototype.url): (BuildbotSyncer.prototype.urlForBuildTag): (BuildbotBuildEntry.prototype.buildNumber): Deleted. (BuildbotSyncer.prototype.urlForBuildNumber): Deleted. * unit-tests/analysis-task-tests.js: (measurementCluster): * unit-tests/buildbot-syncer-tests.js: * unit-tests/measurement-adaptor-tests.js: * unit-tests/measurement-set-analyzer-tests.js: * unit-tests/measurement-set-tests.js: * unit-tests/resources/mock-v3-models.js: Canonical link: https://commits.webkit.org/216795@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-24 22:00:37 +00:00
function buildTags(parsedResult, 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
{
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
return parsedResult['configurations'][config].map((row) => format(parsedResult['formatMap'], row)['buildTag']);
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 include one data point after the current time range", () => {
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 remote = TestServer.remoteAPI();
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
return remote.postJSON('/api/report/', reportWithAncientRevision);
}).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 remote.postJSON('/api/report/', reportWithNewRevision);
}).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 queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
return remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.strictEqual(response['clusterCount'], 2, 'should have two clusters');
assert.deepStrictEqual(buildTags(response, 'current'),
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
[reportWithAncientRevision[0]['buildTag'], reportWithNewRevision[0]['buildTag']]);
});
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 always include one old data point before the current time range", () => {
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 remote = TestServer.remoteAPI();
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
return remote.postJSON('/api/report/', reportWithBuildTime);
}).then(() => {
return remote.postJSON('/api/report/', reportWithAncientRevision);
}).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 queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
return remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
}).then((response) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['clusterCount'], 2, 'should have two clusters');
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 currentRows = response['configurations']['current'];
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(currentRows.length, 2, 'should contain two data points');
assert.deepStrictEqual(buildTags(response, 'current'), [reportWithAncientRevision[0]['buildTag'], reportWithBuildTime[0]['buildTag']]);
});
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 create cached results", () => {
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 remote = TestServer.remoteAPI();
let cachePrefix;
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
return remote.postJSON('/api/report/', reportWithAncientRevision);
}).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 remote.postJSON('/api/report/', reportWithRevision);
}).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 remote.postJSON('/api/report/', reportWithNewRevision);
}).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 queryPlatformAndMetric('Mountain Lion', 'Time');
}).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
cachePrefix = '/data/measurement-set-' + result.platformId + '-' + result.metricId;
return remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
}).then((newResult) => {
return remote.getJSONWithStatus(`${cachePrefix}.json`).then((cachedResult) => {
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(newResult, cachedResult);
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 remote.getJSONWithStatus(`${cachePrefix}-${cachedResult['startTime']}.json`);
}).then((oldResult) => {
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
const oldbuildTags = buildTags(oldResult, 'current');
const newbuildTags = buildTags(newResult, 'current');
assert(oldbuildTags.length >= 2, 'The old cluster should contain at least two data points');
assert(newbuildTags.length >= 2, 'The new cluster should contain at least two data points');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(oldbuildTags.slice(oldbuildTags.length - 2), newbuildTags.slice(0, 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
'Two conseqcutive clusters should share two data points');
});
});
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 use lastModified timestamp identical to that in the manifest file", () => {
const remote = TestServer.remoteAPI();
return addBuilderForReport(reportWithBuildTime[0]).then(() => {
return remote.postJSON('/api/report/', reportWithRevision);
}).then(() => {
return queryPlatformAndMetric('Mountain Lion', 'Time');
}).then((result) => {
return remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
}).then((primaryCluster) => {
return remote.getJSONWithStatus('/api/manifest').then((content) => {
const manifest = Manifest._didFetchManifest(content);
const platform = Platform.findByName('Mountain Lion');
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(Metric.all().length, 1);
const metric = Metric.all()[0];
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(platform.lastModified(metric), primaryCluster['lastModified']);
});
});
});
async function reportAfterAddingBuilderAndAggregatorsWithResponse(report)
{
await addBuilderForReport(report);
const db = TestServer.database();
await Promise.all([
db.insert('aggregators', {name: 'Arithmetic'}),
db.insert('aggregators', {name: 'Geometric'}),
]);
return await TestServer.remoteAPI().postJSON('/api/report/', [report]);
}
const reportWithBuildRequest = {
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": "123",
"buildTime": "2013-02-28T10:12:03.388304",
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"buildRequest": "700",
"tests": {
"test": {
"metrics": {"FrameRate": { "current": [[[0, 4], [100, 5], [205, 3]]] }}
},
},
"revisions": {
"macOS": {
"revision": "10.8.2 12C60"
},
"WebKit": {
"revision": "141977",
"timestamp": "2013-02-06T08:55:20.9Z"
}
}
};
it("should allow to report a build request", async () => {
await MockData.addMockData(TestServer.database());
let response = await reportAfterAddingBuilderAndAggregatorsWithResponse(reportWithBuildRequest);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
response = await TestServer.remoteAPI().getJSONWithStatus('/api/measurement-set/?analysisTask=500');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['measurements'], [[1, 4, 3, 12, 50, [
['1', '9', '10.8.2 12C60', null, null, 0], ['2', '11', '141977', null, null, 1360140920900]],
1, 1362046323388, '123', 1, 1, 'current']]);
});
const reportWithCommitsNeedsRoundCommitTimeAndBuildRequest = {
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": "123",
"buildTime": "2013-02-28T10:12:03.388304",
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"buildRequest": "700",
"tests": {
"test": {
"metrics": {"FrameRate": { "current": [[[0, 4], [100, 5], [205, 3]]] }}
},
},
"revisions": {
"macOS": {
"revision": "10.8.2 12C60",
"timestamp": '2018-09-27T09:49:52.670499Z',
},
"WebKit": {
"revision": "141977",
"timestamp": '2018-09-27T09:49:52.670999Z',
}
}
};
it("commit time of commits from measurement set queried by analysis task should match the one from `/api/commits`", async () => {
const expectedWebKitCommitTime = 1538041792671;
const expectedMacOSCommitTime = 1538041792670;
const remote = TestServer.remoteAPI();
await MockData.addMockData(TestServer.database());
let response = await reportAfterAddingBuilderAndAggregatorsWithResponse(reportWithCommitsNeedsRoundCommitTimeAndBuildRequest);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
const rawWebKitCommit = await remote.getJSONWithStatus(`/api/commits/WebKit/141977`);
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(rawWebKitCommit.commits[0].time, expectedWebKitCommitTime);
const rawMacOSCommit = await remote.getJSONWithStatus(`/api/commits/macOS/10.8.2%2012C60`);
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(rawMacOSCommit.commits[0].time, expectedMacOSCommitTime);
response = await TestServer.remoteAPI().getJSONWithStatus('/api/measurement-set/?analysisTask=500');
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.strictEqual(response['status'], 'OK');
assert.deepStrictEqual(response['measurements'], [[1, 4, 3, 12, 50, [
['1', '9', '10.8.2 12C60', null, null, expectedMacOSCommitTime], ['2', '11', '141977', null, null, expectedWebKitCommitTime]],
1, 1362046323388, '123', 1, 1, 'current']]);
});
const reportWithCommitsNeedsRoundCommitTime = {
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": "123",
"buildTime": "2013-02-28T10:12:03.388304",
"builderName": "someBuilder",
"builderPassword": "somePassword",
"platform": "Mountain Lion",
"tests": {
"test": {
"metrics": {"FrameRate": { "current": [[[0, 4], [100, 5], [205, 3]]] }}
},
},
"revisions": {
"macOS": {
"revision": "10.8.2 12C60",
"timestamp": '2018-09-27T09:49:52.670499Z',
},
"WebKit": {
"revision": "141977",
"timestamp": '2018-09-27T09:49:52.670999Z',
}
}
};
it("commit time of commits from measurement set queried by platform and metric should match the one from `/api/commits`", async () => {
const expectedWebKitCommitTime = 1538041792671;
const expectedMacOSCommitTime = 1538041792670;
const remote = TestServer.remoteAPI();
await addBuilderForReport(reportWithCommitsNeedsRoundCommitTime);
await remote.postJSON('/api/report/', [reportWithCommitsNeedsRoundCommitTime]);
const rawWebKitCommit = await remote.getJSONWithStatus(`/api/commits/WebKit/141977`);
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(rawWebKitCommit.commits[0].time, expectedWebKitCommitTime);
const rawMacOSCommit = await remote.getJSONWithStatus(`/api/commits/macOS/10.8.2%2012C60`);
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(rawMacOSCommit.commits[0].time, expectedMacOSCommitTime);
const result = await queryPlatformAndMetric('Mountain Lion', 'FrameRate');
const primaryCluster = await remote.getJSONWithStatus(`/api/measurement-set/?platform=${result.platformId}&metric=${result.metricId}`);
Make server test run with new node version https://bugs.webkit.org/show_bug.cgi?id=222463 Change assert.equal to assert.strictEqual since node deprecated this API Add a new function console.assert to make sure it will throw an error Reviewed by Ryosuke Niwa. * public/v3/models/repository.js: (Repository.sortByNamePreferringOnesWithURL): (Repository): * server-tests/admin-platforms-tests.js: * server-tests/admin-reprocess-report-tests.js: * server-tests/api-build-requests-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-commits-tests.js: (assertCommitIsSameAsOneSubmitted): (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-manifest-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/api-measurement-set-tests.js: * server-tests/api-report-commits-tests.js: (emptyReport.then): (async initialReportCommits): (async setUpTestsWithExpectedStatus): (async testWithExpectedFailure): * server-tests/api-report-tests.js: (emptyReport.then): * server-tests/api-test-groups.js: * server-tests/api-update-triggerable-tests.js: (update.then): (then.response.db.selectAll.string_appeared_here.then): (then.db.selectAll.string_appeared_here.then): (then.Manifest.fetch.then): * server-tests/api-upload-root-tests.js: * server-tests/api-uploaded-file-tests.js: (return.TestServer.remoteAPI.getJSON.string_appeared_here.then): * server-tests/privileged-api-add-build-requests-tests.js: (async createAnalysisTask): (const.commitSet.of.updatedGroups.0.requestedCommitSets): * server-tests/privileged-api-create-analysis-task-tests.js: * server-tests/privileged-api-create-test-group-tests.js: (createAnalysisTask): (return.createAnalysisTask.string_appeared_here.then): (return.addTriggerableAndCreateTask.string_appeared_here.then): (string_appeared_here.then): * server-tests/privileged-api-upate-run-status.js: * server-tests/privileged-api-update-test-group-tests.js: (async createAnalysisTask): * server-tests/privileged-api-upload-file-tests.js: (TestServer.testConfig.uploadFileLimitInMB.1.then): * server-tests/resources/common-operations.js: (async assertThrows): * server-tests/resources/temporary-file.js: (TemporaryFile.makeTemporaryFileOfSizeInMB): * server-tests/tools-buildbot-triggerable-tests.js: (assertRequestAndResolve): (then.refetchManifest.then): (getBuilderNameToIDMapPromise.then): * server-tests/tools-os-build-fetcher-tests.js: * server-tests/tools-sync-buildbot-integration-tests.js: (assertAndResolveRequest): * tools/js/assert-override.js: Added. (makeConsoleAssertThrow): * tools/js/buildbot-syncer.js: (BuildbotBuildEntry.prototype.initialize): (BuildbotBuildEntry.prototype.buildRequestStatusIfUpdateIsNeeded): (BuildbotBuildEntry): (BuildbotSyncer.prototype.scheduleRequest): (BuildbotSyncer._loadConfig): (BuildbotSyncer._parseRepositoryGroup): (BuildbotSyncer._validateAndMergeConfig): (BuildbotSyncer): * tools/js/buildbot-triggerable.js: (BuildbotTriggerable.prototype._validateRequests): * tools/js/markup-component.js: (const.MarkupDocument.new.MarkupDocument.prototype._idForClone): (const.MarkupDocument.new.MarkupDocument.prototype.markup): * tools/js/os-build-fetcher.js: (prototype._addOwnedCommitsForBuild): * tools/js/remote.js: (NodeRemoteAPI.prototype.configure): * tools/js/v3-models.js: * unit-tests/commit-set-tests.js: Canonical link: https://commits.webkit.org/234972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-06 14:31:56 +00:00
assert.deepStrictEqual(primaryCluster.configurations.current, [[1, 4, 3, 12, 50, false, [
[1, 1, '10.8.2 12C60', null, null, expectedMacOSCommitTime], [2, 2, '141977', null, null, expectedWebKitCommitTime]],
expectedWebKitCommitTime, 1, 1362046323388, '123', 1]]);
});
Migrate legacy perf dashboard tests to mocha.js based tests https://bugs.webkit.org/show_bug.cgi?id=156335 Reviewed by Chris Dumez. Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise for most of asynchronous operations, refactored the tests to use Promises as well, and added more assertions where appropriate. Also consolidated common helper functions into server-tests/resources/common-operations.js. Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were taking an array of reports while others were taking a single report. New shared implementation in common-operations.js now takes a single report. Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout. Most of tests are passing under 100ms on my computer so 1s should be plenty still. * run-tests.js: Removed. * server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js. (reportsForDifferentPlatforms): * server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js. (.addBuilder): Moved to common-operations.js. * server-tests/api-build-requests-tests.js: * server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps. * server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js. (.queryPlatformAndMetric): (.format): * server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js. * server-tests/api-report-tests.js: Moved from tests/api-report.js. (.emptyReport): (.emptySlaveReport): (.reportWithSameSubtestName): * server-tests/resources/common-operations.js: Added. (addBuilderForReport): Extracted from tests. (addSlaveForReport): Ditto. (connectToDatabaseInEveryTest): Added. (submitReport): Extracted from admin-platforms-tests.js. * server-tests/resources/test-server.js: (TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start its own Apache instance (that would certainly will fail). * server-tests/tools-buildbot-triggerable-tests.js: * tests: Removed. * tools/js/database.js: (Database.prototype.selectAll): Added. (Database.prototype.selectFirstRow): Added. (Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments. Canonical link: https://commits.webkit.org/174460@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-07 22:10:50 +00:00
});