propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 399 forks source link

Configuring and running the tests suite #60

Closed hhamon closed 12 years ago

hhamon commented 13 years ago

Hi all,

I would like to know how to configure and run the tests suite of Propel. I have specified all my db identifiers in build.properties and runtime-conf.xml files in tests/Fixtures.

But when I prepare the tests suite with the reset_tests exectable file, I got the following error:

Execution of target "check-buildprops-for-propel-gen" failed for the following reason: /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.

BUILD FAILED
/Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.
Total time: 0.1338 seconds

I suppose I need to change something in tools/generator directory but what???

Any clue to help me configure the tests suite please?

Thanks.

willdurand commented 13 years ago

Wow! Is this for bookstore ?

Try the following commands:

cd tests/Fixtures/bookstore
../../../tools/generator/bin/propel-gen main

And paste the output :)

Le 21 nov. 2011 à 06:54, Hugo Hamonreply@reply.github.com a écrit :

Hi all,

I would like to know how to configure and run the tests suite of Propel. I have specified all my db identifiers in build.properties and runtime-conf.xml files in tests/Fixtures.

But when I prepare the tests suite with the reset_tests exectable file, I got the following error:

Execution of target "check-buildprops-for-propel-gen" failed for the following reason: /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.

BUILD FAILED /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified. Total time: 0.1338 seconds

I suppose I need to change something in tools/generator directory but what???

Any clue to help me configure the tests suite please?

Thanks.


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60

hhamon commented 13 years ago

There it is...

Hugo:Fixtures Hugo$ ../../tools/generator/bin/propel-gen main
Buildfile: /Users/Hugo/Development/Propel2/tools/generator/build.xml
[resolvepath] Resolved /Users/Hugo/Development/Propel2/tests/Fixtures to /Users/Hugo/Development/Propel2/tests/Fixtures

propel-project-builder > check-project-or-dir-set:

propel-project-builder > check-project-set:

propel-project-builder > set-project-dir:

propel-project-builder > check-buildprops-exists:

propel-project-builder > check-buildprops-for-propel-gen:

     [echo] ==========================================================
     [echo]                    Welcome to Propel!
     [echo]  
     [echo] The propel-gen script requires a build.properties file
     [echo] to run. Either you didn't create one already, or this file
     [echo] is not where the propel-gen script is looking for it.
     [echo]  
     [echo] Expected build.properties file location is:
     [echo]   /Users/Hugo/Development/Propel2/tests/Fixturesbuild.properties
     [echo]  
     [echo] The propel-gen script expects the name of a task to execute:
     [echo]  
     [echo] $> propel-gen [taskname]
     [echo]  
     [echo] If you call the script from another directory than the one where
     [echo] where the build.properties file is, set the path to this
     [echo] file as first argument of the script:
     [echo]  
     [echo] $> propel-gen /path/to/projectdir [taskname]
     [echo]  
     [echo] Available tasknames are:
     [echo]   om
     [echo]   convert-conf
     [echo]   sql
     [echo]   insert-sql
     [echo]   diff
     [echo]   status
     [echo]   migrate
     [echo]   up
     [echo]   down
     [echo]   reverse
     [echo]   ... and a few others.
     [echo] But you should start by creating a schema.
     [echo] ==========================================================
Execution of target "check-buildprops-for-propel-gen" failed for the following reason: /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.

BUILD FAILED
/Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.
Total time: 0.1456 seconds
willdurand commented 13 years ago

Are you in the bookstore directory ? It seems there is no build.properties ?

Le 21 nov. 2011 à 07:52, Hugo Hamonreply@reply.github.com a écrit :

There it is...

Hugo:Fixtures Hugo$ ../../tools/generator/bin/propel-gen main Buildfile: /Users/Hugo/Development/Propel2/tools/generator/build.xml [resolvepath] Resolved /Users/Hugo/Development/Propel2/tests/Fixtures to /Users/Hugo/Development/Propel2/tests/Fixtures

propel-project-builder > check-project-or-dir-set:

propel-project-builder > check-project-set:

propel-project-builder > set-project-dir:

propel-project-builder > check-buildprops-exists:

