When not explicitly providing a '--url' parameter, mysterious things happen because the '--url' is followed by nothing (not even an empty '') so it eats up the next switch (either '--color' or '--php').

This patch also contains minor documentation improvements:

  • The help text insinuates you should run this script "from the root directory of your Drupal installation", but this isn't necessary because the script does chdir() to there.
  • The ", or root" was removed.
  • Mentioned SimpleTest's cache clearing so programmers know they need to do '--clear' for SimpleTest to see their new testcases.

Comments

mooffie’s picture

[...] so programmers know they need to do '--clear' for SimpleTest to see [...]

(I meant '--clean', not '--clear'.)

damien tournoud’s picture

Status: Needs review » Needs work

D'oh. Let's escape all the arguments ($concurrency, $test_id, $tests).

carlos8f’s picture

Title: run-tests.sh must escape argument for '--url' » run-tests.sh: escape shell arguments and improve documentation
Status: Needs work » Needs review
StatusFileSize
new2.02 KB

It took me a couple hours of debugging to trace my empty test results back to the missing "--url" argument value. The $args['url'] value was "--php", which reset the $_SERVER['HTTP_HOST'] value to an empty string, which failed the drupal_valid_http_host() check, exiting all the child processes with 400 Bad Request responses. Doh indeed!

This patch escapes all shell arguments and contains the documentation tweaks.

Status: Needs review » Needs work

The last submitted patch failed testing.

carlos8f’s picture

Status: Needs work » Needs review
StatusFileSize
new2 KB

OK, that failed pretty hard :) spelled 'command' w/ 3 m's. LOL

MichaelCole’s picture

#5: run-tests-escapeshellarg.2.patch queued for re-testing.

das-peter’s picture

Hi there,

I was struggling running the simpletests wit the run-test.sh script.
There are already several known issues. My patch should fix some of them.

Issues:
- Detecting php binary as described here: http://drupal.org/node/331580
I've added a detection method for windows. But I'm sure it wont work for all environments

- Escaping command as described here: http://drupal.org/node/628498 this issue ;)
I've fixed the escaping stuff - even spaces in path's are supported now. Most important part is to start the command with "cmd /C"

Enhancements:
- JUnit output file format - code from here: http://www.computerminds.co.uk/hudson-and-simpletest
I've ported the code to DP7 - and it runs with hudson like a charm :)

Feedback is highly welcome.

So long,
Peter

Status: Needs review » Needs work

The last submitted patch, simpleTestRunner_WindowsFix_XmlSupport.diff, failed testing.

das-peter’s picture

Removed Windows Line-Endings.
Would be awesome if someone can tell me why the heck Eclipse adds these even if everywhere is configured "use linux style line endings" :|

das-peter’s picture

Status: Needs work » Needs review

Trigger testing

Status: Needs review » Needs work

The last submitted patch, simpleTestRunner_WindowsFix_XmlSupport.diff, failed testing.

das-peter’s picture

Status: Needs work » Needs review
thedavidmeister’s picture

Issue summary: View changes
Status: Needs review » Closed (duplicate)

@das-peter I don't know why Eclipse adds windows line endings, but my feedback is the patch doesn't apply ;)

I assume I'm OK to close this thread as a duplicate of the one you've posted.