Marcoil has uploaded a new change for review.
https://gerrit.wikimedia.org/r/138347
Change subject: Fix various problems with rt selser results
......................................................................
Fix various problems with rt selser results
* Fixed wrong XML output for multiple testsuites, and added proper CSS.
* Next/previous links in rt selser results pages work now.
* @lh links to local _rtselser test.
* Removed selser size perfstats.
Change-Id: Ic0f685a4bcbfa796c0d301c25a5dd5f22fd3857c
---
M tests/roundtrip-test.js
M tests/server/server.js
M tests/server/static/result.css
3 files changed, 84 insertions(+), 21 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/47/138347/1
diff --git a/tests/roundtrip-test.js b/tests/roundtrip-test.js
index 063317b..ccaf53a 100755
--- a/tests/roundtrip-test.js
+++ b/tests/roundtrip-test.js
@@ -148,7 +148,7 @@
}
output += '</perfstats>\n';
}
- output += '<testsuites/>';
+ output += '</testsuites>';
return output;
};
@@ -428,7 +428,8 @@
}
};
-var parsoidPost = function ( env, parsoidURL, prefix, title, text, oldid,
profilePrefix, cb ) {
+var parsoidPost = function (env, parsoidURL, prefix, title, text, oldid,
+ recordSizes, profilePrefix, cb) {
var data = {};
if ( oldid ) {
data.oldid = oldid;
@@ -464,18 +465,23 @@
parseInt( res.headers[
'x-parsoid-performance' ].
match(
/duration=((\d)+);/ )[1], 10 );
}
- // Record the sizes
- var sizePrefix = profilePrefix + (oldid ? 'wt'
: 'html');
- env.profile.size[ sizePrefix + 'raw' ] =
- body.length;
- // Compress to record the gzipped size
- zlib.gzip( res.body, function( err, gzippedbuf
) {
- if ( !err ) {
- env.profile.size[ sizePrefix +
'gzip' ] =
- gzippedbuf.length;
- }
- cb( null, body );
- } );
+
+ if (recordSizes) {
+ // Record the sizes
+ var sizePrefix = profilePrefix + (oldid
? 'wt' : 'html');
+ env.profile.size[ sizePrefix + 'raw' ] =
+ body.length;
+ // Compress to record the gzipped size
+ zlib.gzip( res.body, function( err,
gzippedbuf ) {
+ if ( !err ) {
+ env.profile.size[
sizePrefix + 'gzip' ] =
+
gzippedbuf.length;
+ }
+ cb( null, body );
+ } );
+ } else {
+ cb(null, body);
+ }
} else {
cb( null, body );
}
@@ -527,9 +533,10 @@
cb( err, env, [] );
} else {
// Shortcut for calling parsoidPost with common
options
- var parsoidPostShort = function (postBody,
postOldId, postProfilePrefix, postCb) {
+ var parsoidPostShort = function (postBody,
postOldId,
+ postRecordSizes,
postProfilePrefix, postCb) {
parsoidPost(env, options.parsoidURL,
prefix, page,
- postBody, postOldId,
postProfilePrefix,
+ postBody, postOldId,
postRecordSizes, postProfilePrefix,
function (err, postResult) {
if (err) {
cb(err, env,
[]);
@@ -551,7 +558,7 @@
newNode =
newDocument.createComment('rtSelserEditTestComment');
newDocument.body.appendChild(newNode);
parsoidPostShort(newDocument.body.innerHTML,
-
src_and_metadata.revision.revid, 'selser',
+
src_and_metadata.revision.revid, false, 'selser',
function (wtSelserBody)
{
// Finish the
total time now
if (
env.profile && env.profile.time ) {
@@ -576,10 +583,10 @@
env.setPageSrcInfo(src_and_metadata);
// First, fetch the HTML for the requested
page's wikitext
- parsoidPostShort(env.page.src, null, null,
function (htmlBody) {
+ parsoidPostShort(env.page.src, null, true,
null, function (htmlBody) {
// Now, request the wikitext for the
obtained HTML
parsoidPostShort(htmlBody,
-
src_and_metadata.revision.revid, null,
+
src_and_metadata.revision.revid, true, null,
function (wtBody) {
roundTripDiff(env,
htmlBody, wtBody,
rtSelserTest.bind(null, htmlBody));
diff --git a/tests/server/server.js b/tests/server/server.js
index 95e227b..4f6a4d5 100755
--- a/tests/server/server.js
+++ b/tests/server/server.js
@@ -1325,13 +1325,30 @@
offset = page * 40,
data = {
page: page,
- urlPrefix: '/rtselsererrors',
+ urlPrefix: '/rtselsererrors/' + commit,
urlSuffix: '',
heading: 'Pages with rt selser errors',
header: ['Title', 'Commit', 'Syntactic diffs',
'Semantic diffs', 'Errors']
};
+ var makeSelserErrorRow = function(row) {
+ var prefix = encodeURIComponent(row.prefix),
+ title = encodeURIComponent(row.title);
+ return [
+ {
+ title: row.prefix + ':' + row.title,
+ titleUrl:
'http://parsoid.wmflabs.org/_rtselser/' + prefix + '/' + title,
+ lh: 'http://localhost:8000/_rtselser/' + prefix
+ '/' + title,
+ latest: '/latestresult/' + prefix + '/' + title,
+ perf: '/pageperfstats/' + prefix + '/' + title
+ },
+ commitLinkData(row.hash, row.title, row.prefix),
+ row.skips,
+ row.fails,
+ row.errors === null ? 0 : row.errors
+ ];
+ };
db.query(dbPagesWithRTSelserErrors, [commit, offset],
- displayPageList.bind(null, res, data, makeFailsRow));
+ displayPageList.bind(null, res, data, makeSelserErrorRow));
};
var displayOneDiffRegressions = function(numFails, numSkips, subheading,
headingLinkData, req, res){
diff --git a/tests/server/static/result.css b/tests/server/static/result.css
index a914d45..286cbff 100644
--- a/tests/server/static/result.css
+++ b/tests/server/static/result.css
@@ -25,6 +25,45 @@
content: attr(name) ":";
}
+testsuite {
+ margin-bottom: 1em;
+ display: block;
+}
+
+testsuite:before {
+ font-size: 90%;
+ font-weight: bolder;
+ color: gray;
+ margin-left: 8px;
+ content: attr(name);
+}
+
+testsuites {
+ width: 100%;
+}
+
+perfstats {
+ display: block;
+ font-size: 70%;
+ color: gray;
+}
+
+perfstats:before {
+ content: "Performance stats:";
+}
+
+perfstat {
+ display: inline;
+}
+
+perfstat:before {
+ content: attr(type) " ";
+}
+
+perfstat:after {
+ content: "ms, ";
+}
+
/* For result comparison views (flag changed skips/fails) */
FlagNewTestcases:before {
--
To view, visit https://gerrit.wikimedia.org/r/138347
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0f685a4bcbfa796c0d301c25a5dd5f22fd3857c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Marcoil <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits