specwrk 0.21.4 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 794dba7b09d0dcf664f9188a6c79274cd7dcaa7eb513cf002c6f610cc110313a
4
- data.tar.gz: cc8e64d775de00bb49eb90f18de7a87f55a62b7b043fb95545b8151e6e0484b6
3
+ metadata.gz: 1a13b3c3e70f9d783a12f5234fb6d4b1d8c1b1d88f51d9697f577af787992af7
4
+ data.tar.gz: def9c56c399edf73caf06a8f6c35a66cca2edc78469011b9c590be024a0dbdfa
5
5
  SHA512:
6
- metadata.gz: c98f4269ee9bdea9a2798d1b98474c430569f656eefe8b30f573f0a221e7e39258bad53904ce2c9994ab0064fdf27c3e0b0b022cfd114297fc0b1325a2b6ba66
7
- data.tar.gz: feef8c77b996f164ee491630efe426e3735b6f72616df6ac881af4c21e6ecc796aa0990c405e4060990d1b6e479dffc2f0c8079a2641d4e1ff94ccc2c5ef2bcd
6
+ metadata.gz: 60533ae109485af8cc632937362e5e03407790ba6bcd985b403811c8183d0e77cbfdcf730f68f1871e3562b02bffb519be733d2f64965b64634b531864adf69a
7
+ data.tar.gz: 2dd7c656477fe49b58e4ff7ef8b0c74c71ff527e8f0894043861fc8db5b6a4d7ccc0354b69e69c0463e1c5c5e03a7f1392105284fb7297794a251cf97abe0105
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  # Changelog
2
2
 
3
3
  ## Unreleased
