forked from JesseChavez/activerecord-jdbc-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (99 loc) · 3.8 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
sudo: false
dist: xenial
services:
- mysql
addons:
postgresql: 9.4
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.1.16.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 utf8 COLLATE utf8_general_ci;" && \
mysql -e "CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;" \
|| true
- |
[ "$DB" == "postgresql" ] && [ "$TEST_PREFIX" == "rails:" ] && \
psql -c "create database activerecord_unittest;" -U postgres && \
psql -c "create database activerecord_unittest2;" -U postgres \
|| true
env:
- DB=mysql2 PREPARED_STATEMENTS=false
- DB=mysql2 PREPARED_STATEMENTS=true
- DB=mysql2 DRIVER=MariaDB
- DB=postgresql PREPARED_STATEMENTS=false INSERT_RETURNING=false
- DB=postgresql PREPARED_STATEMENTS=false INSERT_RETURNING=true
- DB=postgresql PREPARED_STATEMENTS=true
- DB=postgresql PREPARED_STATEMENTS=true INSERT_RETURNING=true
- DB=sqlite3 PREPARED_STATEMENTS=false
- DB=sqlite3 PREPARED_STATEMENTS=true
- DB=jndi PREPARED_STATEMENTS=false
- DB=jndi PREPARED_STATEMENTS=true
matrix:
allow_failures:
- rvm: jruby-head
include:
# jruby-9.2
- rvm: jruby-9.2.6.0
env: DB=mysql2
- rvm: jruby-9.2.6.0
env: DB=postgresql
- rvm: jruby-9.2.6.0
env: DB=sqlite3
# jruby-9.2 + Java 11
- rvm: jruby-9.2.6.0
env: DB=mysql2
jdk: openjdk11
- rvm: jruby-9.2.6.0
env: DB=postgresql
jdk: openjdk11
- rvm: jruby-9.2.6.0
env: DB=sqlite3
jdk: openjdk11
# jruby-head
- rvm: jruby-head
env: DB=mysql2
- rvm: jruby-head
env: DB=postgresql
- 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="v5.2.3" # PS off by default
- env: DB=mysql2 TEST_PREFIX="rails:" AR_VERSION="v5.2.3" PREPARED_STATEMENTS=true
- env: DB=mysql2 TEST_PREFIX="rails:" AR_VERSION="v5.2.3" DRIVER=MariaDB
- env: DB=postgresql TEST_PREFIX="rails:" AR_VERSION="v5.2.3" # PS on by default
- env: DB=postgresql TEST_PREFIX="rails:" AR_VERSION="v5.2.3" PREPARED_STATEMENTS=false
- env: DB=sqlite3 TEST_PREFIX="rails:" AR_VERSION="v5.2.3"