Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Oct 2009 at 14:43 UTC
Updated:
27 Nov 2010 at 17:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
joshk commented+1 for this
This kind of output will easy integration with Hudson and other external test mgmt systems.
I also like that this shows how to do it in a more modular fashion with an extensible pattern.
Comment #2
ezraw commentedTested this patch tonight and it output xml as expected. Thanks for posting it. I haven't tested it with Hudson yet, but that's next on the list. If you have any helpful tips on doing so, I'd be grateful.
Comment #3
ezraw commentedThe XML output works with Hudson for me.
I have about 200 test errors, some from core functionality -- is that normal? Here is the Hudson output: http://drupalbin.com/11879
Comment #4
boombatower commentedThis should be done in Drupal 7 core...since it is going into feature freeze not sure what to say. SimpleTest 6.x-2.x is intended to be a backport of 7.
Comment #5
boombatower commentedWe are continuing feature development, as suggested by chx (checkout recent Drupal Planet activity).
I'll take a look at this later, also I would like to abstract the reporter.
Comment #6
steven jones commentedGiven that I wrote the script referenced in the first post, subscribe.
Comment #8
pwolanin commentedis there an issue for core?
Comment #9
pwolanin commentedLet's get this into core - it's just addition of another output format to the wrapper script to improve integration possibilities.
Comment #10
pwolanin commentedHere's a patch that seems to work for D7 with some cleanup.
Comment #11
pwolanin commentedComment #12
pwolanin commenteda few relevant references:
http://ant.1045680.n5.nabble.com/schema-for-junit-xml-output-td1375274.h...
http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools...
http://stackoverflow.com/questions/442556/spec-for-junit-xml-output
Comment #13
boombatower commented/me wonders when feature development of Drupal 7 actually stops.
Comment #14
pwolanin commentedboombatower - this is not anything I'd qualify as a real "feature". In's not really part of drupal core, jsut a helper script. Putting is in this script just means people don't have to fork the script to get more output formats
Comment #15
moshe weitzman commentedIf I'm not mistaken, PIFR has some home grown XML output (or it did in v1) so this would deprecate that code as well. +1
Comment #16
steven jones commentedIs it possible to test this? Guessing that we can't run tests in tests to ensure that the output is the correct, valid JUnit XML?
Comment #17
boombatower commentedPlease take a look at simpletest.test.
Comment #18
pwolanin commentedApparently a number of people are already using the 6.x versionof this patch (which is in pressflow) to integrate with Hudson.
I think that's basically the test - can you get Hudson to parse and report the xml output.
Comment #19
steven jones commentedIf only a schema for JUnit output existed...oh well.
Guess we'll need someone to plug it into Hudson then...
Comment #20
steven jones commentedProbably should do this sooner rather than later...will spin up hudson tomorrow and get him testing.
Comment #21
steven jones commentedThis is working nicely with Hudson. The result is nice and valid.
I've added exception reporting too in the attached patch.
Comment #22
steven jones commentedActually, we'll use the error element for exceptions, not the failure one.
Comment #23
nikgregory commentedI ran this on an ubuntu install and it seems to work well.
Comment #24
seanberto commentedSorry if it's a n00b question, but I can't seem to get run-tests to output to an xml file.
* I've run the patch in #22 on 7.0-alpha7.
* I've created a tests directory at scripts/tests. I've set the permissions on this directory to be globably writable.
* From within that directory, I'm running the shell command:
/usr/bin/php run-tests.sh --url http://example.com --all --php /usr/bin/php --xml scripts/tests
I see the output in my terminal session and the tests are running - but nothing is written to this directory. I've tried making the path to the directory relative to scripts as well, but no luck.
I'm guessing that there's something easy that I'm missing?
Thanks for the help. I'm excited to have Hudson up and running and building D7 successfully. I'll be even more stoked when I can help with automated testing!
Cheers,
Sean
Comment #25
seanberto commentedAha, solved my own issue. It was a permissions oversight. Gotta make sure that scripts/tests directory is writable by Drupal.
Comment #26
sunAlthough badly needed, this sounds like D8 material to me.
Comment #27
pwolanin commentedDon't be silly. This has no impact on core's functionality.
Comment #28
sunTrust me, I know. But Drupal core maintainers only take actually required bug fixes into account for D7. Everything else is D8 material for now. I'm with you. I had to learn the hard way.
Comment #29
pwolanin commentedI think this is still suitable for D7, though obviously critical issues come before.
Comment #30
steven jones commented#22: 602332-xml-reporter.patch queued for re-testing.
Comment #31
dasjowould be great to get it in!
Comment #32
dixon_subscribing
Comment #33
nooble commented#22: 602332-xml-reporter.patch queued for re-testing.
Comment #34
tom_o_t commentedsimpletest-junit-xml-output.patch queued for re-testing.
Comment #35
dries commentedCommitted to CVS HEAD. Thanks.
Comment #36
seanberto commentedHurray!!!!