Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is something of a bluesky, long term request, but can we integrate with PHP unit testing for servers that have v8 installed using v8js and Zombie, or some other headless JS testing environment?
This post on v8js looks interesting: http://css.dzone.com/articles/running-javascript-inside-php
There is some prior art for using QUnit w/ Zombie: https://github.com/bergie/zombie-qunit
Comments
Comment #1
attiks CreditAttribution: attiks commentedRob Loach pointed me to this from #237566: Automated JavaScript unit testing framework, we created TestSwarm to test javascript in real browsers. I like the idea of headless, server based testing, something like Selenium can do as well, it makes it really easy to integrate inside SimpleTest and CI, but it can IMHO not replace real browser testing.
To conclude, I think there's place for both testing approaches and we might need them both for Drupal core.
Comment #2
ethanw CreditAttribution: ethanw commentedThanks for bringing the other libraries into the mix.
First, re: TestSwarm, I'm curious how well it works for continuous integration testing, as my understanding is that volunteer browsers are required to run the tests. My thought in recommending a server-side js solution for unit testing is that this is a faster-turnaround approach for testing patches to JS code etc. I'd be interested to hear the jQuery folks experience w/ TestSwarm and what we'd need in the Drupal community to make it a viable testing strategy.
Re: Selenium, I would agree that there's likely a place for both JS unit testing and browser/headless functional testing. There may be something of a question of priority: whether we need to take on Functional or Unit testing first, but it might also be component specific. For Backbone, for instance, it makes a lot more sense to use unit tests, since the module doesn't actually produce any testable HTML outside of an application.
So, I suppose we're left with: we're going to need both functional and unit testing, and we need to see if TestSwarm is adequate for continuous integration of Drupal module and core development. Is that fair?
Comment #3
attiks CreditAttribution: attiks commented@ethanw, yes it relies on the community and our mileage may vary, i asked to owner of http://jquerytesting.pbworks.com to send us some details.
Your conclusion is fair, we probable need both
Comment #4
attiks CreditAttribution: attiks commentedI created https://github.com/jquery/testswarm/issues/114 as well to ask for the same.
And http://forum.jquery.com/topic/experience-with-http-swarm-jquery-org
Comment #5
RobLoachBoth would probably be needed.
Comment #6
attiks CreditAttribution: attiks commentedApparently jQuery switched to using browserstack.org to do most of the testing, because crowd testing wasn't really working for them.