propel-project-builder > check-buildprops-for-propel-gen:

    [echo] ==========================================================
    [echo]                    Welcome to Propel!
    [echo]  
    [echo] The propel-gen script requires a build.properties file
    [echo] to run. Either you didn't create one already, or this file
    [echo] is not where the propel-gen script is looking for it.
    [echo]  
    [echo] Expected build.properties file location is:
    [echo]   /Users/Hugo/Development/Propel2/tests/Fixturesbuild.properties
    [echo]  
    [echo] The propel-gen script expects the name of a task to execute:
    [echo]  
    [echo] $> propel-gen [taskname]
    [echo]  
    [echo] If you call the script from another directory than the one where
    [echo] where the build.properties file is, set the path to this
    [echo] file as first argument of the script:
    [echo]  
    [echo] $> propel-gen /path/to/projectdir [taskname]
    [echo]  
    [echo] Available tasknames are:
    [echo]   om
    [echo]   convert-conf
    [echo]   sql
    [echo]   insert-sql
    [echo]   diff
    [echo]   status
    [echo]   migrate
    [echo]   up
    [echo]   down
    [echo]   reverse
    [echo]   ... and a few others.
    [echo] But you should start by creating a schema.
    [echo] ==========================================================

Execution of target "check-buildprops-for-propel-gen" failed for the following reason: /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.

BUILD FAILED /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified. Total time: 0.1456 seconds


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2811901

hhamon commented 13 years ago

Oops sorry, I wasn't in the bookstore directory. Everything goes fine when I run the command from the bookstore directory.

willdurand commented 13 years ago

But the test script fails, right ? I guess some fails are 'normal'..

Le 21 nov. 2011 à 08:16, Hugo Hamonreply@reply.github.com a écrit :

Oops sorry, I wasn't in the bookstore directory. Everything goes fine when I run the command from the bookstore directory.


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2812131

hhamon commented 13 years ago

When I run the ./tests/reset_tests from the root of the repository, the build fails and I have the error:

Execution of target "check-buildprops-for-propel-gen" failed for the following reason: /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.

BUILD FAILED
/Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.
Total time: 0.1373 seconds
hhamon commented 13 years ago

Looks like the build for the bookstore is fine, this is for the other projects that fails.

willdurand commented 13 years ago

At this end ? Or for the last project ? This script repeats a command in all directories in tests/Fixtures.

Le 21 nov. 2011 à 08:22, Hugo Hamonreply@reply.github.com a écrit :

When I run the ./tests/reset_tests from the root of the repository, the build fails and I have the error:

Execution of target "check-buildprops-for-propel-gen" failed for the following reason: /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.

BUILD FAILED /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified. Total time: 0.1373 seconds


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2812168

willdurand commented 13 years ago

So there is no problem :) Yeah, I know..

Envoyé de mon iPhone

Le 21 nov. 2011 à 08:26, Hugo Hamonreply@reply.github.com a écrit :

Looks like the build for the bookstore is fine, this is for the other projects that fails.


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2812194

jaugustin commented 13 years ago

This should be on the todo list, cleanup reset_test ;) and made configuration for testsuit easier

willdurand commented 13 years ago

I'm on! I worked on a new shell script...

Envoyé de mon iPhone

Le 21 nov. 2011 à 09:27, Jérémie Augustinreply@reply.github.com a écrit :

This should be on the todo list, cleanup reset_test ;) and made configuration for testsuit easier


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2812531

hhamon commented 13 years ago

So what would be the expected result? Do we only need the bookstore or the other projects for the tests suite?

willdurand commented 13 years ago

I think everything is ok if the bookstore works. Try to run phpunit.

Le 21 nov. 2011 à 09:36, Hugo Hamonreply@reply.github.com a écrit :

So what would be the expected result? Do we only need the bookstore or the other projects for the tests suite?


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2812622

hhamon commented 13 years ago

Ok so the tests suite runs but breaks in the middle...

    PHPUnit 3.6.3 by Sebastian Bergmann.

Configuration read from /Users/Hugo/Development/Propel2/phpunit.xml.dist

