Skip to content

Commit 0299c23

Browse files
committed
Merge pull request #1000 from Big-Shark/tr
Migrate from circle to travis
2 parents 24a6720 + c8f65e6 commit 0299c23

22 files changed

+398
-147
lines changed

.travis.yml

Lines changed: 150 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,164 @@ php:
44
- 5.4
55
- 5.5
66
- 5.6
7-
- hhvm
7+
- 7.0
8+
- nightly
89

910
env:
10-
- DB=agnostic #only database agnostic tests
11-
- DB=mysql DB_USER=root #only database tests against mysql
12-
- DB=pgsql DB_USER=postgres DB_NAME=postgres #only database tests against postgresql
11+
- DB=agnostic #only database agnostic tests
12+
- DB=mysql
1313
- DB=sqlite
1414

15-
before_script:
16-
# Composer
17-
- wget http://getcomposer.org/composer.phar
18-
- php composer.phar install --prefer-dist
15+
before_install:
16+
- travis_retry composer self-update
17+
18+
install:
19+
- travis_retry composer install --prefer-dist --no-interaction
1920

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

2224
script:
23-
- ./tests/bin/phpunit.$DB.sh;
25+
- ./vendor/bin/phpunit -v -c tests/$DB.phpunit.xml;
2426

2527

2628
matrix:
27-
fast_finish: true
28-
allow_failures:
29-
- php: hhvm
29+
include:
30+
- php: 5.4
31+
env: DB=mysql MARIADB=5.5
32+
addons:
33+
mariadb: 5.5
34+
- php: 5.5
35+
env: DB=mysql MARIADB=5.5
36+
addons:
37+
mariadb: 5.5
38+
- php: 5.6
39+
env: DB=mysql MARIADB=5.5
40+
addons:
41+
mariadb: 5.5
42+
- php: 7.0
43+
env: DB=mysql MARIADB=5.5
44+
addons:
45+
mariadb: 5.5
46+
47+
- php: 5.4
48+
env: DB=mysql MARIADB=10.0
49+
addons:
50+
mariadb: 10.0
51+
- php: 5.5
52+
env: DB=mysql MARIADB=10.0
53+
addons:
54+
mariadb: 10.0
55+
- php: 5.6
56+
env: DB=mysql MARIADB=10.0
57+
addons:
58+
mariadb: 10.0
59+
- php: 7.0
60+
env: DB=mysql MARIADB=10.0
61+
addons:
62+
mariadb: 10.0
63+
64+
- php: 5.4
65+
env: DB=mysql MARIADB=10.1
66+
addons:
67+
mariadb: 10.1
68+
- php: 5.5
69+
env: DB=mysql MARIADB=10.1
70+
addons:
71+
mariadb: 10.1
72+
- php: 5.6
73+
env: DB=mysql MARIADB=10.1
74+
addons:
75+
mariadb: 10.1
76+
- php: 7.0
77+
env: DB=mysql MARIADB=10.1
78+
addons:
79+
mariadb: 10.1
80+
81+
- php: 5.4
82+
env: DB=pgsql POSTGRES=9.1
83+
addons:
84+
postgresql: 9.1
85+
- php: 5.5
86+
env: DB=pgsql POSTGRES=9.1
87+
addons:
88+
postgresql: 9.1
89+
- php: 5.6
90+
env: DB=pgsql POSTGRES=9.1
91+
addons:
92+
postgresql: 9.1
93+
- php: 7.0
94+
env: DB=pgsql POSTGRES=9.1
95+
addons:
96+
postgresql: 9.1
97+
98+
- php: 5.4
99+
env: DB=pgsql POSTGRES=9.2
100+
addons:
101+
postgresql: 9.2
102+
- php: 5.5
103+
env: DB=pgsql POSTGRES=9.2
104+
addons:
105+
postgresql: 9.2
106+
- php: 5.6
107+
env: DB=pgsql POSTGRES=9.2
108+
addons:
109+
postgresql: 9.2
110+
- php: 7.0
111+
env: DB=pgsql POSTGRES=9.2
112+
addons:
113+
postgresql: 9.2
114+
115+
- php: 5.4
116+
env: DB=pgsql POSTGRES=9.3
117+
addons:
118+
postgresql: 9.3
119+
- php: 5.5
120+
env: DB=pgsql POSTGRES=9.3
121+
addons:
122+
postgresql: 9.3
30123
- php: 5.6
31-
exclude:
32-
- php: hhvm
33-
env: DB=pgsql DB_USER=postgres DB_NAME=postgres # driver currently unsupported by HHVM
34-
- php: hhvm
35-
env: DB=sqlite # some issues at the moment
36-
37-
#after_script:
38-
# - php vendor/bin/coveralls -v
124+
env: DB=pgsql POSTGRES=9.3
125+
addons:
126+
postgresql: 9.3
127+
- php: 7.0
128+
env: DB=pgsql POSTGRES=9.3
129+
addons:
130+
postgresql: 9.3
131+
132+
- php: 5.4
133+
env: DB=pgsql POSTGRES=9.4
134+
addons:
135+
postgresql: 9.4
136+
- php: 5.5
137+
env: DB=pgsql POSTGRES=9.4
138+
addons:
139+
postgresql: 9.4
140+
- php: 5.6
141+
env: DB=pgsql POSTGRES=9.4
142+
addons:
143+
postgresql: 9.4
144+
- php: 7.0
145+
env: DB=pgsql POSTGRES=9.4
146+
addons:
147+
postgresql: 9.4
148+
149+
allow_failures:
150+
- php: nightly
151+
152+
fast_finish: true
153+
154+
# cache vendors
155+
cache:
156+
directories:
157+
- vendor
158+
- $HOME/.composer/cache
159+
160+
# This triggers builds to run on the new TravisCI infrastructure.
161+
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
162+
sudo: false
163+
164+
notifications:
165+
webhooks:
166+
- http://propel.jarves.io/build.php
167+
- https://webhooks.gitter.im/e/206efe76e183f9ade489

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
[![Build Status](https://circleci.com/gh/propelorm/Propel2/tree/master.png?style=shield)](https://circleci.com/gh/propelorm/Propel2/tree/master)
5+
[![Build Status](https://travis-ci.org/propelorm/Propel2.svg?branch=master)](https://travis-ci.org/propelorm/Propel2)
66
[![Code Climate](https://codeclimate.com/github/propelorm/Propel2/badges/gpa.svg)](https://codeclimate.com/github/propelorm/Propel2)
77
<a href="https://codeclimate.com/github/propelorm/Propel2"><img src="https://codeclimate.com/github/propelorm/Propel2/badges/coverage.svg" /></a>
88
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/propelorm/Propel)

circle.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ dependencies:
1010
- echo "memory_limit=520M" > ~/.phpenv/versions/$(phpenv global)/etc/conf.d/memlimit.ini
1111
- if [ "$CIRCLE_NODE_INDEX" = "1" ]; then ./tests/bin/setup.mysql.sh; fi
1212
- if [ "$CIRCLE_NODE_INDEX" = "2" ]; then ./tests/bin/setup.pgsql.sh; fi
13-
- if [ "$CIRCLE_NODE_INDEX" = "3" ]; then ./tests/bin/setup.sqlite.sh; fi
1413

1514
notify:
1615
webhooks:

phpunit.xml.dist

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
convertWarningsToExceptions="true"
88
processIsolation="false"
99
stopOnFailure="false"
10-
syntaxCheck="false"
1110
bootstrap="tests/bootstrap.php"
1211
>
1312

@@ -17,6 +16,19 @@
1716
</testsuite>
1817
</testsuites>
1918

19+
<groups>
20+
<exclude>
21+
<group>pgsql</group>
22+
<group>mysql</group>
23+
</exclude>
24+
</groups>
25+
26+
<php>
27+
<env name="DB" value="mysql"/> <!-- mysql, sqlite, pgsql -->
28+
<env name="DB_USER" value=""/>
29+
<env name="DB_PW" value=""/>
30+
</php>
31+
2032
<logging>
2133
<!--<log type="coverage-php" target="tests/clover.cov"/>-->
2234
<!--<log type="coverage-html" target="tests/coverage-report" charset="UTF-8"
@@ -26,26 +38,6 @@
2638
<filter>
2739
<whitelist>
2840
<directory>src/Propel/</directory>
29-
<exclude>
30-
<directory>src/Propel/Generator/Builder/SQL/Mssql</directory>
31-
<directory>src/Propel/Generator/Builder/SQL/Oracle</directory>
32-
<directory>src/Propel/Generator/Builder/SQL/Sqlsrv</directory>
33-
34-
<file>src/Propel/Generator/Platform/MssqlPlatform.php</file>
35-
<file>src/Propel/Generator/Platform/OraclePlatform.php</file>
36-
<file>src/Propel/Generator/Platform/SqlsrvPlatform.php</file>
37-
38-
<file>src/Propel/Generator/Reverse/MssqlSchemaParser.php</file>
39-
<file>src/Propel/Generator/Reverse/OracleSchemaParser.php</file>
40-
<file>src/Propel/Generator/Reverse/SqlsrvSchemaParser.php</file>
41-
42-
<directory>src/Propel/Runtime/Adapter/MSSQL</directory>
43-
<file>src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php</file>
44-
<file>src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php</file>
45-
<file>src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php</file>
46-
47-
<file>src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php</file>
48-
</exclude>
4941
</whitelist>
5042
</filter>
5143
</phpunit>

src/Propel/Generator/Util/QuickBuilder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,12 @@ public function fixNamespaceDeclarations($source)
487487
protected function forceNamespace($code)
488488
{
489489
if (0 === preg_match('/\nnamespace/', $code)) {
490+
491+
$use = array_filter(explode(PHP_EOL, $code), function($string) {
492+
return substr($string, 0, 5) === 'use \\';
493+
});
494+
495+
$code = str_replace($use, '', $code);
490496
return "\nnamespace\n{\n" . $code . "\n}\n";
491497
}
492498

tests/Propel/Tests/BookstoreLoggingTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ public function testQueryFilter()
131131
$this->assertEquals($author->getId(), $foundAuthor->getId());
132132
}
133133

134+
/**
135+
*
136+
* @group mysql
137+
* @group pgsql
138+
*/
134139
public function testQueryJoins()
135140
{
136141
if ($this->runningOnSQLite()) {

tests/Propel/Tests/Generator/Behavior/Versionable/VersionableBehaviorObjectBuilderModifierTest.php

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
class VersionableBehaviorObjectBuilderModifierTest extends TestCase
2222
{
2323

24-
public function setUp()
24+
public static function setUpBeforeClass()
2525
{
26-
if (!class_exists('VersionableBehaviorTest1')) {
27-
$schema = <<<EOF
26+
$schema = <<<EOF
2827
<database name="versionable_behavior_test_1">
2928
<table name="versionable_behavior_test_1">
3029
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
@@ -65,10 +64,9 @@ public function setUp()
6564
</table>
6665
</database>
6766
EOF;
68-
QuickBuilder::buildSchema($schema);
69-
}
70-
if (!class_exists('VersionableBehaviorTest6')) {
71-
$schema2 = <<<EOF
67+
QuickBuilder::buildSchema($schema);
68+
69+
$schema2 = <<<EOF
7270
<database name="versionable_behavior_test_2" defaultPhpNamingMethod="nochange">
7371
<table name="VersionableBehaviorTest6">
7472
<column name="Id" primaryKey="true" type="INTEGER" autoIncrement="true" />
@@ -98,11 +96,9 @@ public function setUp()
9896
</table>
9997
</database>
10098
EOF;
101-
QuickBuilder::buildSchema($schema2);
102-
}
99+
QuickBuilder::buildSchema($schema2);
103100

104-
if (!class_exists('VersionableBehaviorTest8')) {
105-
$schema2 = <<<EOF
101+
$schema3 = <<<EOF
106102
<database name="versionable_behavior_test_3" defaultPhpNamingMethod="nochange">
107103
<table name="VersionableBehaviorTest8">
108104
<column name="Id" primaryKey="true" type="INTEGER" autoIncrement="true" />
@@ -117,12 +113,10 @@ public function setUp()
117113
</table>
118114
</database>
119115
EOF;
120-
QuickBuilder::buildSchema($schema2);
121-
}
116+
QuickBuilder::buildSchema($schema3);
122117

123118

124-
if (!class_exists('VersionableBehaviorTest10')) {
125-
$schema4 = <<<EOF
119+
$schema4 = <<<EOF
126120
<database name="versionable_behavior_test_4">
127121
<table name="VersionableBehaviorTest10">
128122
<column name="id" primaryKey="true" type="INTEGER" autoIncrement="true" />
@@ -153,8 +147,7 @@ public function setUp()
153147
</table>
154148
</database>
155149
EOF;
156-
QuickBuilder::buildSchema($schema4);
157-
}
150+
QuickBuilder::buildSchema($schema4);
158151
}
159152

160153
public function testGetVersionExists()

tests/Propel/Tests/Issues/Issue646Test.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ protected function setUp()
2626
parent::setUp();
2727
if (!class_exists('\PkDate')) {
2828
$schema = '
29-
<database name="test" defaultIdMethod="native"
30-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
31-
<table name="pk_date">
32-
<column name="created_at" type="DATE" primaryKey="true" />
33-
<column name="name" type="VARCHAR"/>
34-
</table>
35-
<table name="pk_time">
36-
<column name="created_at" type="TIME" primaryKey="true" />
37-
<column name="name" type="VARCHAR"/>
38-
</table>
39-
<table name="pk_timestamp">
40-
<column name="created_at" type="TIMESTAMP" primaryKey="true" />
41-
<column name="name" type="VARCHAR"/>
42-
</table>';
29+
<database name="test" defaultIdMethod="native" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
30+
<table name="pk_date">
31+
<column name="created_at" type="DATE" primaryKey="true" />
32+
<column name="name" type="VARCHAR"/>
33+
</table>
34+
<table name="pk_time">
35+
<column name="created_at" type="TIME" primaryKey="true" />
36+
<column name="name" type="VARCHAR"/>
37+
</table>
38+
<table name="pk_timestamp">
39+
<column name="created_at" type="TIMESTAMP" primaryKey="true" />
40+
<column name="name" type="VARCHAR"/>
41+
</table>
42+
</database>';
4343
QuickBuilder::buildSchema($schema);
4444
}
4545

tests/Propel/Tests/TestCaseFixtures.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ protected function getFixturesConnectionDsn()
222222
if (!$db || 'agnostic' === $db) {
223223
$db = 'mysql';
224224
}
225-
225+
226226
$dsn = $db . ':host=' . (getenv('DB_HOSTNAME') ?: '127.0.0.1' ) . ';dbname=';
227227
$dsn .= getenv('DB_NAME') ?: 'test';
228228

0 commit comments

Comments
 (0)