Skip to content

Commit

Permalink
Migrate for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Big-Shark committed Dec 10, 2015
1 parent 4360dc3 commit 56d4e98
Show file tree
Hide file tree
Showing 20 changed files with 387 additions and 123 deletions.
171 changes: 150 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,164 @@ php:
- 5.4
- 5.5
- 5.6
- hhvm
- 7.0
- nightly

env:
- DB=agnostic #only database agnostic tests
- DB=mysql DB_USER=root #only database tests against mysql
- DB=pgsql DB_USER=postgres DB_NAME=postgres #only database tests against postgresql
- DB=agnostic #only database agnostic tests
- DB=mysql
- DB=sqlite

before_script:
# Composer
- wget http://getcomposer.org/composer.phar
- php composer.phar install --prefer-dist
before_install:
- travis_retry composer self-update

install:
- travis_retry composer install --prefer-dist --no-interaction

- if [ "$DB" != 'agnostic' ]; then ./tests/bin/setup.$DB.sh; fi # setup only for integration tests
before_script:
- if [[ $DB != 'agnostic' && $DB != 'sqlite' ]]; then ./tests/bin/setup.$DB.sh; fi

script:
- ./tests/bin/phpunit.$DB.sh;
- ./vendor/bin/phpunit -v -c tests/$DB.phpunit.xml;


matrix:
fast_finish: true
allow_failures:
- php: hhvm
include:
- php: 5.4
env: DB=mysql MARIADB=5.5
addons:
mariadb: 5.5
- php: 5.5
env: DB=mysql MARIADB=5.5
addons:
mariadb: 5.5
- php: 5.6
env: DB=mysql MARIADB=5.5
addons:
mariadb: 5.5
- php: 7.0
env: DB=mysql MARIADB=5.5
addons:
mariadb: 5.5

- php: 5.4
env: DB=mysql MARIADB=10.0
addons:
mariadb: 10.0
- php: 5.5
env: DB=mysql MARIADB=10.0
addons:
mariadb: 10.0
- php: 5.6
env: DB=mysql MARIADB=10.0
addons:
mariadb: 10.0
- php: 7.0
env: DB=mysql MARIADB=10.0
addons:
mariadb: 10.0

- php: 5.4
env: DB=mysql MARIADB=10.1
addons:
mariadb: 10.1
- php: 5.5
env: DB=mysql MARIADB=10.1
addons:
mariadb: 10.1
- php: 5.6
env: DB=mysql MARIADB=10.1
addons:
mariadb: 10.1
- php: 7.0
env: DB=mysql MARIADB=10.1
addons:
mariadb: 10.1

- php: 5.4
env: DB=pgsql POSTGRES=9.1
addons:
postgresql: 9.1
- php: 5.5
env: DB=pgsql POSTGRES=9.1
addons:
postgresql: 9.1
- php: 5.6
env: DB=pgsql POSTGRES=9.1
addons:
postgresql: 9.1
- php: 7.0
env: DB=pgsql POSTGRES=9.1
addons:
postgresql: 9.1

- php: 5.4
env: DB=pgsql POSTGRES=9.2
addons:
postgresql: 9.2
- php: 5.5
env: DB=pgsql POSTGRES=9.2
addons:
postgresql: 9.2
- php: 5.6
env: DB=pgsql POSTGRES=9.2
addons:
postgresql: 9.2
- php: 7.0
env: DB=pgsql POSTGRES=9.2
addons:
postgresql: 9.2

- php: 5.4
env: DB=pgsql POSTGRES=9.3
addons:
postgresql: 9.3
- php: 5.5
env: DB=pgsql POSTGRES=9.3
addons:
postgresql: 9.3
- php: 5.6
exclude:
- php: hhvm
env: DB=pgsql DB_USER=postgres DB_NAME=postgres # driver currently unsupported by HHVM
- php: hhvm
env: DB=sqlite # some issues at the moment

#after_script:
# - php vendor/bin/coveralls -v
env: DB=pgsql POSTGRES=9.3
addons:
postgresql: 9.3
- php: 7.0
env: DB=pgsql POSTGRES=9.3
addons:
postgresql: 9.3

- php: 5.4
env: DB=pgsql POSTGRES=9.4
addons:
postgresql: 9.4
- php: 5.5
env: DB=pgsql POSTGRES=9.4
addons:
postgresql: 9.4
- php: 5.6
env: DB=pgsql POSTGRES=9.4
addons:
postgresql: 9.4
- php: 7.0
env: DB=pgsql POSTGRES=9.4
addons:
postgresql: 9.4

allow_failures:
- php: nightly

fast_finish: true

# cache vendors
cache:
directories:
- vendor
- $HOME/.composer/cache

# This triggers builds to run on the new TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false

notifications:
webhooks:
- http://propel.jarves.io/build.php
- https://webhooks.gitter.im/e/206efe76e183f9ade489
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Propel2 is an open-source Object-Relational Mapping (ORM) for PHP 5.4.

