Skip to content

Commit 96c6a12

Browse files
scfcatdt
authored andcommitted
Enable Travis CI for PostgreSQL
Setting up Jenkins tests for PostgreSQL is not a priority for WMF, so this change enables Travis CI tests run against a PostgreSQL database. At the moment, those tests will fail because various fixes for PostgreSQL issues are still pending review. However carefully testing individual commits (cf. for example https://travis-ci.org/scfc/mediawiki-core/builds/40319020) shows that the test setup itself is working as expected. Travis CI's hhvm does not support PostgreSQL, so for now this change only tests PostgreSQL with PHP 5.3. Also the range of branches that tests are run against is widened to include travis-ci/*. This allows developers to enable Travis CI in their GitHub fork of wikimedia/mediawiki and then push to such a branch without having to mess up the master or wmf/* branches with their defined meaning. Bug: 37602 Change-Id: I9c2efa3fbc589d2d4198120ca80501124b1b16b9
1 parent a56c35a commit 96c6a12

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.travis.yml

+19-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,29 @@ php:
1212
- hhvm-nightly
1313
- 5.3
1414

15+
env:
16+
- dbtype=mysql
17+
- dbtype=postgres
18+
19+
# TODO: Travis CI's hhvm does not support PostgreSQL at the moment.
20+
matrix:
21+
exclude:
22+
- php: hhvm-nightly
23+
env: dbtype=postgres
24+
1525
services:
1626
- mysql
1727

1828
branches:
19-
# Test changes in master and in Wikimedia's production branches.
29+
# Test changes in master, in Wikimedia's production and in arbitrary
30+
# Travis CI branches. The latter allows developers to enable Travis
31+
# CI in their GitHub fork of wikimedia/mediawiki and then push
32+
# changes they like to test to branches like
33+
# "travis-ci/test-this-awesome-change" without having to mess up the
34+
# master and wmf/* branches and their defined meaning.
2035
only:
2136
- master
37+
- /^travis-ci\/.*$/
2238
- /^wmf\/.*$/
2339

2440
before_install:
@@ -27,9 +43,11 @@ before_install:
2743

2844
before_script:
2945
- composer install --prefer-source --quiet --no-interaction
46+
- if [ "$dbtype" = postgres ]; then psql -c "CREATE DATABASE traviswiki WITH OWNER travis;" -U postgres; fi
3047
- >
3148
php maintenance/install.php traviswiki admin
3249
--pass travis
50+
--dbtype "$dbtype"
3351
--dbname traviswiki
3452
--dbuser travis
3553
--dbpass ""

0 commit comments

Comments
 (0)