rspecq 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -1
- data/README.md +3 -1
- data/bin/rspecq +22 -2
- data/lib/rspecq/queue.rb +2 -2
- data/lib/rspecq/reporter.rb +2 -2
- data/lib/rspecq/version.rb +1 -1
- data/lib/rspecq/worker.rb +2 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89dbfa98d1eaceb06c39d41ab85e7fa6923d0c87e9a15b9cbfaf7399ff2aaff3
|
4
|
+
data.tar.gz: b7cd028440e6eb03401dc623c7ee0fc0fe74f6ffa12a25ecc23d0cf54e6acd1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a43f0630e8a02a001132f45c9f68cacf7edae8e90487112e640eb611e7d1345f68ad0ab163ae01c91cb38ebc879e98cda9b54044c0ee676293c7aa3bf7c17942
|
7
|
+
data.tar.gz: bf98027dc02ac56d02cc258700f5efa766c40d4d69c55c529d311083965d1fe4f76423b05fddb35a37496bb6eb3c11a8460a8e76f94897c4bb38a744b2fb40df
|
data/CHANGELOG.md
CHANGED
@@ -4,12 +4,24 @@ Breaking changes are prefixed with a "[BREAKING]" label.
|
|
4
4
|
|
5
5
|
## master (unreleased)
|
6
6
|
|
7
|
+
## 0.3.0 (2020-10-05)
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Providing a Redis URL is now possible using the `--redis-url` option
|
12
|
+
[[#40](https://github.com/skroutz/rspecq/pull/40)]
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
|
16
|
+
- [DEPRECATION] The `--redis` option is now deprecated. Use `--redis-host`
|
17
|
+
instead [[#40](https://github.com/skroutz/rspecq/pull/40)]
|
18
|
+
|
7
19
|
## 0.2.2 (2020-09-10)
|
8
20
|
|
9
21
|
### Fixed
|
10
22
|
- Worker would fail if application code was writing to stderr
|
11
23
|
[[#35](https://github.com/skroutz/rspecq/pull/35)]
|
12
|
-
|
24
|
+
|
13
25
|
## 0.2.1 (2020-09-09)
|
14
26
|
|
15
27
|
### Changed
|
data/README.md
CHANGED
@@ -64,7 +64,9 @@ USAGE:
|
|
64
64
|
OPTIONS:
|
65
65
|
-b, --build ID A unique identifier for the build. Should be common among workers participating in the same build.
|
66
66
|
-w, --worker ID An identifier for the worker. Workers participating in the same build should have distinct IDs.
|
67
|
-
-r, --redis HOST Redis host to connect to (default: 127.0.0.1).
|
67
|
+
-r, --redis HOST --redis is deprecated. Use --redis-host or --redis-url instead. Redis host to connect to (default: 127.0.0.1).
|
68
|
+
--redis-host HOST Redis host to connect to (default: 127.0.0.1).
|
69
|
+
--redis-url URL Redis URL to connect to (e.g.: redis://127.0.0.1:6379/0).
|
68
70
|
--update-timings Update the global job timings key with the timings of this build. Note: This key is used as the basis for job scheduling.
|
69
71
|
--file-split-threshold N Split spec files slower than N seconds and schedule them as individual examples.
|
70
72
|
--report Enable reporter mode: do not pull tests off the queue; instead print build progress and exit when it's finished.
|
data/bin/rspecq
CHANGED
@@ -38,9 +38,20 @@ OptionParser.new do |o|
|
|
38
38
|
|
39
39
|
o.on("-r", "--redis HOST", "Redis host to connect to " \
|
40
40
|
"(default: #{DEFAULT_REDIS_HOST}).") do |v|
|
41
|
+
puts "--redis is deprecated. Use --redis-host or --redis-url instead"
|
41
42
|
opts[:redis_host] = v
|
42
43
|
end
|
43
44
|
|
45
|
+
o.on("--redis-host HOST", "Redis host to connect to " \
|
46
|
+
"(default: #{DEFAULT_REDIS_HOST}).") do |v|
|
47
|
+
opts[:redis_host] = v
|
48
|
+
end
|
49
|
+
|
50
|
+
o.on("--redis-url URL", "The URL of the Redis host to connect to " \
|
51
|
+
"(e.g.: redis://127.0.0.1:6379/0).") do |v|
|
52
|
+
opts[:redis_url] = v
|
53
|
+
end
|
54
|
+
|
44
55
|
o.on("--update-timings", "Update the global job timings key with the " \
|
45
56
|
"timings of this build. Note: This key is used as the basis for job " \
|
46
57
|
"scheduling.") do |v|
|
@@ -91,15 +102,24 @@ opts[:file_split_threshold] ||= Integer(ENV["RSPECQ_FILE_SPLIT_THRESHOLD"] || 99
|
|
91
102
|
opts[:report] ||= env_set?("RSPECQ_REPORT")
|
92
103
|
opts[:report_timeout] ||= Integer(ENV["RSPECQ_REPORT_TIMEOUT"] || DEFAULT_REPORT_TIMEOUT)
|
93
104
|
opts[:max_requeues] ||= Integer(ENV["RSPECQ_MAX_REQUEUES"] || DEFAULT_MAX_REQUEUES)
|
105
|
+
opts[:redis_url] ||= ENV["RSPECQ_REDIS_URL"]
|
94
106
|
|
95
107
|
raise OptionParser::MissingArgument.new(:build) if opts[:build].nil?
|
96
108
|
raise OptionParser::MissingArgument.new(:worker) if !opts[:report] && opts[:worker].nil?
|
97
109
|
|
110
|
+
redis_opts = {}
|
111
|
+
|
112
|
+
if opts[:redis_url]
|
113
|
+
redis_opts[:url] = opts[:redis_url]
|
114
|
+
else
|
115
|
+
redis_opts[:host] = opts[:redis_host]
|
116
|
+
end
|
117
|
+
|
98
118
|
if opts[:report]
|
99
119
|
reporter = RSpecQ::Reporter.new(
|
100
120
|
build_id: opts[:build],
|
101
121
|
timeout: opts[:report_timeout],
|
102
|
-
|
122
|
+
redis_opts: redis_opts,
|
103
123
|
)
|
104
124
|
|
105
125
|
reporter.report
|
@@ -107,7 +127,7 @@ else
|
|
107
127
|
worker = RSpecQ::Worker.new(
|
108
128
|
build_id: opts[:build],
|
109
129
|
worker_id: opts[:worker],
|
110
|
-
|
130
|
+
redis_opts: redis_opts
|
111
131
|
)
|
112
132
|
|
113
133
|
worker.files_or_dirs_to_run = ARGV[0] if ARGV[0]
|
data/lib/rspecq/queue.rb
CHANGED
@@ -70,10 +70,10 @@ module RSpecQ
|
|
70
70
|
|
71
71
|
attr_reader :redis
|
72
72
|
|
73
|
-
def initialize(build_id, worker_id,
|
73
|
+
def initialize(build_id, worker_id, redis_opts)
|
74
74
|
@build_id = build_id
|
75
75
|
@worker_id = worker_id
|
76
|
-
@redis = Redis.new(
|
76
|
+
@redis = Redis.new(redis_opts.merge(id: worker_id))
|
77
77
|
end
|
78
78
|
|
79
79
|
# NOTE: jobs will be processed from head to tail (lpop)
|
data/lib/rspecq/reporter.rb
CHANGED
@@ -9,10 +9,10 @@ module RSpecQ
|
|
9
9
|
#
|
10
10
|
# Reporters are readers of the queue.
|
11
11
|
class Reporter
|
12
|
-
def initialize(build_id:, timeout:,
|
12
|
+
def initialize(build_id:, timeout:, redis_opts:)
|
13
13
|
@build_id = build_id
|
14
14
|
@timeout = timeout
|
15
|
-
@queue = Queue.new(build_id, "reporter",
|
15
|
+
@queue = Queue.new(build_id, "reporter", redis_opts)
|
16
16
|
|
17
17
|
# We want feedback to be immediattely printed to CI users, so
|
18
18
|
# we disable buffering.
|
data/lib/rspecq/version.rb
CHANGED
data/lib/rspecq/worker.rb
CHANGED
@@ -42,10 +42,10 @@ module RSpecQ
|
|
42
42
|
|
43
43
|
attr_reader :queue
|
44
44
|
|
45
|
-
def initialize(build_id:, worker_id:,
|
45
|
+
def initialize(build_id:, worker_id:, redis_opts:)
|
46
46
|
@build_id = build_id
|
47
47
|
@worker_id = worker_id
|
48
|
-
@queue = Queue.new(build_id, worker_id,
|
48
|
+
@queue = Queue.new(build_id, worker_id, redis_opts)
|
49
49
|
@files_or_dirs_to_run = "spec"
|
50
50
|
@populate_timings = false
|
51
51
|
@file_split_threshold = 999999
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspecq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Agis Anastasopoulos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-core
|
@@ -149,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
|
153
|
-
rubygems_version: 2.7.6.2
|
152
|
+
rubygems_version: 3.1.4
|
154
153
|
signing_key:
|
155
154
|
specification_version: 4
|
156
155
|
summary: Optimally distribute and run RSpec suites among parallel workers; for faster
|