[Bug 30339] Implement Special:UnitTesting

2011-08-24 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=30339

--- Comment #6 from Krinkle krinklem...@gmail.com 2011-08-24 17:55:21 UTC ---
Forget the patch, I've got a better plan.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 30339] Implement Special:UnitTesting

2011-08-16 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=30339

--- Comment #5 from Roan Kattouw roan.katt...@gmail.com 2011-08-16 12:23:40 
UTC ---
(In reply to comment #4)
 cc'ing Roan. Can you figure out what's going on with $.inArray being recursed 
 ?
I don't have time for that right now, I'm sorry. It would help if you could
obtain a backtrace (it seems Chrome/WebKit doesn't give you one, but Firebug
should AFAIK), then use the debugger to try to find out why it's doing infinite
recursion.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 30339] Implement Special:UnitTesting

2011-08-15 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=30339

--- Comment #2 from Krinkle krinklem...@gmail.com 2011-08-15 08:15:37 UTC ---
Created attachment 8919
  -- https://bugzilla.wikimedia.org/attachment.cgi?id=8919
First shot at implementing Special:UnitTesting infrastructure

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 30339] Implement Special:UnitTesting

2011-08-15 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=30339

--- Comment #3 from Krinkle krinklem...@gmail.com 2011-08-15 08:25:39 UTC ---
Implementation details:
* New Special:UnitTesting page (user scripts disabled, isListed returns false
depending on $wgEnableSpecialUnitTesting)
* Shows a list of frameworks, by default only qunit
* [[Special:UnitTesting/qunit]] outputs the QUnit base html and loads
testrunner (which loads jquery.qunit and the other stuff we need) + all test
suites by passing $wgUnitTestingQUnitSuites to OutputPage's addModules().

TBD:
* As can be seen in the patch in the comment above wgUnitTestingQUnitSuites in
DefaultSettings, adding stuff for extensions looks a little funky. The reason
is simple, we don't want all test suites to be registered unless
wgEnableSpecialUnitTesting is true (to avoid polluting the start up module with
a lot of crap and making it twice or three times as big). I also considered
adding a global variable just for these modules and calling register() myself
in the SpecialUnitTesting page, but that doesn't work either because load.php
doesn't know on what page we are, so they wouldn't be registered. Plus, that
would mess up or not work at all with caching since startup has (and should
have) only 1 cache. StartUp should never depend on user or page. So I attempted
to create a hook inside ResourceLoader-__construct() that is only ran if
wgEnableSpecialUnitTesting is true. And if it is register the modules and add
the array_keys of the modules to $wgUnitTestingQUnitSuites.

The problem is that didn't work because ResourceLoader-__construct() runs
AFTER SpecialUnitTesting-execute(), so when SpecialUnitTesting-execute() did
addModules( wgUnitTestingQUnitSuites ), nothing was added. That's why I work
around this by letting extensions add their array keys to
wgUnitTestingQUnitSuites in the global scope right away, and the registry
separately through the hook. If anybody has a better solution, I would love to
change it since I'm not liking this very much.

Problems:
* When I applied this patch and set wgEnableSpecialUnitTesting to true, and
visited [[Special:UnitTesting/qunit]], I got :
 Uncaught RangeError: Maximum call stack size exceeded
in my console and none of the test suites was loaded. As a result many other
modules are broken too. (such as Exception thrown by user.options: Cannot read
property 'options' of undefined).

I suspect $.inArray in resolve() inside mw.loader's scope is doing something
wrong.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 30339] Implement Special:UnitTesting

2011-08-15 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=30339

Krinkle krinklem...@gmail.com changed:

   What|Removed |Added

 CC||roan.katt...@gmail.com

--- Comment #4 from Krinkle krinklem...@gmail.com 2011-08-15 08:26:36 UTC ---
cc'ing Roan. Can you figure out what's going on with $.inArray being recursed ?

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 30339] Implement Special:UnitTesting

2011-08-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=30339

--- Comment #1 from Krinkle krinklem...@gmail.com 2011-08-12 08:05:11 UTC ---
Roughly summarized the approach I plan to take:
* Create a Special:UnitTesting page (disable user scripts, like
preferences/login etc.)
* By default shows a list, $par is the framework of choice
* Special:UnitTesting/qunit
** Outputs the QUnit html frame
** Loads the jquery.qunit module and our testrunner
** Loads the test suites from $wgUnitTestingQUnitSuites
* $wgUnitTestingQUnitSuites is an array of module names (eg. array(
'jquery.byteLength.test' )).
* The test suites are registered as resource modules in $wgResourceModules or
Resources.php: 'jquery.byteLength.test' = array( 'scripts' = ,
'dependencies' = 'jquery.byteLength' )

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 30339] Implement Special:UnitTesting

2011-08-12 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=30339

Reedy s...@reedyboy.net changed:

   What|Removed |Added

   Severity|normal  |enhancement

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l