isolated_server 0.4.11 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/README.md +1 -1
- data/lib/isolated_server/mysql.rb +11 -7
- data/lib/isolated_server/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 538bc9071f52a2150ee836010e26f98612d8bebc
|
4
|
+
data.tar.gz: 1c56e1eba6bcf788ca171e4fc0f66da88983e1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fa0dc3d05a11afb2809d437fc0e83a7c3a6178be73630f8dc49132d43abbf06f9ba0a6435436df63bed777ec5ba1c7810b7b6c39ca74ee90ef73539ea5c817a
|
7
|
+
data.tar.gz: ef15a65def6aad701688235a378d88c4324de332e623d5f4002e577110788850171b334a12bf812eb07cfcacbf2c51a66a69b772762111f5e477522e74726e68
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/
|
1
|
+
[![Build Status](https://travis-ci.org/zendesk/isolated_server.svg?branch=master)](https://travis-ci.org/zendesk/isolated_server)
|
2
2
|
|
3
3
|
# Mysql Isolated Servers -- a gem for testing mysql stuff
|
4
4
|
|
@@ -5,6 +5,8 @@ else
|
|
5
5
|
end
|
6
6
|
|
7
7
|
require 'tmpdir'
|
8
|
+
require 'open3'
|
9
|
+
require 'fileutils'
|
8
10
|
|
9
11
|
module IsolatedServer
|
10
12
|
class Mysql < Base
|
@@ -123,12 +125,13 @@ module IsolatedServer
|
|
123
125
|
private
|
124
126
|
|
125
127
|
def system!(cmd)
|
126
|
-
|
128
|
+
stdout, stderr, status = Open3.capture3(cmd)
|
129
|
+
raise Exception, "Error executing #{cmd} status=#{status} stdout=#{stdout} stderr=#{stderr}" if status != 0
|
127
130
|
end
|
128
131
|
|
129
132
|
def setup_data_dir
|
130
133
|
system!("rm -Rf #{@mysql_data_dir.shellescape}")
|
131
|
-
|
134
|
+
FileUtils.mkdir_p(@mysql_data_dir)
|
132
135
|
if @load_data_path
|
133
136
|
system!("cp -a #{@load_data_path.shellescape}/* #{@mysql_data_dir.shellescape}")
|
134
137
|
system!("rm -f #{@mysql_data_dir.shellescape}/relay-log.info")
|
@@ -143,7 +146,7 @@ module IsolatedServer
|
|
143
146
|
mysql_install_db = locate_executable("mysql_install_db")
|
144
147
|
|
145
148
|
idb_path = File.dirname(mysql_install_db)
|
146
|
-
system!("
|
149
|
+
system!("#{mysql_install_db} --datadir=#{@mysql_data_dir.shellescape} --basedir=#{basedir.shellescape} --user=`whoami`")
|
147
150
|
system!("cp #{File.expand_path(File.dirname(__FILE__)).shellescape}/mysql/tables/#{major_version}/user.* #{@mysql_data_dir.shellescape}/mysql")
|
148
151
|
end
|
149
152
|
end
|
@@ -158,16 +161,17 @@ module IsolatedServer
|
|
158
161
|
binlog_dir = @log_bin
|
159
162
|
end
|
160
163
|
|
161
|
-
|
164
|
+
FileUtils.mkdir_p(binlog_dir)
|
162
165
|
@log_bin = "--log-bin=#{binlog_dir}"
|
163
166
|
end
|
164
167
|
end
|
165
168
|
|
166
169
|
# http://dev.mysql.com/doc/refman/5.0/en/temporary-files.html
|
167
170
|
def setup_tmp_dir
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
+
tmp_dir = File.join(base, "tmp")
|
172
|
+
FileUtils.mkdir_p(tmp_dir)
|
173
|
+
system!("chmod 0777 #{tmp_dir.shellescape}")
|
174
|
+
ENV["TMPDIR"] = "#{tmp_dir.shellescape}"
|
171
175
|
end
|
172
176
|
|
173
177
|
# http://dev.mysql.com/doc/refman/5.5/en/mysql-tzinfo-to-sql.html
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isolated_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Osheroff
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|