4
- [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.21.4...main)
4
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.22.1...main)
5
+
6
+ ## v0.22.1 — 2026-11-12
7
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.22.0...v0.22.1)
8
+ - Distinguish seeded runs from runs awaiting their first seed and correct worker status while waiting for work — [#205](https://github.com/danielwestendorf/specwrk/pull/205) by [@danielwestendorf](https://github.com/danielwestendorf)
9
+
10
+ ## v0.22.0 — 2026-11-02
11
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.21.4...v0.22.0)
12
+ - Add an `after_start_complete` lifecycle hook — [#201](https://github.com/danielwestendorf/specwrk/pull/201) by [@danielwestendorf](https://github.com/danielwestendorf)
5
13
 
6
14
  ## v0.21.4 — 2026-10-12
7
15
  [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.21.3...v0.21.4)
data/LICENSE CHANGED
@@ -1,5 +1,6 @@
1
1
  Copyright (c) Daniel Westendorf
2
2
 
3
3
  Specwrk is an Open Source project licensed under the terms of
4
- the LGPLv3 license. Please see <http://www.gnu.org/licenses/lgpl-3.0.html>
4
+ the GNU General Public License, version 3 or (at your option) any later
5
+ version (GPL-3.0-or-later). Please see <https://www.gnu.org/licenses/gpl-3.0.html>
5
6
  for license text.
data/README.md CHANGED
@@ -189,6 +189,7 @@ The hooks file is ordinary Ruby and is loaded into the parent, server, seed, and
189
189
  | `Specwrk.after_worker_examples_execute(&blk)` | Runs in a worker after an examples group is executed by the RSpec runner | `examples` RSpec examples in the group |
190
190
  | `Specwrk.before_worker_exit(&blk)` | Runs in each worker after work completes and before the process exits | `status` Worker exit status |
191
191
  | `Specwrk.after_all_workers_exit(&blk)` | Runs in the parent process after all workers exit | `status` Overall worker exit status |
192
+ | `Specwrk.after_start_complete(&blk)` | Runs in the parent process after `specwrk start` finishes reporting and its server and child processes have exited | `status` Final command exit status |
192
193
 
193
194
  Response compression is negotiated automatically by HTTP clients and the queue server. Request compression is disabled by default; enable it with `--http-compression` or `SPECWRK_HTTP_COMPRESSION=1` on client commands to gzip seed data and worker results that are at least 1 KiB. Set `SPECWRK_HTTP_COMPRESSION_MINIMUM_SIZE` to change this byte threshold. Upgrade the queue server before enabling request compression because it does not fall back when a server cannot decode gzip.
194
195
 
@@ -325,4 +326,4 @@ Maintainers can follow [RELEASING.md](RELEASING.md) to publish the gem and Docke
325
326
 
326
327
  ## License
327
328
 
328
- The gem is available as open source under the terms of the [LGPLv3 License](http://www.gnu.org/licenses/lgpl-3.0.html).
329
+ The gem is available as open source under the terms of the [GNU General Public License, version 3 or (at your option) any later version](https://www.gnu.org/licenses/gpl-3.0.html) (`GPL-3.0-or-later`).
data/Specwrk.hooks.rb CHANGED
@@ -66,3 +66,7 @@
66
66
  # Specwrk.after_all_workers_exit do |status|
67
67
  # specwrk_hook_log.call("after_all_workers_exit", status: status)
68
68
  # end
69
+ #
70
+ # Specwrk.after_start_complete do |status|
71
+ # specwrk_hook_log.call("after_start_complete", status: status)
72
+ # end
data/lib/specwrk/cli.rb CHANGED
@@ -353,6 +353,7 @@ module Specwrk
353
353
  status = Specwrk::CLIReporter.new.report
354
354
 
355
355
  Specwrk.wait_for_pids_exit([web_pid, seed_pid])
356
+ Hooks.run(:after_start_complete, status)
356
357
  exit(status)
357
358
  end
358
359
 
@@ -107,6 +107,11 @@ module Specwrk
107
107
  bucket_ids.length
108
108
  end
109
109
 
110
+ def empty?
111
+ # The backing store retains configuration even when no work remains.
112
+ bucket_ids.empty?
113
+ end
114
+
110
115
  private
111
116
 
112
117
  def write_bucket(examples)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Specwrk
4
- VERSION = "0.21.4"
4
+ VERSION = "0.22.1"
5
5
  end
@@ -132,11 +132,15 @@ module Specwrk
132
132
  end
133
133
 
134
134
  def worker_status
135
- return 0 if worker[:failed].nil? && completed.any? # worker starts after run has completed
135
+ return 0 if worker[:failed].nil? && seeded?
136
136
 
137
137
  worker[:failed] || 1
138
138
  end
139
139
 
140
+ def seeded?
141
+ !pending[PendingStore::MAX_RETRIES_KEY].nil?
142
+ end
143
+
140
144
  def worker_store_for(id)
141
145
  WorkerStore.new(ENV.fetch("SPECWRK_SRV_STORE_URI", "memory:///"), File.join(run_id, "workers", id))
142
146
  end
@@ -11,7 +11,7 @@ module Specwrk
11
11
  def with_pop_response
12
12
  if examples.any?
13
13
  [200, {"content-type" => "application/json"}, [JSON.generate(examples)]]
14
- elsif pending.empty? && processing.empty? && completed.empty?
14
+ elsif !seeded?
15
15
  [204, {}, []]
16
16
  elsif completed.any? && processing.empty?
17
17
  [410, {"content-type" => "text/plain"}, ["That's a good lad. Run along now and go home."]]
@@ -15,8 +15,6 @@ module Specwrk
15
15
  failure_counts.clear
16
16
  completed.clear
17
17
 
18
- pending.max_retries = payload.fetch(:max_retries, "0").to_i
19
-
20
18
  metadata.delete("report_json")
21
19
 
22
20
  pending.update_run_time_bucket_maximum(
@@ -26,6 +24,8 @@ module Specwrk
26
24
 
27
25
  with_lock do
28
26
  pending.merge!(examples_with_run_times)
27
+ # Publish the seed marker only after all pending work has been stored.
28
+ pending.max_retries = payload.fetch(:max_retries, "0").to_i
29
29
  end
30
30
 
31
31
  Hooks.run(:after_server_seed, payload[:examples])
data/lib/specwrk.rb CHANGED
@@ -60,6 +60,10 @@ module Specwrk
60
60
  Hooks.register(:after_all_workers_exit, &block)
61
61
  end
62
62
 
63
+ def after_start_complete(&block)
64
+ Hooks.register(:after_start_complete, &block)
65
+ end
66
+
63
67
  def wait_for_pids_exit(pids)
64
68
  exited_pids = {}
65
69
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specwrk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.4
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Westendorf
@@ -277,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
279
  requirements: []
280
- rubygems_version: 4.0.10
280
+ rubygems_version: 4.0.20
281
281
  specification_version: 4
282
282
  summary: Parallel rspec test runner from a queue of pending jobs.
283
283
  test_files: []