Development

#1696 (lime framework returns 'dubious')

You must first sign up to be able to contribute.

Ticket #1696 (closed defect: fixed)

Opened 2 years ago

Last modified 3 months ago

lime framework returns 'dubious'

Reported by: snowkrash Assigned to: fabien
Priority: major Milestone: 1.0.4
Component: lime Version: 1.0.2
Keywords: lime dubious passthru Cc:
Qualification: Unreviewed

Description

This happens in Symfony 1.0.3-PRE.

When I try to run a unit test, it never works, even an empty one ... it fails in the lime.php code, when accessing php CLI.

Test code

include(dirname(__FILE__).'/../bootstrap/unit.php');
//require_once(SF_ROOT_DIR.'/apps/stageselect/lib/configLoader.class.php');

$oTest = new lime_test(1, new lime_output());

$oTest->diag('configLoader()');
$oTest->ok(true === true, 'This works!');

Running

symfony test-unit configLoader

Return

configLoaderTest.....................................................dubious
    Test returned status 1
Failed Test                     Stat  Total   Fail  List of Failed
------------------------------------------------------------------
configLoaderTest                   1      0      0
Failed 1/1 test scripts, 0.00% okay. 0/0 subtests failed, 0.00% okay.

Here I get that freaky dubious message :-(

That status return of value 1 comes from lime.php, line 458. passthru() returns 1 after executing the PHP CLI. The PHP docs only mentions UNIX return values, but I am on Windows (XAMPP).

I am guessing my Windows XAMPP PHP CLI works differently from its UNIX sister?

But running php test/unit/configLoaderTest.php

Works OK:

1..1
# configLoader()
ok 1 - This works!

Help

What's up with those passthru() returns codes ... is there a Windows / UNIX mixup?

Attachments

configLoaderTest.php (1.9 kB) - added by snowkrash on 05/03/07 07:58:21.
Testscript

Change History

04/23/07 08:13:04 changed by snowkrash

Well,

in lime.php, class lime_harness constructor the PHP CLI location/program is fetched on line 395.

$this->php_cli = null === $php_cli ? PHP_BINDIR.DIRECTORY_SEPARATOR.'php' : $php_cli;

The PHP_BINDIR constant is (somewhere?) set to C:\PHP5 and the executable is default php.

My PHP, named php-win.exe executable is in C:\Program Files\xampp\php. I added a line to override this (no spaces in path to avoid kaboom):

$this->php_cli = 'C:\progra~1\xampp\php\php-win.exe';

Where can I force lime to use my specific CLI without my own hack?

I am on Windows XP SP2 with XAMPP 1.54a (PHP 5.1.6).

05/03/07 07:57:29 changed by snowkrash

Hmmmm ... not sure how, but the test-unit task works fine now, but test-all still returns a complete dubious list and status 1.

E:\Websites\projects\stageselect>symfony test-all
(....)
unit/configLoaderTest................................................dubious
    Test returned status 1
unit/paginaLoaderTest................................................dubious
    Test returned status 1
unit/utilitiesTest...................................................dubious
    Test returned status 1
Failed Test                     Stat  Total   Fail  List of Failed
------------------------------------------------------------------
(....)
unit/configLoaderTest              1      0      0
unit/paginaLoaderTest              1      0      0
unit/utilitiesTest                 1      0      0
Failed 12/12 test scripts, 0.00% okay. 0/0 subtests failed, 0.00% okay.

I attached one of my unit testscripts ... the rest is the same concerning the preloads and config.

The contstant checks are necessary, because when testing with test-unit * the define() statements shoot notices, because the constants have been defined in the first testscript.

05/03/07 07:58:21 changed by snowkrash

  • attachment configLoaderTest.php added.

Testscript

06/09/07 10:02:36 changed by fabien

  • milestone changed from 1.0.3 to 1.0.4.

06/18/07 14:18:15 changed by fabien

  • component changed from tests to lime.

06/19/07 08:06:30 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

As of symfony 1.0.4 and lime 1.0.3, you can declare a PHP_PATH environment variable to override the PHP CLI used for lime harness.

10/16/08 12:31:48 changed by hirose

  • status changed from closed to reopened.
  • resolution deleted.
  • qualification set to Unreviewed.

Looks like PHP_PATH environment does not effect. $this->php_cli will be overwriten at last line below.

  function __construct($output_instance, $php_cli = null)
  {
    if (getenv('PHP_PATH'))
    {
      $this->php_cli = getenv('PHP_PATH');

      if (!is_executable($this->php_cli))
      {
        throw new Exception('The defined PHP_PATH environment variable is not a valid PHP executable.');
      }
    }

    $this->php_cli = null === $php_cli ? PHP_BINDIR.DIRECTORY_SEPARATOR.'php' : $php_cli;

10/16/08 14:25:26 changed by fabien

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [12216]) [lime] fixed php CLI path guessing (closes #1696)