rrrspec-server 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rrrspec/server/configuration.rb +0 -1
- data/lib/rrrspec/server/persister.rb +0 -14
- data/lib/rrrspec/server/version.rb +1 -1
- data/spec/rrrspec/server/arbiter_spec.rb +1 -1
- data/spec/rrrspec/server/dispatcher_spec.rb +1 -1
- data/spec/rrrspec/server/log_file_persister_spec.rb +1 -1
- data/spec/rrrspec/server/persistent_models_spec.rb +1 -1
- data/spec/rrrspec/server/persister_spec.rb +1 -22
- data/spec/rrrspec/server/statistics_updater_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -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: 293738ec28988929e79f45e60ab391dd3178294e
|
4
|
+
data.tar.gz: f7796aa0b4796d4d3a697418fe4dab93512536df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d0cb0c3908a49837375f329d52318c780e1e6c29a6d1754da4d020f202d282018acf6f29dbf054482b7aa6cfa3fcc6d210d87e460772834b152f688a8c151fd
|
7
|
+
data.tar.gz: ecdab2e55073e94d2fc16305e7e11cef7a4043c7b0b584c02bcdb4762cd71b1a934b5070d3195c78b0003568785dc677f41c559431207f63b0d5bcba0bdbf69f
|
@@ -5,7 +5,6 @@ module RRRSpec
|
|
5
5
|
class ServerConfiguration < Configuration
|
6
6
|
attr_accessor :persistence_db
|
7
7
|
attr_accessor :execute_log_text_path
|
8
|
-
attr_accessor :json_cache_path
|
9
8
|
attr_accessor :daemonize, :pidfile, :user
|
10
9
|
attr_accessor :stdout_path, :stderr_path
|
11
10
|
attr_accessor :monitor
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'zlib'
|
2
1
|
require 'activerecord-import'
|
3
2
|
require 'active_support/inflector'
|
4
3
|
ActiveSupport::Inflector::Inflections.instance.singular('Slaves', 'Slave')
|
@@ -28,9 +27,6 @@ module RRRSpec
|
|
28
27
|
|
29
28
|
ActiveRecord::Base.connection_pool.with_connection do
|
30
29
|
persist(taskset)
|
31
|
-
if RRRSpec.configuration.json_cache_path
|
32
|
-
create_api_cache(taskset, RRRSpec.configuration.json_cache_path)
|
33
|
-
end
|
34
30
|
taskset.expire(PERSISTED_RESIDUE_SEC)
|
35
31
|
end
|
36
32
|
|
@@ -122,16 +118,6 @@ module RRRSpec
|
|
122
118
|
|
123
119
|
RRRSpec.logger.info("Taskset #{taskset.key} persisted (#{Time.now - start} seconds taken)")
|
124
120
|
end
|
125
|
-
|
126
|
-
def create_api_cache(taskset, path)
|
127
|
-
p_obj = Persistence::Taskset.where(key: taskset.key).full.first
|
128
|
-
json = JSON.generate(p_obj.as_full_json.update('is_full' => true))
|
129
|
-
|
130
|
-
FileUtils.mkdir_p(File.join(path, 'v1', 'tasksets'))
|
131
|
-
json_path = File.join(path, 'v1', 'tasksets', taskset.key.gsub(':', '-'))
|
132
|
-
IO.write(json_path, json)
|
133
|
-
Zlib::GzipWriter.open(json_path + ".gz") { |gz| gz.write(json) }
|
134
|
-
end
|
135
121
|
end
|
136
122
|
end
|
137
123
|
end
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module RRRSpec
|
4
4
|
module Server
|
5
|
-
describe Persister do
|
5
|
+
RSpec.describe Persister do
|
6
6
|
before do
|
7
7
|
RRRSpec.configuration = ServerConfiguration.new
|
8
8
|
RRRSpec.configuration.redis = @redis
|
@@ -120,27 +120,6 @@ module RRRSpec
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
end
|
123
|
-
|
124
|
-
describe '.create_api_cache' do
|
125
|
-
before { Persister.persist(@taskset) }
|
126
|
-
|
127
|
-
it 'writes cached json file' do
|
128
|
-
Dir.mktmpdir do |dir|
|
129
|
-
Persister.create_api_cache(@taskset, dir)
|
130
|
-
json_path = File.join(dir, 'v1', 'tasksets', @taskset.key.gsub(':', '-'))
|
131
|
-
expect(File).to exist(json_path)
|
132
|
-
expect(File).to exist(json_path + ".gz")
|
133
|
-
|
134
|
-
p_taskset = Persistence::Taskset.first
|
135
|
-
expect(IO.read(json_path)).to eq(
|
136
|
-
JSON.generate(p_taskset.as_full_json.update('is_full' => true))
|
137
|
-
)
|
138
|
-
expect(Zlib::GzipReader.open(json_path + ".gz").read).to eq(
|
139
|
-
IO.read(json_path)
|
140
|
-
)
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
123
|
end
|
145
124
|
end
|
146
125
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -11,7 +11,8 @@ require 'timecop'
|
|
11
11
|
require 'fixture'
|
12
12
|
|
13
13
|
RSpec.configure do |config|
|
14
|
-
config.
|
14
|
+
config.raise_errors_for_deprecations!
|
15
|
+
config.disable_monkey_patching!
|
15
16
|
config.run_all_when_everything_filtered = true
|
16
17
|
config.filter_run :focus
|
17
18
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rrrspec-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaya Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: database_cleaner
|