Simpletest writes its own output and exits, not displaying it within the context of a drupal page.

Make it really hard to report errors from your code and tests using drupal_set_message().

Comments

moshe weitzman’s picture

i think i am OK with this. Would like feedback from Rok and ThomasL.

Rok Žlender’s picture

From my point of view this would complicate automation things a bit. As things stand now test result that are run automatically are directly written into a node which then holds all test information. If test result would be displayed within drupal page it would then require some sort of parser to gather only the test results from this page and write then into a node.
If there is a simple solution on how to do this then I don't see any holdbacks.

moshe weitzman’s picture

Status: Active » Needs work

Perhaps we need a param which Rok can use to preserve current output.

@Rok - note that Simpletest comes with a way to do remote and automated testing. See http://www.lastcraft.com/reporter_documentation.php ... At one time ThomasL wanted to write our own reporter but I resisted. At this point though, I trust him to make these decisions. Anyway, the reporter link is just for your information. Might not be useful for your project anymore.

Rok Žlender’s picture

@Moshe thanks for the hint one possible solution would be to run automated tests in console that way text reporter would kick in and there would be no more problem with parsing html output. So this means I have no objections against this patch. But lets wait what Thomas has to say.

Thomas Ilsche’s picture

With the current setup we can recieve partial testresults during the testrun, that takes a long time. This is quite helpful for development, but I guess this is a feature we may abandon for better formatted output.

Also we do have a DrupalReporter that produces nicely formatted output, but it is not up to date with the forms api. If I got some spare time I'd like to port that.
TBH just having the current output inside a drupal context ist a bit dirty, if not that urgent I would like to delay this until we have a real working DrupalReporter.

For the remote usage I think it would be the easiest solution to have a "supress" option as a fallback to the current solution.

P.S. If someone cares to port it to the FAPI, feel free but let us know: http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/sandbox/mo...

Rok Žlender’s picture

StatusFileSize
new1.08 KB

Here http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/sandbox/ro... you can find updated version of drupal reporter it uses form api. At the moment it is probably very buggy and a lot of code is left from the one thomas posted. Please test it and write what you think.

This file goes into simpletest module directory and you have to apply a patch that I attached.

Rok Žlender’s picture

Version: 4.6.x-1.x-dev » 6.x-1.x-dev
Category: bug » feature

New version of drupal_reporter is available now in colors. Download both drupal_reporter.php and simpletest.css everything else is the same.

Thomas Ilsche’s picture

Status: Needs work » Closed (fixed)

I have commited the renewed DrupalReporter and css file by Rok. Aswell the patched simpletest.module, however the old reporter is still there available by uncommenting some lines.