rrrspec-client 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 187ea5b96b3437a7c839c23b3e5f1aa3df3b5716
4
- data.tar.gz: d83a9df93ffa5ae672b5909e887a52173f6941ff
3
+ metadata.gz: 7e29d68ed0c54b2cb4c4417d62f515f09f657bcc
4
+ data.tar.gz: 34a655fdacca55bb7f43725a82da62d8da9b4308
5
5
  SHA512:
6
- metadata.gz: c6583325da9e6865baca29415e524f662ecfcdf1a7d2be524b3769748855a20f6629cfe9dae6102bf035534fd4a314a4271e5ace84e421780e56ed5121d435af
7
- data.tar.gz: b1f67aba5e30a24d1ee5dad72ae4dc15587d5b25470546c29ebc290be512c3b63743ae43a1b3e630619abb1b9d1308563ad2d0347d8ed7c9cc004431e611a93e
6
+ metadata.gz: 7647cb60a2238e446825b32fcd388e0240418a751dfd9ef8ce65ccc34a59630f12b890e289777fbbe3c108fb78faa7b0bb42a0c2d20faba3621703728841e7f7
7
+ data.tar.gz: 0b8c083325761f23abc9d3d4778d2a75bc772aee29d6379477d638b9df649642ff247416ec7bfa9d62092336ff8f09489b0a16bdc4bc07f00b275c657911cfe2
@@ -67,8 +67,6 @@ module RRRSpec
67
67
  desc 'nodes', 'list up the active nodes'
68
68
  def nodes
69
69
  setup(Configuration.new)
70
- puts "Server:"
71
- puts "\t#{RSyncInfo.exist? ? "Yes" : "No"}"
72
70
  puts "Workers:"
73
71
  Worker.list.each { |worker| puts "\t#{worker.key}" }
74
72
  end
@@ -2,7 +2,7 @@ module RRRSpec
2
2
  module Client
3
3
  class ClientConfiguration < Configuration
4
4
  attr_accessor :packaging_dir
5
- attr_accessor :packaging_rsync_options
5
+ attr_accessor :rsync_remote_path, :rsync_options
6
6
  attr_writer :spec_files
7
7
  attr_accessor :setup_command, :slave_command
8
8
  attr_accessor :taskset_class, :worker_type
@@ -45,15 +45,15 @@ module RRRSpec
45
45
  @timeout = TASKQUEUE_ARBITER_TIMEOUT
46
46
  ArbiterQueue.check(@taskset)
47
47
  else
48
- @timeout = TASKQUEUE_TASK_TIMEOUT
49
48
  if @worked_task_keys.include?(task.key)
50
49
  @taskset.reversed_enqueue_task(task)
51
50
  return
52
51
  else
53
52
  @worked_task_keys << task.key
54
53
  end
55
-
56
54
  return if task.status.present?
55
+
56
+ @timeout = TASKQUEUE_TASK_TIMEOUT
57
57
  trial = Trial.create(task, @slave)
58
58
 
59
59
  @rspec_runner.reset
@@ -112,9 +112,8 @@ module RRRSpec
112
112
 
113
113
  def run_rsync_package(rsync_name)
114
114
  conf = RRRSpec.configuration
115
- remote_dir = File.join(RSyncInfo.rsync_dir, rsync_name)
116
- remote_path = "#{RSyncInfo.rsync_server}:#{remote_dir}"
117
- command = "rsync #{conf.packaging_rsync_options} #{conf.packaging_dir}/ #{remote_path}"
115
+ remote_path = File.join(conf.rsync_remote_path, rsync_name)
116
+ command = "rsync #{conf.rsync_options} #{conf.packaging_dir}/ #{remote_path}"
118
117
  $stderr.puts command
119
118
  system(command)
120
119
  $?.success?
@@ -1,5 +1,5 @@
1
1
  module RRRSpec
2
2
  module Client
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -0,0 +1,6 @@
1
+ class ActiveSupport::TimeWithZone
2
+ def as_json(*arg)
3
+ iso8601
4
+ end
5
+ end
6
+
@@ -10,62 +10,6 @@ module RRRSpec
10
10
  end
11
11
  end
12
12
 
13
- module RSyncInfo
14
- WAIT_SERVER_SEC = 10
15
- RSYNC_INFO_KEY = 'rrrspec:rsync_info'
16
-
17
- module_function
18
-
19
- def self.hget_loop(key)
20
- loop do
21
- v = RRRSpec.redis.hget(RSYNC_INFO_KEY, key)
22
- return v if v.present?
23
- sleep WAIT_SERVER_SEC
24
- end
25
- end
26
-
27
- # Public
28
- def self.rsync_server
29
- hget_loop('rsync_server')
30
- end
31
-
32
- # Public
33
- def self.rsync_dir
34
- hget_loop('rsync_dir')
35
- end
36
-
37
- # Public
38
- def self.rsync_options
39
- hget_loop('rsync_options')
40
- end
41
-
42
- # ==========================================================================
43
- # Heartbeat
44
-
45
- # Public: Check its existence.
46
- #
47
- # Returns bool
48
- def self.exist?
49
- RRRSpec.redis.exists('rrrspec:rsync_info')
50
- end
51
-
52
- # Public: Maintain heartbeat
53
- def self.heartbeat(time)
54
- unless Dir.exist?(RRRSpec.configuration.rsync_dir)
55
- FileUtils.makedirs(RRRSpec.configuration.rsync_dir)
56
- end
57
- RRRSpec.redis.multi do
58
- RRRSpec.redis.hmset(
59
- 'rrrspec:rsync_info',
60
- 'rsync_server', RRRSpec.configuration.rsync_server,
61
- 'rsync_dir', RRRSpec.configuration.rsync_dir,
62
- 'rsync_options', RRRSpec.configuration.rsync_options
63
- )
64
- RRRSpec.redis.expire('rrrspec:rsync_info', time)
65
- end
66
- end
67
- end
68
-
69
13
  module ArbiterQueue
70
14
  ARBITER_QUEUE_KEY = 'rrrspec:arbiter_queue'
71
15
 
data/lib/rrrspec.rb CHANGED
@@ -6,6 +6,7 @@ require 'logger'
6
6
  Time.zone_default = Time.find_zone('UTC')
7
7
 
8
8
  require 'rrrspec/configuration'
9
+ require 'rrrspec/extension'
9
10
  require 'rrrspec/redis_models'
10
11
 
11
12
  module RRRSpec
@@ -67,11 +68,13 @@ module RRRSpec
67
68
  end
68
69
  end
69
70
 
71
+ # When there's no suitable home directory, File.expand_path raises ArgumentError
72
+ home_rrrspec = File.expand_path('~/.rrrspec') rescue nil
70
73
  DEFAULT_CONFIG_FILES = [
71
- File.expand_path('~/.rrrspec'),
74
+ home_rrrspec,
72
75
  '.rrrspec',
73
76
  '.rrrspec-local'
74
- ]
77
+ ].compact
75
78
 
76
79
  def setup(configuration, config_files)
77
80
  RRRSpec.configuration = configuration
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency "rake"
28
28
  spec.add_dependency "activesupport"
29
29
  spec.add_dependency "extreme_timeout"
30
- spec.add_dependency "facter"
31
30
  spec.add_dependency "launchy"
32
31
  spec.add_dependency "redis"
33
32
  spec.add_dependency "rspec", ">= 2.14.1"
metadata CHANGED
@@ -1,167 +1,153 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rrrspec-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaya Suzuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-18 00:00:00.000000000 Z
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.4'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activesupport
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: extreme_timeout
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: facter
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '>='
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: launchy
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
- - - '>='
73
+ - - ">="
88
74
  - !ruby/object:Gem::Version
89
75
  version: '0'
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - '>='
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
82
  version: '0'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: redis
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - '>='
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
89
  version: '0'
104
90
  type: :runtime
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - '>='
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: rspec
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: 2.14.1
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - '>='
108
+ - - ">="
123
109
  - !ruby/object:Gem::Version
124
110
  version: 2.14.1
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: thor
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
- - - '>='
115
+ - - ">="
130
116
  - !ruby/object:Gem::Version
131
117
  version: '0'
132
118
  type: :runtime
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
- - - '>='
122
+ - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: uuidtools
141
127
  requirement: !ruby/object:Gem::Requirement
142
128
  requirements:
143
- - - '>='
129
+ - - ">="
144
130
  - !ruby/object:Gem::Version
145
131
  version: '0'
146
132
  type: :runtime
147
133
  prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
- - - '>='
136
+ - - ">="
151
137
  - !ruby/object:Gem::Version
152
138
  version: '0'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: tzinfo
155
141
  requirement: !ruby/object:Gem::Requirement
156
142
  requirements:
157
- - - '>='
143
+ - - ">="
158
144
  - !ruby/object:Gem::Version
159
145
  version: '0'
160
146
  type: :runtime
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
- - - '>='
150
+ - - ">="
165
151
  - !ruby/object:Gem::Version
166
152
  version: '0'
167
153
  description: Execute RSpec in a distributed manner
@@ -173,8 +159,7 @@ executables:
173
159
  extensions: []
174
160
  extra_rdoc_files: []
175
161
  files:
176
- - .rspec
177
- - .ruby-version
162
+ - ".rspec"
178
163
  - Gemfile
179
164
  - Rakefile
180
165
  - bin/rrrspec
@@ -188,6 +173,7 @@ files:
188
173
  - lib/rrrspec/client/support.rb
189
174
  - lib/rrrspec/client/version.rb
190
175
  - lib/rrrspec/configuration.rb
176
+ - lib/rrrspec/extension.rb
191
177
  - lib/rrrspec/redis_models.rb
192
178
  - rrrspec-client.gemspec
193
179
  - spec/fixture.rb
@@ -204,17 +190,17 @@ require_paths:
204
190
  - lib
205
191
  required_ruby_version: !ruby/object:Gem::Requirement
206
192
  requirements:
207
- - - '>='
193
+ - - ">="
208
194
  - !ruby/object:Gem::Version
209
195
  version: '0'
210
196
  required_rubygems_version: !ruby/object:Gem::Requirement
211
197
  requirements:
212
- - - '>='
198
+ - - ">="
213
199
  - !ruby/object:Gem::Version
214
200
  version: '0'
215
201
  requirements: []
216
202
  rubyforge_project:
217
- rubygems_version: 2.0.3
203
+ rubygems_version: 2.2.2
218
204
  signing_key:
219
205
  specification_version: 4
220
206
  summary: Execute RSpec in a distributed manner
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.0.0-p247