...........................E.................................   61 / 2305 (  2%)
.............................................................  122 / 2305 (  5%)
..........................................S..................  183 / 2305 (  7%)
.............................................................  244 / 2305 ( 10%)
.............................................................  305 / 2305 ( 13%)
.........S...S...............................................  366 / 2305 ( 15%)
.............................................................  427 / 2305 ( 18%)
.............................................................  488 / 2305 ( 21%)
.............................................................  549 / 2305 ( 23%)
.............................................................  610 / 2305 ( 26%)
.............................................................  671 / 2305 ( 29%)
.............................................................  732 / 2305 ( 31%)
.............................................................  793 / 2305 ( 34%)
.............................................................  854 / 2305 ( 37%)
.............................................................  915 / 2305 ( 39%)
.............................................................  976 / 2305 ( 42%)
............................................................. 1037 / 2305 ( 44%)
............................................................. 1098 / 2305 ( 47%)
............................................................. 1159 / 2305 ( 50%)
............................................................. 1220 / 2305 ( 52%)
............................................................. 1281 / 2305 ( 55%)
......................................F...................... 1342 / 2305 ( 58%)
....................................S..EEEE......F........... 1403 / 2305 ( 60%)
............................................................. 1464 / 2305 ( 63%)
............................................................. 1525 / 2305 ( 66%)
............................................................. 1586 / 2305 ( 68%)
............................................................. 1647 / 2305 ( 71%)
............................................................. 1708 / 2305 ( 74%)
............................................................. 1769 / 2305 ( 76%)
............................................................. 1830 / 2305 ( 79%)
............................................................. 1891 / 2305 ( 82%)
............................................................. 1952 / 2305 ( 84%)
............................................................. 2013 / 2305 ( 87%)
............................................................. 2074 / 2305 ( 89%)
............................................................. 2135 / 2305 ( 92%)
............................................................. 2196 / 2305 ( 95%)
......................................S...SSSSS.............. 2257 / 2305 ( 97%)
..............................................SS

Time: 38 seconds, Memory: 250.75Mb

There were 5 errors:

1) Propel\Tests\Generator\Behavior\AggregateColumn\AggregateColumnBehaviorWithSchemaTest::testComputeWithSchema
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'contest.bookstore_contest_entry' doesn't exist

/Users/Hugo/Development/Propel2/src/Propel/Runtime/Connection/StatementWrapper.php:66
/Users/Hugo/Development/Propel2/src/Propel/Runtime/Connection/ConnectionWrapper.php:403
/Users/Hugo/Development/Propel2/src/Propel/Runtime/Query/ModelCriteria.php:1319
/Users/Hugo/Development/Propel2/src/Propel/Runtime/Query/ModelCriteria.php:1173
/Users/Hugo/Development/Propel2/tests/Fixtures/schemas/build/classes/Propel/Tests/BookstoreSchemas/Om/BaseBookstoreContestEntryQuery.php:703
/Users/Hugo/Development/Propel2/tests/Fixtures/schemas/build/classes/Propel/Tests/BookstoreSchemas/Om/BaseBookstoreContestEntryQuery.php:636
/Users/Hugo/Development/Propel2/src/Propel/Runtime/Query/ModelCriteria.php:1612
/Users/Hugo/Development/Propel2/tests/Propel/Tests/Generator/Behavior/AggregateColumn/AggregateColumnBehaviorWithSchemaTest.php:55

2) Propel\Tests\Runtime\Adapter\Pdo\OracleAdapterTest::testApplyLimitSimple
Declaration of Propel\Runtime\Adapter\Pdo\OracleAdapter::initConnection() should be compatible with that of Propel\Runtime\Adapter\Pdo\PdoAdapter::initConnection()

/Users/Hugo/Development/Propel2/src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php:35
/Users/Hugo/Development/Propel2/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php:229
/Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Adapter/Pdo/OracleAdapterTest.php:33

3) Propel\Tests\Runtime\Adapter\Pdo\OracleAdapterTest::testApplyLimitDuplicateColumnName
Argument 2 passed to Propel\Runtime\ServiceContainer\StandardServiceContainer::setAdapter() must implement interface Propel\Runtime\Adapter\AdapterInterface, instance of Propel\Runtime\Adapter\Pdo\OracleAdapter given, called in /Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Adapter/Pdo/OracleAdapterTest.php on line 45 and defined

/Users/Hugo/Development/Propel2/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php:142
/Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Adapter/Pdo/OracleAdapterTest.php:45

4) Propel\Tests\Runtime\Adapter\Pdo\OracleAdapterTest::testApplyLimitDuplicateColumnNameWithColumn
Argument 2 passed to Propel\Runtime\ServiceContainer\StandardServiceContainer::setAdapter() must implement interface Propel\Runtime\Adapter\AdapterInterface, instance of Propel\Runtime\Adapter\Pdo\OracleAdapter given, called in /Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Adapter/Pdo/OracleAdapterTest.php on line 58 and defined

