Skip to content
This repository
Browse code

Updated Travis-CI configuration to have a 4 build grid.

The Travis config will now run tests on the following instances

 * 5.3 + SQLite
 * 5.3 + MySQL
 * 5.3 + PostgreSQL
 * 5.4 + MySQL

In other words, with the exception of Windows tech (MSSQL + Win server) this is a wide-coverage build config.
  • Loading branch information...
commit abbce151d9b8f4746d6a3135ebf1d136d6831b47 1 parent 93cdb83
Sam Minnée authored August 21, 2012
13  .travis.yml
... ...
@@ -1,6 +1,19 @@
1 1
 language: php 
2 2
 php: 
3 3
  - 5.3
  4
+ - 5.4
  5
+
  6
+env:
  7
+ - TESTDB=SQLITE
  8
+ - TESTDB=MYSQL
  9
+ - TESTDB=PGSQL
  10
+
  11
+matrix:
  12
+  exclude:
  13
+    - php: 5.4
  14
+      env: TESTDB=PGSQL
  15
+    - php: 5.4
  16
+      env: TESTDB=SQLITE
4 17
 
5 18
 before_script:
6 19
  - ./tests/travis/before_script ~/builds/ss 
28  tests/travis/_ss_environment.php
@@ -3,13 +3,33 @@
3 3
 
4 4
 define('SS_ENVIRONMENT_TYPE', 'dev');
5 5
 
6  
-/* Database connection */ 
7  
-define('SS_DATABASE_CLASS', 'SQLitePDODatabase');
  6
+/* Database connection */
  7
+$db = getenv('TESTDB');
  8
+switch($db) {
  9
+case "PGSQL";
  10
+	define('SS_DATABASE_CLASS', 'PostgreSQLDatabase');
  11
+	define('SS_DATABASE_USERNAME', 'postgres'); 
  12
+	define('SS_DATABASE_PASSWORD', '');
  13
+	break;
  14
+
  15
+case "MYSQL":
  16
+	define('SS_DATABASE_CLASS', 'MySQLDatabase');
  17
+	define('SS_DATABASE_USERNAME', 'root'); 
  18
+	define('SS_DATABASE_PASSWORD', '');
  19
+	break;
  20
+
  21
+default:
  22
+	define('SS_DATABASE_CLASS', 'SQLitePDODatabase');
  23
+	define('SS_DATABASE_USERNAME', 'root'); 
  24
+	define('SS_DATABASE_PASSWORD', '');
  25
+}
  26
+
  27
+echo SS_DATABASE_CLASS;
  28
+
8 29
 define('SS_DATABASE_SERVER', 'localhost'); 
9  
-define('SS_DATABASE_USERNAME', 'root'); 
10  
-define('SS_DATABASE_PASSWORD', '');
11 30
 define('SS_DATABASE_CHOOSE_NAME', true);
12 31
 
  32
+
13 33
 /* Configure a default username and password to access the CMS on all sites in this environment. */ 
14 34
 define('SS_DEFAULT_ADMIN_USERNAME', 'username'); 
15 35
 define('SS_DEFAULT_ADMIN_PASSWORD', 'password');
1  tests/travis/before_script
... ...
@@ -1,6 +1,7 @@
1 1
 BUILD_DIR=$1
2 2
 git clone --depth=100 --quiet git://github.com/silverstripe/silverstripe-installer.git $BUILD_DIR
3 3
 git clone --depth=100 --quiet git://github.com/silverstripe-labs/silverstripe-sqlite3.git $BUILD_DIR/sqlite3
  4
+git clone --depth=100 --quiet git://github.com/silverstripe/silverstripe-postgresql.git $BUILD_DIR/postgresql
4 5
 cp ./tests/travis/_ss_environment.php $BUILD_DIR
5 6
 cp ./tests/travis/_config.php $BUILD_DIR/mysite
6 7
 cp -r . $BUILD_DIR/framework

0 notes on commit abbce15

Please sign in to comment.
Something went wrong with that request. Please try again.