зеркало из https://github.com/mozilla/gecko-dev.git
Bug 763169 - Part c: Don't log all the passing results; f=philor r=jhammel
This commit is contained in:
Родитель
8b517156fc
Коммит
c403b93455
|
@ -17,6 +17,13 @@ var W3CTest = {
|
|||
*/
|
||||
"tests": [],
|
||||
|
||||
/**
|
||||
* Number of unlogged passes, to stop buildbot from truncating the log.
|
||||
* We will print a message every MAX_COLLAPSED_MESSAGES passes.
|
||||
*/
|
||||
"collapsedMessages": 0,
|
||||
"MAX_COLLAPSED_MESSAGES": 100,
|
||||
|
||||
/**
|
||||
* Reference to the TestRunner object in the parent frame.
|
||||
*/
|
||||
|
@ -44,12 +51,31 @@ var W3CTest = {
|
|||
*/
|
||||
"_log": function(test) {
|
||||
var msg = this.prefixes[+test.todo][+test.result] + " | ";
|
||||
if (this.runner.currentTestURL)
|
||||
if (this.runner.currentTestURL) {
|
||||
msg += this.runner.currentTestURL;
|
||||
}
|
||||
msg += " | " + test.message;
|
||||
this.runner[(test.result === !test.todo) ? "log" : "error"](msg);
|
||||
},
|
||||
|
||||
/**
|
||||
* Maybe logs a result, eliding up to MAX_COLLAPSED_MESSAGES consecutive
|
||||
* passes.
|
||||
*/
|
||||
"_maybeLog": function(test) {
|
||||
var success = (test.result === !test.todo);
|
||||
if (success && ++this.collapsedMessages < this.MAX_COLLAPSED_MESSAGES) {
|
||||
return;
|
||||
}
|
||||
this._log({
|
||||
"result": true,
|
||||
"todo": false,
|
||||
"message": "Elided " + this.collapsedMessages + " passes."
|
||||
});
|
||||
this.collapsedMessages = 0;
|
||||
this._log(test);
|
||||
},
|
||||
|
||||
/**
|
||||
* Reports a test result. The argument is an object with the following
|
||||
* properties:
|
||||
|
@ -60,7 +86,7 @@ var W3CTest = {
|
|||
*/
|
||||
"report": function(test) {
|
||||
this.tests.push(test);
|
||||
this._log(test);
|
||||
this._maybeLog(test);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче