Module: RRRSpec
- Defined in:
- lib/rrrspec.rb,
lib/rrrspec/client/cli.rb,
lib/rrrspec/redis_models.rb,
lib/rrrspec/configuration.rb,
lib/rrrspec/client/support.rb,
lib/rrrspec/client/version.rb,
lib/rrrspec/client/rspec_runner.rb,
lib/rrrspec/client/slave_runner.rb,
lib/rrrspec/client/configuration.rb
Defined Under Namespace
Modules: ActiveTaskset, ArbiterQueue, Client, DispatcherQueue, PersisterQueue, StatisticsUpdaterQueue, TasksetEstimation
Classes: Configuration, Slave, Task, Taskset, TimedLogger, Trial, Worker, WorkerLog
Constant Summary
collapse
- DEFAULT_CONFIG_FILES =
[
home_rrrspec,
'.rrrspec',
'.rrrspec-local'
].compact
Class Method Summary
collapse
Class Method Details
.configuration ⇒ Object
18
19
20
|
# File 'lib/rrrspec.rb', line 18
def configuration
@configuration
end
|
.configuration=(configuration) ⇒ Object
22
23
24
|
# File 'lib/rrrspec.rb', line 22
def configuration=(configuration)
@configuration = configuration
end
|
26
27
28
29
30
|
# File 'lib/rrrspec.rb', line 26
def configure(type=nil)
if type == nil || type == configuration.type
yield configuration
end
end
|
.convert_if_present(h, key) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/rrrspec/redis_models.rb', line 5
def self.convert_if_present(h, key)
if h[key].present?
h[key] = yield h[key]
else
h[key] = nil
end
end
|
.flushredis ⇒ Object
48
49
50
51
52
53
|
# File 'lib/rrrspec.rb', line 48
def flushredis
Thread.list.each do |thread|
thread[:redis] = nil
thread[:pid] = nil
end
end
|
.hostname ⇒ Object
59
60
61
|
# File 'lib/rrrspec.rb', line 59
def hostname
@hostname ||= Socket.gethostname
end
|
.hostname=(hostname) ⇒ Object
63
64
65
|
# File 'lib/rrrspec.rb', line 63
def hostname=(hostname)
@hostname = hostname
end
|
.logger ⇒ Object
91
92
93
|
# File 'lib/rrrspec.rb', line 91
def logger
@logger ||= Logger.new(STDERR)
end
|
.logger=(logger) ⇒ Object
95
96
97
|
# File 'lib/rrrspec.rb', line 95
def logger=(logger)
@logger = logger
end
|
.make_key(*args) ⇒ Object
55
56
57
|
# File 'lib/rrrspec.rb', line 55
def make_key(*args)
args.join(':')
end
|
.pacemaker(obj, time, margin) ⇒ Object
67
68
69
70
71
72
|
# File 'lib/rrrspec.rb', line 67
def pacemaker(obj, time, margin)
loop do
obj.heartbeat(time)
sleep time - margin
end
end
|
.redis ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/rrrspec.rb', line 32
def redis
if not Thread.current[:pid] or Thread.current[:pid] != Process.pid
Thread.current[:redis] = nil
Thread.current[:pid] = Process.pid
end
Thread.current[:redis] ||= begin
configuration.redis.dup
end
end
|
.setup(configuration, config_files) ⇒ Object