2

I am trying to run a group of tests(Simpletest) for my custom modules through Jenkins.

  1. Firstly I tried drush test-run (...) which has been removed from drush.

  2. Then I tried php scripts/run-tests.sh --xml logs_tests [GROUP_NAME], but for every test class it returns /usr/bin/daemon: unrecognized option '--url'. I haven't defined any URL, maybe is something Simpletest specific.

  3. Finally, I created a fairly simple Phing task <exec command="php scripts/run-tests.sh --xml logs_tests ${group_name}" error="build_error"/> only to get the response Unknown argument: --url, from Phing this time.

2 Answers 2

1

I was having the same issue you're mentioning in #2, getting this error:

/usr/bin/daemon: unrecognized option '--url'

Solution

I found that the solution to this is specifying the PHP binary to scripts/run-tests.sh as such:

php scripts/run-tests.sh --php /usr/bin/php --url http://127.0.0.1

Explanation

This is due to the way that jenkins starts programs, something like:

daemon program --parameters...

But run-tests.sh (lines 256-258) pulls the command that was run (falsely pulling daemon php --parameters) and thinks that the php binary is daemon.

The culprit code is:

 elseif ($php_env = getenv('_')) {
    // '_' is an environment variable set by the shell. It contains the command that was executed.
    $php = $php_env;
  }
1

It seems like you have tried everything except to supply the URL.

You must supply a --url argument to execute simpletest. This is what I use, where "IAS" is the test group I have selected to execute:

php scripts/run-tests.sh --url http://localhost/drupal7 --concurrency 4 IAS

It follows that you must have a Drupal install to do this.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.