[Windmill-dev] PHPUnit integration
Mikeal Rogers
mikeal at osafoundation.org
Tue Aug 7 18:06:08 PDT 2007
Actually our tinderbox work isn't in perl at all. Tinderbox simply
runs a command line windmill which pulls in JSON or XMLRPC based
tests and spits out some text that tinderbox can parse about the
results.
I haven't used PHPUnit too much so I'm not that clear on the
specifics and what it might require to integrate.
I'll spend some time this week writing up the documentation for what
it takes to implement your own test authoring library the same way
we've authored the the python test writing library (which we're now
trying to refer to as wmpython, as we expect alternative
implementations in python as well).
If you just want to have your PHPUnit framework run a single command
line and parse the output, you could use the tinderbox option we have
and keep your tests in either JSON or Python.
If you do decide to write a new test authoring library there is one
large issue that you should be aware of that I've been meaning to
document. The issue is that the XMLRPC dispatcher we use is from the
python stdlib SimpleXMLRPCServer (I just wrote a WSGI app that wraps
it, wsgi_xmlrpc). This doesn't support dynamic assignment or
recursive attribute lookup for resolving and running dispatched
methods. Since the windmill service doesn't know what controller
methods the IDE implements until it comes up (this is so that we keep
everything dynamic and extensions can benefit from first class
support) you have to do send each callback object to execute_test or
execute_command, rather than just being able to call them outright
like regular RPC methods.
If you take a look at http://windmill.osafoundation.org/trac/browser/
windmill/trunk/windmill/authoring/__init__.py you'll see how I need
to call getControllerMethods and then dynamically assign a wrapped
method to the test client instance. This is a huge barrier for anyone
who's trying to write an authoring library right now, and most likely
makes it near impossible to write a good library in a statically
typed language.
For windmill 0.3 I'll be writing a new xmlrpc library ( which will
actually be available independently of windmill as a normal wsgi
application ) which supports dynamic assignment and recursive
attribute lookup for resolving and running dispatched methods, and
will probably use cElementTree and be much faster than the current
dispatcher. For right now tho, we have what we have.
Hope this helps.
-Mikeal
On Aug 7, 2007, at 7:03 PM, Sam Minnee wrote:
> <mpei-7013.gif>
> Hi guys,
>
> What would be involved in integration PHPUnit into Windmill, so that
> PHPUnit tests could be used instead of python files? This would mean
> that we could use existing PHPUnit code for things like database
> fixtures on our app... I understand that you're doing some work with
> perl for Tinderbox integration - this might be a similar project?
>
> It would be handy to know what major pieces will need to be
> implemented, and what existing APIs. Also, if there's any sample
> code, that would go a long way too :-)
>
> Sam
>
> Sam Minnee | Chief Technology Officer
>
> SilverStripe
> http://www.silverstripe.com
>
> Phone: +64 4 978 7334
> Mobile: +64 21 311 441
> Skype:
> Level 3
> 97-99 Courtenay Place
> Wellington, New Zealand
> <mpei-6697.gif>
> <mpei-7012.gif><mpei-7013.gif><mpei-6697.gif>
> _______________________________________________
> Windmill-dev mailing list
> Windmill-dev at osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/windmill-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/windmill-dev/attachments/20070807/41d3a4c3/attachment.html
More information about the Windmill-dev
mailing list