Permalink
Browse files

Do not store results in Hub's memory during batch.

This data is not used on the server except to determine completeness.
Replace with a boolean flag.
  • Loading branch information...
1 parent 6021c40 commit 7851a873af61156248f0b4d53f723249d6b52a2c @reid reid committed Feb 20, 2014
Showing with 10 additions and 14 deletions.
  1. +1 −1 lib/hub/agent.js
  2. +1 −1 lib/hub/batch.js
  3. +1 −1 lib/hub/target.js
  4. +4 −5 lib/hub/test.js
  5. +3 −6 test/unit/test.js
View
@@ -422,7 +422,7 @@ Agent.prototype.giveUpOnCurrentTest = function () {
message: "Agent timed out running test: " + this.currentUrl
});
if (this.currentTest) {
- this.currentTest.setResults({});
+ this.currentTest.setResults(true);
this.currentTest.setExecuting(false);
}
this.next();
View
@@ -337,7 +337,7 @@ Batch.prototype.handleFileRequest = function (server, agentId, filename) {
});
if (agent.target) {
test = agent.target.tests.getByUrl(filename);
- test.setResults({});
+ test.setResults(true);
test.setExecuting(false);
}
server.res.writeHead(302, {
View
@@ -122,7 +122,7 @@ Target.prototype.setupEvents = function () {
var test = self.tests.getByUrl(data.url);
if (!test.isExecuting()) { return; }
- test.setResults(data);
+ test.setResults(true);
test.setExecuting(false);
self.emit("results", data);
this.child.next();
View
@@ -42,14 +42,13 @@ Test.prototype.getUrlForAgentId = function (agentId) {
};
/**
- * Set the results property.
- * If not falsy, test will be considered to have results.
+ * Mark if this test has results and is considered complete.
*
* @method setResults
- * @param {Object} results Results formatted as a YUI Test result.
+ * @param {Boolean} results True if test has results, false otherwise.
*/
Test.prototype.setResults = function (results) {
- this.results = results;
+ this.results = !!results;
};
/**
@@ -63,7 +62,7 @@ Test.prototype.setExecuting = function (executing) {
};
/**
- * Determine if this test is being worked on by a browser.
+ * Is this test is being worked on by a browser?
*
* @method isExecuting
* @return {Boolean} True if executing, false otherwise.
View
@@ -46,14 +46,11 @@ vows.describe("Test").addBatch({
topic: function (lastTopic) {
var topic = {};
topic.last = lastTopic;
- topic.results = {
- summary: "passed"
- };
- lastTopic.test.setResults(topic.results);
+ lastTopic.test.setResults(true);
return topic;
},
- "the results are correct": function (topic) {
- assert.strictEqual(topic.last.test.results.summary, topic.results.summary);
+ "the results were set": function (topic) {
+ assert.isTrue(topic.last.test.results);
}
},
"when marked executing": {

0 comments on commit 7851a87

Please sign in to comment.