/Users/Hugo/Development/Propel2/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php:142
/Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Adapter/Pdo/OracleAdapterTest.php:58

5) Propel\Tests\Runtime\Adapter\Pdo\OracleAdapterTest::testCreateSelectSqlPart
Argument 2 passed to Propel\Runtime\ServiceContainer\StandardServiceContainer::setAdapter() must implement interface Propel\Runtime\Adapter\AdapterInterface, instance of Propel\Runtime\Adapter\Pdo\OracleAdapter given, called in /Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Adapter/Pdo/OracleAdapterTest.php on line 74 and defined

/Users/Hugo/Development/Propel2/src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php:142
/Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Adapter/Pdo/OracleAdapterTest.php:74

--

There were 2 failures:

1) Propel\Tests\Generator\Reverse\MysqlSchemaParserTest::testParse
One table and one view defined should return one as we exclude views
Failed asserting that 0 matches expected 1.

/Users/Hugo/Development/Propel2/tests/Propel/Tests/Generator/Reverse/MysqlSchemaParserTest.php:57

2) Propel\Tests\Runtime\Collection\ArrayCollectionTest::testToArray
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'Id' => 450
     'Title' => 'Harry Potter and the Order of...hoenix'
     'ISBN' => '043935806X'
-    'Price' => 10.99
+    'Price' => 10.989999771118
     'PublisherId' => 338
     'AuthorId' => 357
 )

/Users/Hugo/Development/Propel2/tests/Propel/Tests/Runtime/Collection/ArrayCollectionTest.php:150

FAILURES!
Tests: 2305, Assertions: 5476, Failures: 2, Errors: 5, Skipped: 12.
fzaninotto commented 13 years ago

I have the OracleAdapter issues as well, probably a case-sensitivity problem that wasn't detected on Macs!

I'll fix this in a new PR.

willdurand commented 13 years ago

There is no problem on ci.propelorm.org except 3 unit tests: two due to encoding issues, and a new one since François' last PR.

Le 21 nov. 2011 à 10:14, Francois Zaninottoreply@reply.github.com a écrit :

I have the OracleAdapter issues as well, probably a case-sensitivity problem that wasn't detected on Macs!

I'll fix this in a new PR.


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2812955

fzaninotto commented 13 years ago

The OracleAdapter test failures show on my VM. I think it's because of the ERROR_LEVEL which catches E_STRICT notices on my VM and not on my laptop. It's fixed by #61.

About this new error introduced by me, I am flabbergasted. See the rounding issue? I absolutely don't know where this comes from.

Oh, and until we fix the character encoding problems, I suggest to skip these tests in the tests suite.

willdurand commented 13 years ago

Yep agreed to skip these tests. Don't know the cause of the round issue, really weird..

Le 21 nov. 2011 à 10:43, Francois Zaninottoreply@reply.github.com a écrit :

The OracleAdapter test failures show on my VM. I think it's because of the ERROR_LEVEL which catches E_STRICT notices on my VM and not on my laptop. It's fixed by #61.

About this new error introduced by me, I am flabbergasted. See the rounding issue? I absolutely don't know where this comes from.

Oh, and until we fix the character encoding problems, I suggest to skip these tests in the tests suite.


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2813229

hhamon commented 13 years ago

The tests suite needs the reverse_bookstore database and its table. But the generator tool is not able to create them...

Execution of target "check-buildprops-for-propel-gen" failed for the following reason: /Users/Hugo/Development/Propel2/tools/generator/build.xml:95:15: No project directory specified.

Configuration problem?

willdurand commented 13 years ago

@hhamon you can try the new-prepare-test-script branch.

hhamon commented 13 years ago

Seems to be better ;)

hhamon commented 13 years ago

I still have 3/4 tests that don't pass but no more major errors.

hhamon commented 13 years ago

En fait non, je fais comment pour builder maintenant ?

willdurand commented 13 years ago

Look at ci.propelorm.org and compare results.

Hamonreply@reply.github.com a écrit :

I still have 3/4 tests that don't pass but no more major errors.


Reply to this email directly or view it on GitHub: https://github.com/propelorm/Propel2/issues/60#issuecomment-2817373

hhamon commented 13 years ago

502 Bad Gateway nginx

willdurand commented 12 years ago

I'm closing this issue as the test suite runs successfully on a lot of platforms, even Windows :)