Skip to content

Commit e26b15d

Browse files
authored
Merge pull request #1110 from headius/expand_gha
Expand GHA matrix
2 parents 513660a + 5ff1769 commit e26b15d

File tree

14 files changed

+228
-19
lines changed

14 files changed

+228
-19
lines changed

.github/workflows/ruby.yml

Lines changed: 214 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,36 +17,32 @@ permissions:
1717
contents: read
1818

1919
jobs:
20-
test:
20+
test-rails-mysql:
2121

22+
name: Rails Tests (MySQL)
2223
runs-on: ubuntu-latest
2324
strategy:
25+
fail-fast: false
2426
matrix:
2527
ruby-version: ['jruby-9.2.20.1']
2628
db: ['mysql2']
27-
test_prefix: ["rails:"]
29+
test_targets: ["rails:test_mysql2"]
2830
ar_version: ["6-1-stable"]
29-
prepared_statements: ['false']
30-
# prepared_statements: ['false', 'true']
31+
prepared_statements: ['false', 'true']
3132
driver: ['MySQL']
32-
# driver: ['', 'MariaDB']
3333

3434
services:
3535
mysql:
3636
image: mysql:5.7
37-
env:
38-
MYSQL_USER: root
39-
MYSQL_ROOT_PASSWORD: root
40-
MYSQL_ALLOW_EMPTY_PASSWORD: yes
4137
ports:
4238
- 3306
4339

4440
env:
4541
DB: ${{ matrix.db }}
46-
TEST_PREFIX: ${{ matrix.test_prefix }}
4742
AR_VERSION: ${{ matrix.ar_version }}
4843
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
4944
DRIVER: ${{ matrix.driver }}
45+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
5046

