jenkins-bot has submitted this change and it was merged.
Change subject: Use rttest.localsettings.js for configuring the rt scripts
......................................................................
Use rttest.localsettings.js for configuring the rt scripts
* This config should match the apiServer we're setting up.
Change-Id: I4301d9bd6eb3534a087d85d72ed8005c28762132
---
M bin/roundtrip-test.js
M tools/regression-testing.js
2 files changed, 16 insertions(+), 22 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/bin/roundtrip-test.js b/bin/roundtrip-test.js
index 402ba18..38fbd90 100755
--- a/bin/roundtrip-test.js
+++ b/bin/roundtrip-test.js
@@ -536,20 +536,13 @@
// Returns a Promise for a formatted string. `cb` is optional.
function runTests(title, options, formatter, cb) {
- var setup = function(parsoidConfig) {
- // options are ParsoidConfig options if module.parent,
otherwise they
- // are CLI options (so use the Util.set* helpers to process
them)
- if (module.parent) {
- if (options && options.setup) {
- options.setup(parsoidConfig);
- }
- } else {
- Util.setTemplatingAndProcessingFlags(parsoidConfig,
options);
- Util.setDebuggingFlags(parsoidConfig, options);
- parsoidConfig.loadWMF = true;
- }
- };
- var parsoidConfig = new ParsoidConfig({ setup: setup });
+ var localSettings = module.parent ?
+ options : require('../tests/rttest.localsettings.js');
+ // Note that this config is kind of confusing in that it is only used
for
+ // fetching the page src and setting up an environment. It should be
+ // configured the same as the Parsoid found at `options.parsoidURL`.
+ // FIXME: We should probably remove it altogether.
+ var parsoidConfig = new ParsoidConfig(localSettings);
var err, domain, prefix;
if (options.prefix) {
// If prefix is present, use that.
@@ -686,9 +679,6 @@
parsoidURL: {
description: 'The URL for the Parsoid API',
},
- }, {
- // defaults for standard options
- rtTestMode: true, // suppress noise by default
});
var opts = yargs.usage(
@@ -702,7 +692,14 @@
var title = String(argv._[0]);
Promise.resolve().then(function() {
- if (argv.parsoidURL) { return; }
+ if (argv.parsoidURL) {
+ // FIXME: parsoidURL should require a configPath or
something,
+ // see the fixme above about the parsoidConfig.
+ console.log('WARNING: There may be a mismatch between
the ' +
+ 'settings of the Parsoid passed at `parsoidURL`
and what we ' +
+ 'are currently assuming in this file.');
+ return;
+ }
// Start our own Parsoid server
// TODO: This will not be necessary once we have a top-level
testing
diff --git a/tools/regression-testing.js b/tools/regression-testing.js
index 40d23d4..2b41afc 100755
--- a/tools/regression-testing.js
+++ b/tools/regression-testing.js
@@ -80,11 +80,8 @@
return Promise.reduce(titles, function(_, t) {
return rtTest.runTests(t.title, {
prefix: t.prefix,
- rtTestMode: true,
parsoidURL: ret.url,
- setup: function(parsoidConfig) {
- parsoidConfig.loadWMF = true;
- },
+ setup:
require('../tests/rttest.localsettings.js'),
}, rtTest.jsonFormat).then(
handleResult.bind(null, t)
);
--
To view, visit https://gerrit.wikimedia.org/r/281481
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4301d9bd6eb3534a087d85d72ed8005c28762132
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits