rrrspec-server 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 46e20dd6de78e0272d191c430dd801437cd65b46
4
- data.tar.gz: 388516fe54d9f65f9fcd36226d1ff7bdd1789d71
3
+ metadata.gz: 293738ec28988929e79f45e60ab391dd3178294e
4
+ data.tar.gz: f7796aa0b4796d4d3a697418fe4dab93512536df
5
5
  SHA512:
6
- metadata.gz: ba0313a74a11735854d9c67fc9c83b3d86b4c07df68513e28edb5630b50cf2bb444c80f19ef410406522b0bd2f388d4d49de734a813b1bb97237d4ca0156ae42
7
- data.tar.gz: ad6db2485f7343bfa78ac92645dea25c058518ac6b79b7de66e6c156f415c0bac2f6ecea4a5264f71c67ff4f44bb6bde77768335cb717899322ebde90fb11387
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
@@ -1,5 +1,5 @@
1
1
  module RRRSpec
2
2
  module Server
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  module RRRSpec
4
4
  module Server
5
- describe Arbiter do
5
+ RSpec.describe Arbiter do
6
6
  before do
7
7
  RRRSpec.configuration = Configuration.new
8
8
  RRRSpec.configuration.redis = @redis
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  module RRRSpec
4
4
  module Server
5
- describe Dispatcher do
5
+ RSpec.describe Dispatcher do
6
6
  before do
7
7
  RRRSpec.configuration = Configuration.new
8
8
  RRRSpec.configuration.redis = @redis
@@ -10,7 +10,7 @@ module RRRSpec
10
10
  attr_accessor :key
11
11
  end
12
12
 
13
- describe LogFilePersister do
13
+ RSpec.describe LogFilePersister do
14
14
  before do
15
15
  RRRSpec.configuration = ServerConfiguration.new
16
16
  RRRSpec.configuration.execute_log_text_path = '/tmp/log_path'
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  module RRRSpec
4
4
  module Server
5
5
  module Persistence
6
- describe Taskset do
6
+ RSpec.describe Taskset do
7
7
  before do
8
8
  RRRSpec.configuration = ServerConfiguration.new
9
9
  RRRSpec.configuration.redis = @redis
@@ -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
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  module RRRSpec
4
4
  module Server
5
- describe StatisticsUpdater do
5
+ RSpec.describe StatisticsUpdater do
6
6
  before do
7
7
  RRRSpec.configuration = ServerConfiguration.new
8
8
  RRRSpec.configuration.redis = @redis
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.treat_symbols_as_metadata_keys_with_true_values = true
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.3.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-05-28 00:00:00.000000000 Z
11
+ date: 2015-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: database_cleaner