While trying to convert t.d.o to use the shell script I ran into this issue.

The --php parameter does not work properly.

DamZ figured it out in IRC and this fix works.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boombatower’s picture

Title: Fin run-tests.sh (for testing.drupal.org) » Fix run-tests.sh (for testing.drupal.org)
Damien Tournoud’s picture

The logical order is: patch by myself, RTBC by boombatower.

This is a testing.drupal.org blocker at the moment.

boombatower’s picture

Please make sure you are in contact with me when this goes in as I need to update t.d.o.
Otherwise it will get a bunch of incorrect results.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

moshe weitzman’s picture

Status: Fixed » Active

Actually, now you have broken automatic discovery of the php path. Back to where we started.

The first condition below is now always true.


// Determine location of php command automatically, unless a comamnd line argument is supplied.
  if (isset($args['php'])) {
    $php = $args['php'];
  }
  elseif (isset($_ENV['_'])) {
    // '_' is an environment variable set by the shell. It contains the command that was executed.
    $php = $_ENV['_'];
  }

Damien Tournoud’s picture

@moshe: isset() returns FALSE when an array item is set to NULL (strange, but true).

Do you have any issue with the autodetection?

moshe weitzman’s picture

Yes, I get this output. Clearly only the initial php script worked.

~/htd/pr$ php scripts/run-tests.sh --url http://mm/pr --verbose --color --all

Drupal test run
---------------

All tests will run.

Test run started: Tue, 10/28/2008 - 10:38

Test summary:
-------------

./scripts/run-tests.sh: line 1: ?php: No such file or directory
./scripts/run-tests.sh: line 2: //: is a directory
./scripts/run-tests.sh: line 3: /Applications: is a directory
./scripts/run-tests.sh: line 4: CHANGELOG.txt: command not found
./scripts/run-tests.sh: line 5: CHANGELOG.txt: command not found
./scripts/run-tests.sh: line 6: CVS/: is a directory
./scripts/run-tests.sh: line 8: syntax error near unexpected token `'SIMPLETEST_SCRIPT_COLOR_PASS','
./scripts/run-tests.sh: line 8: `define('SIMPLETEST_SCRIPT_COLOR_PASS', 32); // Green.'

Test run duration: 0 sec
Detailed test results:
----------------------

Damien Tournoud’s picture

Title: Fix run-tests.sh (for testing.drupal.org) » Fix run-tests.sh (for good)
Status: Active » Needs review
FileSize
1.06 KB

Pfff. Sorry about that.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed that this fixed auto-discovery issue.

Damien Tournoud’s picture

Also confirmed we did not introduce a regression.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.