Module: CI::Queue
- Extended by:
- Queue
- Included in:
- Queue
- Defined in:
- lib/ci/queue.rb,
lib/ci/queue/file.rb,
lib/ci/queue/grind.rb,
lib/ci/queue/redis.rb,
lib/ci/queue/bisect.rb,
lib/ci/queue/common.rb,
lib/ci/queue/static.rb,
lib/ci/queue/version.rb,
lib/ci/queue/redis/base.rb,
lib/ci/queue/file_loader.rb,
lib/ci/queue/queue_entry.rb,
lib/ci/queue/redis/grind.rb,
lib/ci/queue/redis/retry.rb,
lib/ci/queue/build_record.rb,
lib/ci/queue/redis/worker.rb,
lib/ci/queue/configuration.rb,
lib/ci/queue/redis/monitor.rb,
lib/ci/queue/class_resolver.rb,
lib/ci/queue/output_helpers.rb,
lib/ci/queue/circuit_breaker.rb,
lib/ci/queue/redis/supervisor.rb,
lib/ci/queue/redis/build_record.rb,
lib/ci/queue/redis/grind_record.rb,
lib/ci/queue/redis/grind_supervisor.rb,
lib/ci/queue/redis/test_time_record.rb
Defined Under Namespace
Modules: CircuitBreaker, ClassResolver, Common, OutputHelpers, QueueEntry, Redis, Warnings
Classes: Bisect, BuildRecord, Configuration, File, FileLoadError, FileLoader, Grind, Static
Constant Summary
collapse
- Error =
Class.new(StandardError)
- ClassNotFoundError =
Class.new(Error)
- VERSION =
'0.84.0'
- DEV_SCRIPTS_ROOT =
::File.expand_path('../../../../../redis', __FILE__)
- RELEASE_SCRIPTS_ROOT =
::File.expand_path('../redis', __FILE__)
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#requeueable ⇒ Object
Returns the value of attribute requeueable.
25
26
27
|
# File 'lib/ci/queue.rb', line 25
def requeueable
@requeueable
end
|
#shuffler ⇒ Object
Returns the value of attribute shuffler.
25
26
27
|
# File 'lib/ci/queue.rb', line 25
def shuffler
@shuffler
end
|
Instance Method Details
#debug? ⇒ Boolean
66
67
68
69
70
71
|
# File 'lib/ci/queue.rb', line 66
def debug?
return @debug if defined?(@debug)
value = ENV['CI_QUEUE_DEBUG']
@debug = !!(value && !value.strip.empty? && !%w[0 false].include?(value.strip.downcase))
end
|
#from_uri(url, config) ⇒ Object
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'lib/ci/queue.rb', line 77
def from_uri(url, config)
uri = URI(url)
implementation = case uri.scheme
when 'list'
Static
when 'file', nil
File
when 'redis', 'rediss'
require 'ci/queue/redis'
Redis
else
raise ArgumentError, "Don't know how to handle #{uri.scheme} URLs"
end
implementation.from_uri(uri, config)
end
|
#requeueable?(test_result) ⇒ Boolean
54
55
56
|
# File 'lib/ci/queue.rb', line 54
def requeueable?(test_result)
requeueable.nil? || requeueable.call(test_result)
end
|
#reset_debug! ⇒ Object
73
74
75
|
# File 'lib/ci/queue.rb', line 73
def reset_debug!
remove_instance_variable(:@debug) if defined?(@debug)
end
|
#shuffle(tests, random) ⇒ Object
58
59
60
61
62
63
64
|
# File 'lib/ci/queue.rb', line 58
def shuffle(tests, random)
if shuffler
shuffler.call(tests, random)
else
tests.sort.shuffle(random: random)
end
end
|
#time_now ⇒ Object
47
48
49
50
51
52
|
# File 'lib/ci/queue.rb', line 47
def time_now
GET_NOW.call
end
|