specwrk 0.21.0 → 0.21.2

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: ec2663b93b4ed3469ecfaebea825d97a2bd2b6764ccae67bc316efd6de2f53a6
4
- data.tar.gz: 23e5e30cb0e6d9644085b0597e36f3c7380baea67ee01aaad70af9341b347fd8
3
+ metadata.gz: 52b6a68ed1cf336c660524fcd9c5e668450b0ce5a28046ccfb7dc7140bf64070
4
+ data.tar.gz: 532ab297997be008455c5bd02cade0ff03ef86fb2b4e8a988bd3981feb08f7b2
5
5
  SHA512:
6
- metadata.gz: 99066768c088081d7c3c69a52ce51898a4ea7cd533581fc70829f70edc25b423b583d9883dda079070a17c5ef5f135ca330afeb62a6027897650cfc1f2b82318
7
- data.tar.gz: c3a606f594a5dc018556149b79846ec3ccee01b89ef016396c327e250aeba6d84cfcb7c1bdfd7b7a9c121f835f5c7818356be5c5cdbef826cc794506dd4bc55b
6
+ metadata.gz: 903e0cb393b6a7a2001336aa5792df9485b5b0975206aae3906500acafbdd88bed5d8f0ad824dc565e2b5c4a4dd48d3a3db47c19ad4b9fea3e3d2828fa987e10
7
+ data.tar.gz: 38056a0a56c20a5a8de5b6cacc6e161ba153c6b4466d6145c599a8ad1d1b693ee5d81e330d6f77878ecc43d9422a905afa447d5157e287f8df4e4271f069759d
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.0...main)
4
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.21.2...main)
5
+
6
+ ## v0.21.2 — 2026-10-10
7
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.21.1...v0.21.2)
8
+ - Cache generated reports — [#197](https://github.com/danielwestendorf/specwrk/pull/197) by [@danielwestendorf](https://github.com/danielwestendorf)
9
+
10
+ ## v0.21.1 — 2026-09-29
11
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.21.0...v0.21.1)
12
+ - Treat any non-zero worker exit as a failure — [#196](https://github.com/danielwestendorf/specwrk/pull/196) by [@scottjacobsen](https://github.com/scottjacobsen)
5
13
 
6
14
  ## v0.21.0 — 2026-09-13
7
15
  [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.20.2...v0.21.0)
data/lib/specwrk/cli.rb CHANGED
@@ -247,7 +247,7 @@ module Specwrk
247
247
  end
248
248
 
249
249
  def status
250
- @exited_pids.value?(1) ? 1 : 0
250
+ @exited_pids.values.any?(&:nonzero?) ? 1 : 0
251
251
  end
252
252
  end
253
253
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Specwrk
4
- VERSION = "0.21.0"
4
+ VERSION = "0.21.2"
5
5
  end
@@ -7,11 +7,33 @@ module Specwrk
7
7
  module Endpoints
8
8
  class Report < Base
9
9
  def with_response
10
+ cached_report = metadata[:report_json]
11
+ return report_response(cached_report) if cached_report
12
+
13
+ with_lock do
14
+ cached_report = metadata[:report_json]
15
+ if cached_report
16
+ report_response(cached_report)
17
+ else
18
+ report_json = JSON.generate(report_data)
19
+ metadata[:report_json] = report_json
20
+ report_response(report_json)
21
+ end
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def report_data
10
28
  completed_dump = completed.dump
11
29
  completed_dump[:meta][:unexecuted] = pending.length + processing.length
12
30
  completed_dump[:flakes] = failure_counts.to_h.reject { |id, _count| completed_dump.dig(:examples, id, :status) == "failed" }
13
31
 
14
- [200, {"content-type" => "application/json"}, [JSON.generate(completed_dump)]]
32
+ completed_dump
33
+ end
34
+
35
+ def report_response(report_json)
36
+ [200, {"content-type" => "application/json"}, [report_json]]
15
37
  end
16
38
  end
17
39
  end
@@ -17,6 +17,8 @@ module Specwrk
17
17
 
18
18
  pending.max_retries = payload.fetch(:max_retries, "0").to_i
19
19
 
20
+ metadata.delete("report_json")
21
+
20
22
  pending.update_run_time_bucket_maximum(
21
23
  @seeds_run_time_bucket_maximum,
22
24
  target_bucket_timing_duration: payload.fetch(:target_bucket_timing_duration, 0)
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.0
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Westendorf