Diff
Modified: trunk/Websites/perf.webkit.org/ChangeLog (213999 => 214000)
--- trunk/Websites/perf.webkit.org/ChangeLog 2017-03-15 19:15:27 UTC (rev 213999)
+++ trunk/Websites/perf.webkit.org/ChangeLog 2017-03-15 19:34:00 UTC (rev 214000)
@@ -1,5 +1,32 @@
2017-03-15 Ryosuke Niwa <[email protected]>
+ Fix server tests after r213998 and r213969
+ https://bugs.webkit.org/show_bug.cgi?id=169690
+
+ Reviewed by Antti Koivisto.
+
+ Fixed the existing server tests.
+
+ * public/v3/models/analysis-task.js:
+ (AnalysisTask.prototype._updateRemoteState): Use the relative path from the root so that it works inside tests.
+ (AnalysisTask.prototype.associateBug): Ditto.
+ (AnalysisTask.prototype.dissociateBug): Ditto.
+ (AnalysisTask.prototype.associateCommit): Ditto.
+ (AnalysisTask.prototype.dissociateCommit): Ditto.
+ (AnalysisTask._fetchSubset): Ditto.
+ (AnalysisTask.fetchAll): Ditto.
+ * public/v3/models/test-group.js:
+ (TestGroup.prototype.updateName): Ditto.
+ (TestGroup.prototype.updateHiddenFlag): Ditto.
+ (TestGroup.createAndRefetchTestGroups): Ditto.
+ (TestGroup.cachedFetch): Ditto.
+ * server-tests/api-manifest.js: Reverted an inadvertant change in r213969.
+ * tools/js/database.js:
+ (tableToPrefixMap): Added analysis_strategies.
+ * unit-tests/analysis-task-tests.js: Updated expectations per changes to AnalysisTask.
+
+2017-03-15 Ryosuke Niwa <[email protected]>
+
Add tests for privileged-api/create-analysis-task and privileged-api/create-test-group
https://bugs.webkit.org/show_bug.cgi?id=169688
Modified: trunk/Websites/perf.webkit.org/public/v3/models/analysis-task.js (213999 => 214000)
--- trunk/Websites/perf.webkit.org/public/v3/models/analysis-task.js 2017-03-15 19:15:27 UTC (rev 213999)
+++ trunk/Websites/perf.webkit.org/public/v3/models/analysis-task.js 2017-03-15 19:34:00 UTC (rev 214000)
@@ -81,7 +81,7 @@
{
param.task = this.id();
return PrivilegedAPI.sendRequest('update-analysis-task', param).then(function (data) {
- return AnalysisTask.cachedFetch('../api/analysis-tasks', {id: param.task}, true)
+ return AnalysisTask.cachedFetch('/api/analysis-tasks', {id: param.task}, true)
.then(AnalysisTask._constructAnalysisTasksFromRawData.bind(AnalysisTask));
});
}
@@ -96,7 +96,7 @@
bugTracker: tracker.id(),
number: bugNumber,
}).then(function (data) {
- return AnalysisTask.cachedFetch('../api/analysis-tasks', {id: id}, true)
+ return AnalysisTask.cachedFetch('/api/analysis-tasks', {id: id}, true)
.then(AnalysisTask._constructAnalysisTasksFromRawData.bind(AnalysisTask));
});
}
@@ -112,7 +112,7 @@
number: bug.bugNumber(),
shouldDelete: true,
}).then(function (data) {
- return AnalysisTask.cachedFetch('../api/analysis-tasks', {id: id}, true)
+ return AnalysisTask.cachedFetch('/api/analysis-tasks', {id: id}, true)
.then(AnalysisTask._constructAnalysisTasksFromRawData.bind(AnalysisTask));
});
}
@@ -128,7 +128,7 @@
revision: revision,
kind: kind,
}).then(function (data) {
- return AnalysisTask.cachedFetch('../api/analysis-tasks', {id: id}, true)
+ return AnalysisTask.cachedFetch('/api/analysis-tasks', {id: id}, true)
.then(AnalysisTask._constructAnalysisTasksFromRawData.bind(AnalysisTask));
});
}
@@ -141,7 +141,7 @@
task: id,
commit: commit.id(),
}).then(function (data) {
- return AnalysisTask.cachedFetch('../api/analysis-tasks', {id: id}, true)
+ return AnalysisTask.cachedFetch('/api/analysis-tasks', {id: id}, true)
.then(AnalysisTask._constructAnalysisTasksFromRawData.bind(AnalysisTask));
});
}
@@ -215,13 +215,13 @@
{
if (this._fetchAllPromise)
return this._fetchAllPromise;
- return this.cachedFetch('../api/analysis-tasks', params, noCache).then(this._constructAnalysisTasksFromRawData.bind(this));
+ return this.cachedFetch('/api/analysis-tasks', params, noCache).then(this._constructAnalysisTasksFromRawData.bind(this));
}
static fetchAll()
{
if (!this._fetchAllPromise)
- this._fetchAllPromise = RemoteAPI.getJSONWithStatus('../api/analysis-tasks').then(this._constructAnalysisTasksFromRawData.bind(this));
+ this._fetchAllPromise = RemoteAPI.getJSONWithStatus('/api/analysis-tasks').then(this._constructAnalysisTasksFromRawData.bind(this));
return this._fetchAllPromise;
}
Modified: trunk/Websites/perf.webkit.org/public/v3/models/test-group.js (213999 => 214000)
--- trunk/Websites/perf.webkit.org/public/v3/models/test-group.js 2017-03-15 19:15:27 UTC (rev 213999)
+++ trunk/Websites/perf.webkit.org/public/v3/models/test-group.js 2017-03-15 19:34:00 UTC (rev 214000)
@@ -179,7 +179,7 @@
group: id,
name: newName,
}).then(function (data) {
- return TestGroup.cachedFetch(`../api/test-groups/${id}`, {}, true)
+ return TestGroup.cachedFetch(`/api/test-groups/${id}`, {}, true)
.then(TestGroup._createModelsFromFetchedTestGroups.bind(TestGroup));
});
}
@@ -192,7 +192,7 @@
group: id,
hidden: !!hidden,
}).then(function (data) {
- return TestGroup.cachedFetch(`../api/test-groups/${id}`, {}, true)
+ return TestGroup.cachedFetch(`/api/test-groups/${id}`, {}, true)
.then(TestGroup._createModelsFromFetchedTestGroups.bind(TestGroup));
});
}
@@ -205,13 +205,13 @@
repetitionCount: repetitionCount,
commitSets: commitSets,
}).then((data) => {
- return this.cachedFetch('../api/test-groups', {task: task.id()}, true).then((data) => this._createModelsFromFetchedTestGroups(data));
+ return this.cachedFetch('/api/test-groups', {task: task.id()}, true).then((data) => this._createModelsFromFetchedTestGroups(data));
});
}
static fetchByTask(taskId)
{
- return this.cachedFetch('../api/test-groups', {task: taskId}).then(this._createModelsFromFetchedTestGroups.bind(this));
+ return this.cachedFetch('/api/test-groups', {task: taskId}).then(this._createModelsFromFetchedTestGroups.bind(this));
}
static _createModelsFromFetchedTestGroups(data)
Modified: trunk/Websites/perf.webkit.org/server-tests/api-manifest.js (213999 => 214000)
--- trunk/Websites/perf.webkit.org/server-tests/api-manifest.js 2017-03-15 19:15:27 UTC (rev 213999)
+++ trunk/Websites/perf.webkit.org/server-tests/api-manifest.js 2017-03-15 19:34:00 UTC (rev 214000)
@@ -14,7 +14,7 @@
it("should generate an empty manifest when database is empty", () => {
return TestServer.remoteAPI().getJSON('/api/manifest').then((manifest) => {
assert.deepEqual(Object.keys(manifest).sort(), ['all', 'bugTrackers', 'builders', 'dashboard', 'dashboards',
- 'elapsedTime', 'fileUploadSizeLimit', 'metrics', 'repositories', 'siteTitle', 'status', 'summaryPages', 'tests', 'triggerables']);
+ 'elapsedTime', 'metrics', 'repositories', 'siteTitle', 'status', 'summaryPages', 'tests', 'triggerables']);
assert.equal(typeof(manifest.elapsedTime), 'number');
delete manifest.elapsedTime;
@@ -31,7 +31,6 @@
tests: {},
triggerables: {},
summaryPages: [],
- fileUploadSizeLimit: 0,
status: 'OK'
});
});
Modified: trunk/Websites/perf.webkit.org/tools/js/database.js (213999 => 214000)
--- trunk/Websites/perf.webkit.org/tools/js/database.js 2017-03-15 19:15:27 UTC (rev 213999)
+++ trunk/Websites/perf.webkit.org/tools/js/database.js 2017-03-15 19:34:00 UTC (rev 214000)
@@ -127,6 +127,7 @@
const tableToPrefixMap = {
'aggregators': 'aggregator',
+ 'analysis_strategies': 'strategy',
'analysis_tasks': 'task',
'analysis_test_groups': 'testgroup',
'bug_trackers': 'tracker',
Modified: trunk/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js (213999 => 214000)
--- trunk/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js 2017-03-15 19:15:27 UTC (rev 213999)
+++ trunk/Websites/perf.webkit.org/unit-tests/analysis-task-tests.js 2017-03-15 19:34:00 UTC (rev 214000)
@@ -126,7 +126,7 @@
AnalysisTask.fetchAll().then(() => { callCount++; });
assert.equal(callCount, 0);
assert.equal(requests.length, 1);
- assert.equal(requests[0].url, '../api/analysis-tasks');
+ assert.equal(requests[0].url, '/api/analysis-tasks');
});
it('should not request all analysis tasks multiple times', () => {
@@ -134,7 +134,7 @@
AnalysisTask.fetchAll().then(() => { callCount++; });
assert.equal(callCount, 0);
assert.equal(requests.length, 1);
- assert.equal(requests[0].url, '../api/analysis-tasks');
+ assert.equal(requests[0].url, '/api/analysis-tasks');
AnalysisTask.fetchAll().then(() => { callCount++; });
assert.equal(callCount, 0);
@@ -146,7 +146,7 @@
const promise = AnalysisTask.fetchAll().then(() => { callCount++; });
assert.equal(callCount, 0);
assert.equal(requests.length, 1);
- assert.equal(requests[0].url, '../api/analysis-tasks');
+ assert.equal(requests[0].url, '/api/analysis-tasks');
requests[0].resolve(sampleAnalysisTask());