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
19
20
21
|
# File 'lib/rrrspec.rb', line 19
def configuration
@configuration
end
|
.configuration=(configuration) ⇒ Object
23
24
25
|
# File 'lib/rrrspec.rb', line 23
def configuration=(configuration)
@configuration = configuration
end
|
27
28
29
30
31
|
# File 'lib/rrrspec.rb', line 27
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
49
50
51
52
53
54
|
# File 'lib/rrrspec.rb', line 49
def flushredis
Thread.list.each do |thread|
thread[:redis] = nil
thread[:pid] = nil
end
end
|
.hostname ⇒ Object
60
61
62
|
# File 'lib/rrrspec.rb', line 60
def hostname
@hostname ||= Socket.gethostname
end
|
.hostname=(hostname) ⇒ Object
64
65
66
|
# File 'lib/rrrspec.rb', line 64
def hostname=(hostname)
@hostname = hostname
end
|
.logger ⇒ Object
92
93
94
|
# File 'lib/rrrspec.rb', line 92
def logger
@logger ||= Logger.new(STDERR)
end
|
.logger=(logger) ⇒ Object
96
97
98
|
# File 'lib/rrrspec.rb', line 96
def logger=(logger)
@logger = logger
end
|
.make_key(*args) ⇒ Object
56
57
58
|
# File 'lib/rrrspec.rb', line 56
def make_key(*args)
args.join(':')
end
|
.pacemaker(obj, time, margin) ⇒ Object
68
69
70
71
72
73
|
# File 'lib/rrrspec.rb', line 68
def pacemaker(obj, time, margin)
loop do
obj.heartbeat(time)
sleep time - margin
end
end
|
.redis ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'lib/rrrspec.rb', line 33
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