5147
steps:
5248
- uses: actions/checkout@v3
@@ -55,13 +51,8 @@ jobs:
5551
with:
5652
ruby-version: ${{ matrix.ruby-version }}
5753
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
58-
- name: Install dependencies
59-
run: bundle install --retry 3 --without development
6054
- name: Setup database
6155
run: |
62-
echo "JAVA_OPTS=$JAVA_OPTS"
63-
export JRUBY_OPTS="-J-Xms64M -J-Xmx1024M"
64-
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
6556
sudo service mysql start
6657
mysql --version || true # to see if we're using MySQL or MariaDB
6758
mysql -u root -proot -e "CREATE USER rails@localhost;"
@@ -70,6 +61,213 @@ jobs:
7061
mysql -u root -proot -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"
7162
mysql -u root -proot -e "CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8mb4;"
7263
mysql -u root -proot -e "CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8mb4;"
64+
- name: Build
65+
run: |
66+
echo "JAVA_OPTS=$JAVA_OPTS"
67+
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
68+
- name: Run tests
69+
run: |
70+
bundle exec rake ${{ matrix.test_targets }}
71+
72+
test-rails-pgsql:
73+
74+
name: Rails Tests (Postgres)
75+
runs-on: ubuntu-latest
76+
strategy:
77+
fail-fast: false
78+
matrix:
79+
ruby-version: [ 'jruby-9.2.20.1' ]
80+
db: [ 'postgresql' ]
81+
test_targets: [ "rails:test_postgresql" ]
82+
ar_version: ["6-1-stable"]
83+
prepared_statements: [ 'false', 'true' ]
84+
85+
services:
86+
postgres:
87+
image: postgres:10
88+
env:
89+
POSTGRES_PASSWORD: postgres
90+
POSTGRES_HOST_AUTH_METHOD: trust
91+
ports:
92+
- 5432:5432
93+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
94+
95+
env:
96+
DB: ${{ matrix.db }}
97+
AR_VERSION: ${{ matrix.ar_version }}
98+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
99+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
100+
PGHOST: localhost
101+
PGPORT: 5432
102+
PGUSER: postgres
103+
104+
steps:
105+
- uses: actions/checkout@v3
106+
- name: Set up Ruby
107+
uses: ruby/setup-ruby@v1
108+
with:
109+
ruby-version: ${{ matrix.ruby-version }}
110+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
111+
- name: Setup database
112+
run: |
113+
psql -c "create database activerecord_unittest;" -U postgres
114+
psql -c "create database activerecord_unittest2;" -U postgres
115+
- name: Build
116+
run: |
117+
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
118+
- name: Run tests
119+
run: |
120+
bundle exec rake ${{ matrix.test_targets }}
121+
122+
test-rails-sqlite:
123+
124+
name: Rails Tests (SQLite)
125+
runs-on: ubuntu-latest
126+
strategy:
127+
fail-fast: false
128+
matrix:
129+
ruby-version: ['jruby-9.2.20.1']
130+
db: ['sqlite3']
131+
test_targets: ["rails:test_sqlite3"]
132+
ar_version: ["6-1-stable"]
133+
134+
env:
135+
DB: ${{ matrix.db }}
136+
AR_VERSION: ${{ matrix.ar_version }}
137+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
138+
139+
steps:
140+
- uses: actions/checkout@v3
141+
- name: Set up Ruby
142+
uses: ruby/setup-ruby@v1
143+
with:
144+
ruby-version: ${{ matrix.ruby-version }}
145+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
146+
- name: Build
147+
run: |
148+
echo "JAVA_OPTS=$JAVA_OPTS"
149+
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
150+
- name: Run tests
151+
run: |
152+
bundle exec rake ${{ matrix.test_targets }}
153+
154+
test-arjdbc-mysql:
155+
156+
name: ARJDBC Tests (MySQL)
157+
runs-on: ubuntu-latest
158+
strategy:
159+
fail-fast: false
160+
matrix:
161+
ruby-version: ['jruby-9.2.20.1']
162+
db: ['mysql2']
163+
test_targets: ["db:mysql test_mysql2"]
164+
prepared_statements: ['false', 'true']
165+
driver: ['MySQL']
166+
167+
services:
168+
mysql:
169+
image: mysql:5.7
170+
ports:
171+
- 3306
172+
173+
env:
174+
DB: ${{ matrix.db }}
175+
DRIVER: ${{ matrix.driver }}
176+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
177+
MY_USER: root
178+
MY_PASSWORD: root
179+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
180+
181+
steps:
182+
- uses: actions/checkout@v3
183+
- name: Set up Ruby
184+
uses: ruby/setup-ruby@v1
185+
with:
186+
ruby-version: ${{ matrix.ruby-version }}
187+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
188+
- name: Setup database
189+
run: |
190+
sudo service mysql start
191+
mysql --version || true # to see if we're using MySQL or MariaDB
192+
- name: Build
193+
run: |
194+
rake jar
195+
- name: Run tests
196+
run: |
197+
bundle exec rake ${{ matrix.test_targets }}
198+
199+
test-arjdbc-pgsql:
200+
201+
name: ARJDBC Tests (Postgres)
202+
runs-on: ubuntu-latest
203+
strategy:
204+
fail-fast: false
205+
matrix:
206+
ruby-version: ['jruby-9.2.20.1']
207+
db: ['postgresql']
208+
test_targets: ["db:postgresql test_postgresql"]
209+
prepared_statements: ['false', 'true']
210+
insert_returning: ['false', 'true']
211+
212+
services:
213+
postgres:
214+
image: postgres:10
215+
env:
216+
POSTGRES_PASSWORD: postgres
217+
POSTGRES_HOST_AUTH_METHOD: trust
218+
ports:
219+
- 5432:5432
220+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
221+
222+
env:
223+
DB: ${{ matrix.db }}
224+
DRIVER: ${{ matrix.driver }}
225+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
226+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
227+
INSERT_RETURNING: ${{ matrix.insert_returning }}
228+
PGHOST: localhost
229+
PGPORT: 5432
230+
PGUSER: postgres
231+
232+
steps:
233+
- uses: actions/checkout@v3
234+
- name: Set up Ruby
235+
uses: ruby/setup-ruby@v1
236+
with:
237+
ruby-version: ${{ matrix.ruby-version }}
238+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
239+
- name: Build
240+
run: |
241+
rake jar
242+
- name: Run tests
243+
run: |
244+
bundle exec rake ${{ matrix.test_targets }}
245+
246+
test-arjdbc-sqlite:
247+
248+
name: ARJDBC Tests (SQLite)
249+
runs-on: ubuntu-latest
250+
strategy:
251+
fail-fast: false
252+
matrix:
253+
ruby-version: ['jruby-9.2.20.1']
254+
db: ['sqlite3']
255+
test_targets: ['test_sqlite3']
256+
257+
env:
258+
DB: ${{ matrix.db }}
259+
JRUBY_OPTS: "-J-Xms64M -J-Xmx1024M"
260+
261+
steps:
262+
- uses: actions/checkout@v3
263+
- name: Set up Ruby
264+
uses: ruby/setup-ruby@v1
265+
with:
266+
ruby-version: ${{ matrix.ruby-version }}
267+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
268+
- name: Build
269+
run: |
270+
rake jar
73271
- name: Run tests
74272
run: |
75-
bundle exec rake ${{ env.TEST_PREFIX }}test_${{ env.DB }}
273+
bundle exec rake ${{ matrix.test_targets }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Jdbc
22
module MariaDB
3-
DRIVER_VERSION = '2.4.2'
3+
DRIVER_VERSION = '3.0.4'
44
VERSION = DRIVER_VERSION
55
end
66
end
-574 KB
Binary file not shown.
558 KB
Binary file not shown.

test/db/mysql_config.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
MYSQL_CONFIG[:properties] ||= {}
2626
MYSQL_CONFIG[:properties]['cacheDefaultTimezone'] = false
2727
MYSQL_CONFIG[:properties]['serverTimezone'] = java.util.TimeZone.getDefault.getID
28+
MYSQL_CONFIG[:properties]['allowPublicKeyRetrieval'] = true
2829
end
2930

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude :test_doesnt_error_when_a_select_query_has_encoding_errors, "encoding error"
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
exclude :test_dealloc_does_not_raise_on_inactive_connection, "TODO: likely do not need the ability to manually instantiate a StatementPool"
2+
exclude :test_prepared_statements_do_not_get_stuck_on_query_interruption, "needs investigation"

test/rails/excludes/postgresql/ActiveRecord/ConnectionAdapters/PostgreSQLAdapterTest.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
if ActiveRecord::Base.connection.prepared_statements
2-
exclude :test_exec_with_binds, 'it uses $1 for parameter mapping which is not currently supported'
3-
exclude :test_exec_typecasts_bind_vals, 'it uses $1 for parameter mapping which is not currently supported'
42
end
53

4+
# moved from above because they appear to be running even when prepared statements are not enabled
5+
exclude :test_exec_with_binds, 'it uses $1 for parameter mapping which is not currently supported'
6+
exclude :test_exec_typecasts_bind_vals, 'it uses $1 for parameter mapping which is not currently supported'
7+
68
exclude :test_only_warn_on_first_encounter_of_unrecognized_oid, 'expects warning with OID, ARJBC has name instead'
79
exclude :test_default_sequence_name_bad_table, "ARJDBC does more quoting (which is not wrong)"
810
exclude :test_reconnection_error, 'different internals'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude :test_deadlock_raises_Deadlocked_inside_nested_SavepointTransaction, "needs investigation"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
exclude :test_raises_SerializationFailure_when_a_serialization_failure_occurs, "sometimes hangs. needs investigation, #1037"
2+
exclude :test_raises_Deadlocked_when_a_deadlock_is_encountered, "needs investigation"

0 commit comments

Comments
 (0)