[![Build Status](https://circleci.com/gh/propelorm/Propel2/tree/master.png?style=shield)](https://circleci.com/gh/propelorm/Propel2/tree/master)
[![Build Status](https://travis-ci.org/propelorm/Propel2.svg?branch=master)](https://travis-ci.org/propelorm/Propel2)
[![Code Climate](https://codeclimate.com/github/propelorm/Propel2/badges/gpa.svg)](https://codeclimate.com/github/propelorm/Propel2)
<a href="https://codeclimate.com/github/propelorm/Propel2"><img src="https://codeclimate.com/github/propelorm/Propel2/badges/coverage.svg" /></a>
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/propelorm/Propel)
Expand Down
3 changes: 1 addition & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- echo "memory_limit=520M" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/memlimit.ini
- if [ "$CIRCLE_NODE_INDEX" = "1" ]; then ./tests/bin/setup.mysql.sh; fi
- if [ "$CIRCLE_NODE_INDEX" = "2" ]; then ./tests/bin/setup.pgsql.sh; fi
- if [ "$CIRCLE_NODE_INDEX" = "3" ]; then ./tests/bin/setup.sqlite.sh; fi

notify:
webhooks:
Expand All @@ -20,5 +19,5 @@ notify:

test:
override:
- ./tests/bin/phpunit.circleci.sh:
- ./tests/bin/circleci.sh:
parallel: true
34 changes: 13 additions & 21 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
>

Expand All @@ -17,6 +16,19 @@
</testsuite>
</testsuites>

<groups>
<exclude>
<group>pgsql</group>
<group>mysql</group>
</exclude>
</groups>

<php>
<env name="DB" value="mysql"/> <!-- mysql, sqlite, pgsql -->
<env name="DB_USER" value=""/>
<env name="DB_PW" value=""/>
</php>

<logging>
<!--<log type="coverage-php" target="tests/clover.cov"/>-->
<!--<log type="coverage-html" target="tests/coverage-report" charset="UTF-8"
Expand All @@ -26,26 +38,6 @@
<filter>
<whitelist>
<directory>src/Propel/</directory>
<exclude>
<directory>src/Propel/Generator/Builder/SQL/Mssql</directory>
<directory>src/Propel/Generator/Builder/SQL/Oracle</directory>
<directory>src/Propel/Generator/Builder/SQL/Sqlsrv</directory>

<file>src/Propel/Generator/Platform/MssqlPlatform.php</file>
<file>src/Propel/Generator/Platform/OraclePlatform.php</file>
<file>src/Propel/Generator/Platform/SqlsrvPlatform.php</file>

<file>src/Propel/Generator/Reverse/MssqlSchemaParser.php</file>
<file>src/Propel/Generator/Reverse/OracleSchemaParser.php</file>
<file>src/Propel/Generator/Reverse/SqlsrvSchemaParser.php</file>

<directory>src/Propel/Runtime/Adapter/MSSQL</directory>
<file>src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php</file>
<file>src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php</file>
<file>src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php</file>

<file>src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>
5 changes: 5 additions & 0 deletions tests/Propel/Tests/BookstoreLoggingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ public function testQueryFilter()
$this->assertEquals($author->getId(), $foundAuthor->getId());
}

/**
*
* @group mysql
* @group pgsql
*/
public function testQueryJoins()
{
if ($this->runningOnSQLite()) {
Expand Down
28 changes: 14 additions & 14 deletions tests/Propel/Tests/Issues/Issue646Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ protected function setUp()
parent::setUp();
if (!class_exists('\PkDate')) {
$schema = '
<database name="test" defaultIdMethod="native"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<table name="pk_date">
<column name="created_at" type="DATE" primaryKey="true" />
<column name="name" type="VARCHAR"/>
</table>
<table name="pk_time">
<column name="created_at" type="TIME" primaryKey="true" />
<column name="name" type="VARCHAR"/>
</table>
<table name="pk_timestamp">
<column name="created_at" type="TIMESTAMP" primaryKey="true" />
<column name="name" type="VARCHAR"/>
</table>';
<database name="test" defaultIdMethod="native" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<table name="pk_date">
<column name="created_at" type="DATE" primaryKey="true" />
<column name="name" type="VARCHAR"/>
</table>
<table name="pk_time">
<column name="created_at" type="TIME" primaryKey="true" />
<column name="name" type="VARCHAR"/>
</table>
<table name="pk_timestamp">
<column name="created_at" type="TIMESTAMP" primaryKey="true" />
<column name="name" type="VARCHAR"/>
</table>
</database>';
QuickBuilder::buildSchema($schema);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Propel/Tests/TestCaseFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected function getFixturesConnectionDsn()
if (!$db || 'agnostic' === $db) {
$db = 'mysql';
}

$dsn = $db . ':host=' . (getenv('DB_HOSTNAME') ?: '127.0.0.1' ) . ';dbname=';
$dsn .= getenv('DB_NAME') ?: 'test';

Expand Down
43 changes: 43 additions & 0 deletions tests/agnostic.phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="bootstrap.php">

<testsuites>
<testsuite name="Propel2 Test Suite">
<directory>Propel/Tests/</directory>
</testsuite>
</testsuites>

<groups>
<exclude>
<group>database</group>
<group>pgsql</group>
<group>mysql</group>
</exclude>
</groups>

<filter>
<whitelist>
<directory>../src/Propel/</directory>
<exclude>
<directory>../src/Propel/Generator/Builder/SQL/Mssql</directory>
<directory>../src/Propel/Generator/Builder/SQL/Oracle</directory>
<directory>../src/Propel/Generator/Builder/SQL/Sqlsrv</directory>

<file>../src/Propel/Generator/Platform/MssqlPlatform.php</file>
<file>../src/Propel/Generator/Platform/OraclePlatform.php</file>
<file>../src/Propel/Generator/Platform/SqlsrvPlatform.php</file>

<file>../src/Propel/Generator/Reverse/MssqlSchemaParser.php</file>
<file>../src/Propel/Generator/Reverse/OracleSchemaParser.php</file>
<file>../src/Propel/Generator/Reverse/SqlsrvSchemaParser.php</file>

<directory>../src/Propel/Runtime/Adapter/MSSQL</directory>
<file>../src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php</file>
<file>../src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php</file>
<file>../src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php</file>

<file>../src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>
13 changes: 0 additions & 13 deletions tests/bin/base.sh

This file was deleted.

Loading

0 comments on commit 56d4e98

Please sign in to comment.