[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Clean up parserTests output.

2017-03-02 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/340664 )

Change subject: Clean up parserTests output.
..


Clean up parserTests output.

The whitelist is deprecated.  Warn when it's used, not when it's missing.

Print out the name of the test file in the results summary, and colorize it
so we know which test files resulted in errors.

Only emit the node version and initialization message once at startup.

Change-Id: I443f80102007cc5b542f48fdc091bc41a8e35f88
---
M bin/parserTests.js
M tests/parserTests.utils.js
2 files changed, 11 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Arlolra: Looks good to me, approved



diff --git a/bin/parserTests.js b/bin/parserTests.js
index b3226b0..a471b7f 100755
--- a/bin/parserTests.js
+++ b/bin/parserTests.js
@@ -51,8 +51,8 @@
this.whiteListPath = path.resolve(parseFilePath.dir, whiteListName);
try {
this.testWhiteList = require(this.whiteListPath).testWhiteList;
+   console.warn('Using whitelist from ' + this.whiteListPath);
} catch (e) {
-   console.warn('No whitelist found at ' + this.whiteListPath);
this.testWhiteList = {};
}
 
diff --git a/tests/parserTests.utils.js b/tests/parserTests.utils.js
index 04834b0..ffcd57c 100644
--- a/tests/parserTests.utils.js
+++ b/tests/parserTests.utils.js
@@ -50,9 +50,12 @@
 var reportSummary = function(modesRan, stats, file, loggedErrorCount, 
testFilter) {
var curStr, mode, thisMode;
var failTotalTests = stats.failedTests;
+   var happiness = (
+   stats.passedTestsUnexpected === 0 && 
stats.failedTestsUnexpected === 0
+   );
 

console.log("==");
-   console.log("SUMMARY: ");
+   console.log("SUMMARY:", happiness ? file.green : file.red);
if (console.time && console.timeEnd) {
console.timeEnd('Execution time');
}
@@ -381,14 +384,18 @@
return asExpected;
 }
 
+var _reportOnce = false;
 /**
  * Simple function for reporting the start of the tests.
  *
  * This method can be reimplemented in the options of the ParserTests object.
  */
 var reportStartOfTests = function() {
-   console.log('ParserTests running with node', process.version);
-   console.log('Initialization complete. Now launching tests.');
+   if (!_reportOnce) {
+   _reportOnce = true;
+   console.log('ParserTests running with node', process.version);
+   console.log('Initialization complete. Now launching tests.');
+   }
 };
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/340664
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I443f80102007cc5b542f48fdc091bc41a8e35f88
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian 
Gerrit-Reviewer: Arlolra 
Gerrit-Reviewer: C. Scott Ananian 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Clean up parserTests output.

2017-03-01 Thread C. Scott Ananian (Code Review)
C. Scott Ananian has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340664 )

Change subject: Clean up parserTests output.
..

Clean up parserTests output.

The whitelist is deprecated.  Warn when it's used, not when it's missing.

Print out the name of the test file in the results summary, and colorize it
so we know which test files resulted in errors.

Only emit the node version and initialization message once at startup.

Change-Id: I443f80102007cc5b542f48fdc091bc41a8e35f88
---
M bin/parserTests.js
M tests/parserTests.utils.js
2 files changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/64/340664/1

diff --git a/bin/parserTests.js b/bin/parserTests.js
index 5d7030c..681f2e1 100755
--- a/bin/parserTests.js
+++ b/bin/parserTests.js
@@ -51,8 +51,8 @@
this.whiteListPath = path.resolve(parseFilePath.dir, whiteListName);
try {
this.testWhiteList = require(this.whiteListPath).testWhiteList;
+   console.warn('Using whitelist from ' + this.whiteListPath);
} catch (e) {
-   console.warn('No whitelist found at ' + this.whiteListPath);
this.testWhiteList = {};
}
 
@@ -1492,6 +1492,7 @@
var ptests = new ParserTests(testFilePath, options.modes);
return ptests.main(options, mockURL)
.then(function(s) {
+   options.reportStart = function() { }; // quiet startup 
message
return status + s;  // Add up the status codes
});
}, 0);
diff --git a/tests/parserTests.utils.js b/tests/parserTests.utils.js
index 04834b0..f98379c 100644
--- a/tests/parserTests.utils.js
+++ b/tests/parserTests.utils.js
@@ -50,9 +50,12 @@
 var reportSummary = function(modesRan, stats, file, loggedErrorCount, 
testFilter) {
var curStr, mode, thisMode;
var failTotalTests = stats.failedTests;
+   var happiness = (
+   stats.passedTestsUnexpected === 0 && 
stats.failedTestsUnexpected === 0
+   );
 

console.log("==");
-   console.log("SUMMARY: ");
+   console.log("SUMMARY:", happiness ? file.green : file.red);
if (console.time && console.timeEnd) {
console.timeEnd('Execution time');
}

-- 
To view, visit https://gerrit.wikimedia.org/r/340664
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I443f80102007cc5b542f48fdc091bc41a8e35f88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: C. Scott Ananian 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits