-
Notifications
You must be signed in to change notification settings - Fork 386
/
.travis.yml
128 lines (114 loc) · 4.29 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
sudo: false
dist: xenial
services:
- mysql
before_install:
- unset _JAVA_OPTIONS
- rvm @default,@global do gem uninstall bundler -a -x -I || true
- gem install bundler -v "~>1.17.3"
install:
- bundle install --retry 3 --without development
# to fix this issue: https://travis-ci.community/t/mariadb-10-1-fails-to-install-on-xenial/3151/3
- mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost; GRANT ALL ON *.* TO travis@localhost;' || true
language: ruby
rvm:
- jruby-9.2.14.0
jdk:
- openjdk8
script: bundle exec rake ${TEST_PREFIX}test_$DB
before_script:
- echo "JAVA_OPTS=$JAVA_OPTS"
- export JRUBY_OPTS="-J-Xms64M -J-Xmx1024M"
- rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
- mysql --version || true # to see if we're using MySQL or MariaDB
- '[ "$DB" == "postgresql" ] && [ "$TEST_PREFIX" == "" ] && rake db:postgresql || true'
- '[ "$DB" == "mysql2" ] && [ "$TEST_PREFIX" == "" ] && rake db:mysql || true'
- '[ "$DB" == "mariadb" ] && [ "$TEST_PREFIX" == "" ] && rake db:mysql || true'
- '[ "$DB" == "jdbc" ] && rake db:mysql || true'
- '[ "$DB" == "jndi" ] && rake db:mysql || true'
# rails:test setups :
- |
[ "$DB" == "mysql2" ] && [ "$TEST_PREFIX" == "rails:" ] && \
mysql -e "CREATE USER rails@localhost;" && \
mysql -e "grant all privileges on activerecord_unittest.* to rails@localhost;" && \
mysql -e "grant all privileges on activerecord_unittest2.* to rails@localhost;" && \
mysql -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;" && \
mysql -e "CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8mb4;" && \
mysql -e "CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8mb4;" \
|| true
- |
[ "$DB" == "postgresql" ] && [ "$TEST_PREFIX" == "rails:" ] && \
psql -c "create database activerecord_unittest;" -U postgres && \
psql -c "create database activerecord_unittest2;" -U postgres \
|| true
env:
global:
- AR_VERSION="master"
matrix:
allow_failures:
- rvm: jruby-head
include:
- env: DB=mysql2 PREPARED_STATEMENTS=false
- env: DB=mysql2 PREPARED_STATEMENTS=true
- env: DB=mysql2 DRIVER=MariaDB
- addons:
postgresql: "10"
env: DB=postgresql PREPARED_STATEMENTS=false INSERT_RETURNING=false
- addons:
postgresql: "10"
env: DB=postgresql PREPARED_STATEMENTS=false INSERT_RETURNING=true
- addons:
postgresql: "10"
env: DB=postgresql PREPARED_STATEMENTS=true
- addons:
postgresql: "10"
env: DB=postgresql PREPARED_STATEMENTS=true INSERT_RETURNING=true
- addons:
postgresql: "10"
env: DB=postgresql PREPARED_STATEMENTS=true JRUBY_OPTS=-J-Duser.timezone=America/Detroit
- addons:
postgresql: "9.4"
env: DB=postgresql PREPARED_STATEMENTS=true
- env: DB=sqlite3 PREPARED_STATEMENTS=false
- env: DB=sqlite3 PREPARED_STATEMENTS=true
- env: DB=jndi PREPARED_STATEMENTS=false
- env: DB=jndi PREPARED_STATEMENTS=true
# Java 11
- env: DB=mysql2
jdk: oraclejdk11
- env: DB=postgresql
jdk: oraclejdk11
addons:
postgresql: "10"
- env: DB=sqlite3
jdk: oraclejdk11
# jruby-head
- rvm: jruby-head
env: DB=mysql2
- rvm: jruby-head
env: DB=postgresql
addons:
postgresql: "10"
- rvm: jruby-head
env: DB=sqlite3
# testing against MariaDB
- addons:
mariadb: 10.2
env: DB=mariadb PREPARED_STATEMENTS=false
- addons:
mariadb: 10.3
env: DB=mariadb PREPARED_STATEMENTS=true
# Rails test-suite :
- env: DB=mysql2 TEST_PREFIX="rails:" AR_VERSION="6-1-stable" # PS off by default
- env: DB=mysql2 TEST_PREFIX="rails:" AR_VERSION="6-1-stable" PREPARED_STATEMENTS=true
- env: DB=mysql2 TEST_PREFIX="rails:" AR_VERSION="6-1-stable" DRIVER=MariaDB
- addons:
postgresql: "10"
env: DB=postgresql TEST_PREFIX="rails:" AR_VERSION="6-1-stable" # PS on by default
- addons:
postgresql: "10"
env: DB=postgresql TEST_PREFIX="rails:" AR_VERSION="6-1-stable" PREPARED_STATEMENTS=false
- addons:
postgresql: "9.4"
env: DB=postgresql TEST_PREFIX="rails:" AR_VERSION="6-1-stable" # PS on by default
- env: DB=sqlite3 TEST_PREFIX="rails:" AR_VERSION="6-1-stable"