jenkins-bot has submitted this change and it was merged.

Change subject: parse.js: add --offline shortcut.
......................................................................


parse.js: add --offline shortcut.

Add a CLI option to turn off all possible network operations, allowing
developers to use parse.js for testing while offline.

Change-Id: Idd04616acd11d1c3522f33acb23151b49169db55
---
M tests/parse.js
1 file changed, 12 insertions(+), 0 deletions(-)

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



diff --git a/tests/parse.js b/tests/parse.js
index 39ed839..34d2f06 100755
--- a/tests/parse.js
+++ b/tests/parse.js
@@ -120,6 +120,11 @@
                'boolean': true,
                'default': false,
        },
+       'offline': {
+               description: 'Shortcut to turn off various network fetches 
during parse.',
+               'boolean': true,
+               'default': false,
+       },
 });
 exports.defaultOptions = yargs.options(standardOpts).parse([]);
 
@@ -305,6 +310,13 @@
                        argv.wt2html = true;
                }
 
+               // Offline shortcut
+               if (argv.offline) {
+                       argv.fetchConfig = false;
+                       argv.fetchTemplates = false;
+                       argv.usephppreprocessor = false;
+               }
+
                var prefix = argv.prefix || null;
 
                if (argv.apiURL) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd04616acd11d1c3522f33acb23151b49169db55
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to