Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/50620


Change subject: Add --run-disabled and --run-php options.
......................................................................

Add --run-disabled and --run-php options.

These parallel the --run-disabled and --run-parsoid options for the
PHP parser tests (see https://gerrit.wikimedia.org/r/50476 ).

At the moment --run-disabled is true by default (so use --run-disabled=no
or --no-run-disabled to turn it off) because many parsoid-specific tests
are still marked with the 'disabled' option.  Once those are all switched
over to using the 'parsoid' options, the default for --run-disabled should
switch to false.

The test-running logic for parsoid's parserTests now matches the
PHP parserTests logic (see tests/testHelpers.inc in the above change set).

Change-Id: Ia2dc633cf49e6daec59662901ed65731efb8a064
---
M js/tests/parserTests.js
1 file changed, 19 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/20/50620/1

diff --git a/js/tests/parserTests.js b/js/tests/parserTests.js
index 4b02bd5..fd9fbfe 100644
--- a/js/tests/parserTests.js
+++ b/js/tests/parserTests.js
@@ -185,8 +185,16 @@
                        description: 'Only run tests whose descriptions which 
match given regex',
                        alias: 'regex'
                },
-               'disabled': {
-                       description: 'Run disabled tests (option not 
implemented)',
+               'run-disabled': {
+                       description: 'Run disabled tests',
+                       // this defaults to true because historically 
parsoid-only tests
+                       // were marked as 'disabled'.  Once these are all 
changed to
+                       // 'parsoid', this default should be changed to false.
+                       'default': true,
+                       'boolean': true
+               },
+               'run-php': {
+                       description: 'Run php-only tests',
                        'default': false,
                        'boolean': true
                },
@@ -1049,6 +1057,9 @@
                options.getActualExpected = this.getActualExpected.bind( this );
        }
 
+       // test case filtering
+       this.runDisabled = booleanOption(options['run-disabled']);
+       this.runPHP = booleanOption(options['run-php']);
        this.test_filter = null;
        if ( options.filter ) { // null is the 'default' by definition
                try {
@@ -1199,6 +1210,7 @@
 
        if ( i < this.cases.length ) {
                item = this.cases[i];
+               if (!item.options) { item.options = {}; }
                // Reset the cached results for the new case.
                // All test modes happen in a single run of processCase.
                item.cachedHTML = null;
@@ -1213,9 +1225,12 @@
                                        this.processArticle( item, nextCallback 
);
                                        break;
                                case 'test':
-                                       if( this.test_filter &&
-                                               -1 === item.title.search( 
this.test_filter ) ) {
+                                               if( ('disabled' in item.options 
&& !this.runDisabled) ||
+                                                   ('php' in item.options && 
!this.runPHP) ||
+                                                   (this.test_filter &&
+                                                    -1 === item.title.search( 
this.test_filter ) ) ) {
                                                // Skip test whose title does 
not match --filter
+                                               // or which is disabled or 
php-only
                                                process.nextTick( nextCallback 
);
                                                break;
                                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2dc633cf49e6daec59662901ed65731efb8a064
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <wikime...@cscott.net>

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

Reply via email to