File tree 7 files changed +75
-10
lines changed
7 files changed +75
-10
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Metrics/AbcSize:
22
22
# Offense count: 31
23
23
# Configuration parameters: CountComments, ExcludedMethods.
24
24
Metrics/BlockLength :
25
- Max : 850
25
+ Max : 860
26
26
27
27
# Offense count: 1
28
28
# Configuration parameters: CountBlocks.
Original file line number Diff line number Diff line change 1
1
sudo : required
2
2
dist : trusty
3
+ services : docker
3
4
language : ruby
4
5
bundler_args : --without benchmarks development
5
6
# Pin Rubygems to a working version. Sometimes it breaks upstream. Update now and then.
@@ -73,6 +74,11 @@ matrix:
73
74
addons :
74
75
hosts :
75
76
- mysql2gem.example.com
77
+ - rvm : 2.4
78
+ env : DOCKER=centos
79
+ before_install : true
80
+ install : docker build -t mysql2 -f .travis_Dockerfile_centos .
81
+ script : docker run --add-host=mysql2gem.example.com:127.0.0.1 -t mysql2
76
82
fast_finish : true
77
83
allow_failures :
78
84
- rvm : ruby-head
Original file line number Diff line number Diff line change
1
+ FROM centos:7
2
+
3
+ WORKDIR /build
4
+ COPY . .
5
+
6
+ RUN yum -y update
7
+ RUN yum -y install epel-release
8
+ # The options are to install faster.
9
+ RUN yum -y install \
10
+ --setopt=deltarpm=0 \
11
+ --setopt=install_weak_deps=false \
12
+ --setopt=tsflags=nodocs \
13
+ mariadb-server \
14
+ mariadb-devel \
15
+ ruby-devel \
16
+ git \
17
+ gcc \
18
+ gcc-c++ \
19
+ make
20
+ RUN gem update --system > /dev/null
21
+ RUN gem install bundler
22
+
23
+ CMD sh .travis_centos.sh
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -eux
4
+
5
+ # Start mysqld service.
6
+ sh .travis_setup_centos.sh
7
+
8
+ bundle install --path vendor/bundle --without benchmarks development
9
+
10
+ # USER environment value is not set as a default in the container environment.
11
+ export USER=root
12
+
13
+ bundle exec rake
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -eux
4
+
5
+ MYSQL_TEST_LOG=" $( pwd) /mysql.log"
6
+
7
+ mysql_install_db \
8
+ --log-error=" ${MYSQL_TEST_LOG} "
9
+ /usr/libexec/mysqld \
10
+ --user=root \
11
+ --log-error=" ${MYSQL_TEST_LOG} " \
12
+ --ssl &
13
+ sleep 3
14
+ cat ${MYSQL_TEST_LOG}
15
+
16
+ mysql -u root -e ' CREATE DATABASE IF NOT EXISTS test'
Original file line number Diff line number Diff line change @@ -135,15 +135,22 @@ def connect(*args)
135
135
136
136
# You may need to adjust the lines below to match your SSL certificate paths
137
137
ssl_client = nil
138
+ option_overrides = {
139
+ 'host' => 'mysql2gem.example.com' , # must match the certificates
140
+ :sslkey => '/etc/mysql/client-key.pem' ,
141
+ :sslcert => '/etc/mysql/client-cert.pem' ,
142
+ :sslca => '/etc/mysql/ca-cert.pem' ,
143
+ :sslcipher => 'DHE-RSA-AES256-SHA' ,
144
+ :sslverify => true ,
145
+ }
146
+ %i[ sslkey sslcert sslca ] . each do |item |
147
+ unless File . exist? ( option_overrides [ item ] )
148
+ pending ( "DON'T WORRY, THIS TEST PASSES - but #{ option_overrides [ item ] } does not exist." )
149
+ break
150
+ end
151
+ end
138
152
expect do
139
- ssl_client = new_client (
140
- 'host' => 'mysql2gem.example.com' , # must match the certificates
141
- :sslkey => '/etc/mysql/client-key.pem' ,
142
- :sslcert => '/etc/mysql/client-cert.pem' ,
143
- :sslca => '/etc/mysql/ca-cert.pem' ,
144
- :sslcipher => 'DHE-RSA-AES256-SHA' ,
145
- :sslverify => true ,
146
- )
153
+ ssl_client = new_client ( option_overrides )
147
154
end . not_to raise_error
148
155
149
156
results = Hash [ ssl_client . query ( 'SHOW STATUS WHERE Variable_name LIKE "Ssl_%"' ) . map { |x | x . values_at ( 'Variable_name' , 'Value' ) } ]
Original file line number Diff line number Diff line change 164
164
expect do
165
165
res . each_with_index do |_ , i |
166
166
# Exhaust the first result packet then trigger a timeout
167
- sleep 2 if i > 0 && i % 1000 == 0
167
+ sleep 4 if i > 0 && i % 1000 == 0
168
168
end
169
169
end . to raise_error ( Mysql2 ::Error , /Lost connection/ )
170
170
end
You can’t perform that action at this time.
0 commit comments