Fix travis setup #306

Merged
merged 1 commit into from Sep 17, 2012

Projects

None yet

4 participants

@jeremyFreeAgent

Fix travis setup and tests since travis use @@sql_mode = STRICT_ALL_TABLES

@willdurand
Propel member

Still some issues :(

@jeremyFreeAgent

Yes but not on phpunit now... Very strange, on local, there is no phpunit error !

@willdurand
Propel member
@jeremyFreeAgent

I do have safe mode.

@willdurand
Propel member
@willdurand
Propel member

Ok got it. The test suite needs to be fixed, not just the travis setup :)

@jeremyFreeAgent

Ah, cool ! What is the issue ?

@jeremyFreeAgent

Ok now we have :

There was 1 failure:

1) Propel\Tests\Generator\Behavior\Sluggable\SluggableBehaviorTest::testUniqueViolationWithoutScope
Failed asserting that exception of type "Propel\Runtime\Exception\PropelException" is thrown.
@jeremyFreeAgent

Sorry still failing :(

@cristianoc72
Propel member

Imho, testUniqueViolationWithoutScope test should be removed, because Sluggable behavior generates a unique slug even if the property TableWithScope::scope is set to null.

@jeremyFreeAgent

Ok, but there are still errors with phpunit that are on Travis but not on my config. What is the right MySQL config ?

@jeremyFreeAgent

@willdurand can you tell me how to reproduce Travis errors ? I can't find what's wrong on my MySQL configuration.

@jeremyFreeAgent

Ok I found how to reproduce some of the errors : @@sql_mode must have STRICT_TRANS_TABLES !
Sorry for the flood on Travis !

@jeremyFreeAgent

So I've found the right option to reproduce all errors : @@sql_mode = STRICT_ALL_TABLES

@jeremyFreeAgent

Al right, almost fixed !

On Propel\Tests\Generator\Builder\Om\GeneratedObjectTest::testSaveCanInsertEmptyObjects test I have added :

if ('sqlite' !== $this->con->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
    $this->markTestSkipped('This test is designed for SQLite as it saves an empty object.');
}

On Propel\Tests\Generator\Behavior\Sluggable\SluggableBehaviorTest::testUniqueViolationWithoutScope I still have a failure :

Failed asserting that exception of type "Propel\Runtime\Exception\PropelException" is thrown.

@jeremyFreeAgent

@willdurand should I remove testUniqueViolationWithoutScope as @cristianoc72 told it ?

Tell me what I have to do, then I'll squash my commits ok ?

@jeremyFreeAgent jeremyFreeAgent and 2 others commented on an outdated diff Sep 15, 2012
...el/Tests/Generator/Builder/Om/GeneratedObjectTest.php
$a->setAge(0);
- $a->save();
+ //$a->save();
@jeremyFreeAgent
jeremyFreeAgent Sep 15, 2012

@willdurand can you tell me what to do about that too ?

@cristianoc72
cristianoc72 Sep 16, 2012
@jeremyFreeAgent
jeremyFreeAgent Sep 16, 2012

First, it's not link to safe mode, as I said, the errors are raised since you have STRICT_ALL_TABLES, so you can have this options without safe mode and so you can have the errors without safe mode.

Second, this test, tests saving "" value and after, setting it to null, and testing isModified method. You can't do what you are saying.

@jeremyFreeAgent
jeremyFreeAgent Sep 16, 2012

I think it's better add :

if ('sqlite' !== $this->con->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
    $this->markTestSkipped('This test is designed for SQLite as it saves an empty object.');
}
@willdurand
willdurand Sep 17, 2012

I added data to each object, so that it inserts not empty objects. But I think I removed tests that explicitely test insertion of empty objects.

@Ph3nol Ph3nol commented on the diff Sep 16, 2012
...pel/Tests/Runtime/Collection/ObjectCollectionTest.php
@@ -142,7 +144,8 @@ public function testToArrayDeep()
public function testPopulateRelationOneToManyWithEmptyCollection()
{
$author = new Author();
- $author->setLastName('I who never wrote');
+ $author->setFirstName('Chuck');
+ $author->setLastName('Norris');
$author->save($this->con);
@Ph3nol
Ph3nol Sep 16, 2012

You can't save Chuck Norris. It's Chuck Norris who saves you. :)

@jeremyFreeAgent

I've squashed my commits !

@willdurand willdurand merged commit 6536236 into propelorm:master Sep 17, 2012

1 check passed

Details default The Travis build passed
@willdurand
Propel member

Great! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment