specwrk 0.15.8 → 0.15.10

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: 0a359bd88ba0482dad8bf78555ce9256e8dfa4f000d48f2e36579df34172a684
4
- data.tar.gz: a41d177279abb2622d8778a14344ede5f8eac4cac83bbd99185e6302f956f6e7
3
+ metadata.gz: 1201e277f5b36c6ac9ff9ac20cf2b591f54d42822b071cf61b57a463164c5c4e
4
+ data.tar.gz: 0c53e4c86f48062680801f3d0de4ac5f691e55b3afaae98398750b9d8bca865d
5
5
  SHA512:
6
- metadata.gz: 7faa3a2e27b1338fde5aa02b8ae29482b8203857bfb07a54d5c8ff751e73b051b1bc7c69e05bf1b58a8aa609e9de15b767d78a4002936b83d60f3c2f90f928b7
7
- data.tar.gz: d6c167e28a11bcc0798074d4214430430cbdb6e34c8b1f1c5c9bed2c086251736c73aefcc984d5ae10ce47e4204d1d13a4b3119a68ed6e26f262ec657839ab4f
6
+ metadata.gz: 77142f3689fc39ec758869a42611d40b0f2013ebcba1a3c76a3ed4e2d7b6758f80ac0d9e2a93f58fcf58de9d3ada76ed34380d3a81dfc1bc2d1a49cab98fc67c
7
+ data.tar.gz: bf4c4f3d3784feaed50f41d84e52dac09d232e6fc9d14e79c00961f79286c25775e4a922c4512a0f17ffd45b4bc863ae61b8fe6a70ab9c233c033303e4c7245f
data/CHANGELOG.md CHANGED
@@ -1,22 +1,57 @@
1
- ## [Unreleased]
2
-
3
1
  # Changelog
4
2
 
5
- ## v0.15.2 — 2025-08-15
6
- [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.1...v0.15.2)
7
- - Fix bug where ruby objects were being written to ndjson files isntead of json — [#119](https://github.com/danielwestendorf/specwrk/pull/119) by @danielwestendorf
8
-
9
- ## v0.15.12025-08-14
10
- [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.0...v0.15.1)
11
- - Add `watch` command to split spec files across processes as they change — [#117](https://github.com/danielwestendorf/specwrk/pull/117) by @danielwestendorf
12
- - Readme formatting tweaks @danielwestendorf
13
-
14
- ## v0.15.02025-08-08
15
- [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.14.1...v0.15.0)
16
- - When output path is specified, write an `.ndjson` file per worker of all examples executed — [#113](https://github.com/danielwestendorf/specwrk/pull/113) (fixes [#10](https://github.com/danielwestendorf/specwrk/issues/10)) by @danielwestendorf
17
- - Print re-run commands for failures — [#114](https://github.com/danielwestendorf/specwrk/pull/114) (fixes [#7](https://github.com/danielwestendorf/specwrk/issues/7)) by @danielwestendorf
18
- - Show count of examples that did not execute; make runs resumable by only clearing stores on seed — [#115](https://github.com/danielwestendorf/specwrk/pull/115) by @danielwestendorf
19
- - Report flake counts and provide flake re-run commands — [#116](https://github.com/danielwestendorf/specwrk/pull/116) (fixes [#112](https://github.com/danielwestendorf/specwrk/issues/112)) by @danielwestendorf
3
+ ## v0.15.9 — 2025-08-28
4
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.8...v0.15.9)
5
+ - Support lock skipping for read-only endpoints — [#139](https://github.com/danielwestendorf/specwrk/pull/139) by [@danielwestendorf](https://github.com/danielwestendorf)
6
+ - Fix typo in README — [#137](https://github.com/danielwestendorf/specwrk/pull/137) by [@willnet](https://github.com/willnet)
7
+ - Support an array of arguments when seeding/starting [#141](https://github.com/danielwestendorf/specwrk/pull/141) by [@danielwestendorf](https://github.com/danielwestendorf)
8
+ - Load examples from processing before global lock — [#142](https://github.com/danielwestendorf/specwrk/pull/142) by [@danielwestendorf](https://github.com/danielwestendorf)
9
+
10
+ ## v0.15.82025-08-27
11
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.7...v0.15.8)
12
+ - Friendly helper message when Redis adapter is not available [@danielwestendorf](https://github.com/danielwestendorf)
13
+
14
+ ## v0.15.7 2025-08-26
15
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.6...v0.15.7)
16
+ - Change request locking from global to per-`run_id` — [#135](https://github.com/danielwestendorf/specwrk/pull/135) by [@danielwestendorf](https://github.com/danielwestendorf)
17
+ - `rspec-core` is a runtime dependency (not `rspec`) — [#128](https://github.com/danielwestendorf/specwrk/pull/128) by [@bquorning](https://github.com/bquorning)
18
+ - README typo fix — [#126](https://github.com/danielwestendorf/specwrk/pull/126) by [@brett-anderson](https://github.com/brett-anderson)
19
+
20
+ ## v0.15.6 — 2025-08-26
21
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.5...v0.15.6)
22
+ - Test `Store.adapter_klass` — [@danielwestendorf](https://github.com/danielwestendorf)
23
+
24
+ ## v0.15.5 — 2025-08-26
25
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.4...v0.15.5)
26
+ - Add support for Redis store adapters — [#133](https://github.com/danielwestendorf/specwrk/pull/133) by [@danielwestendorf](https://github.com/danielwestendorf)
27
+ - Remove support for Ruby 3.1.0 — [@danielwestendorf](https://github.com/danielwestendorf)
28
+ - Remove `gem-release` from dev dependencies — [@danielwestendorf](https://github.com/danielwestendorf)
29
+
30
+ ## v0.15.4 — 2025-08-23
31
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.3...v0.15.4)
32
+ - Split web endpoints into separate files for easier comprehension — [#129](https://github.com/danielwestendorf/specwrk/pull/129) by [@danielwestendorf](https://github.com/danielwestendorf)
33
+ - Write the title sequence as watch loops run — [#131](https://github.com/danielwestendorf/specwrk/pull/131) by [@danielwestendorf](https://github.com/danielwestendorf) (fixes [#130](https://github.com/danielwestendorf/specwrk/issues/130))
34
+
35
+ ## v0.15.3 — 2025-08-22
36
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.2...v0.15.3)
37
+ - Clear filter-manager inclusions/exclusions when listing examples — [#122](https://github.com/danielwestendorf/specwrk/pull/122) by [@danielwestendorf](https://github.com/danielwestendorf) (fixes [#121](https://github.com/danielwestendorf/specwrk/issues/121))
38
+ - Smarter completion-threshold calculation; make runs resumable — [#124](https://github.com/danielwestendorf/specwrk/pull/124) by [@danielwestendorf](https://github.com/danielwestendorf) (fixes [#121](https://github.com/danielwestendorf/specwrk/issues/121))
39
+
40
+ ## v0.15.2 — 2025-08-15
41
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.1...v0.15.2)
42
+ - Fix bug where Ruby objects were being written to NDJSON files instead of JSON — [#119](https://github.com/danielwestendorf/specwrk/pull/119) by [@danielwestendorf](https://github.com/danielwestendorf)
43
+
44
+ ## v0.15.1 — 2025-08-14
45
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.15.0...v0.15.1)
46
+ - Add `watch` command to split spec files across processes as they change — [#117](https://github.com/danielwestendorf/specwrk/pull/117) by [@danielwestendorf](https://github.com/danielwestendorf)
47
+ - README formatting tweaks — [@danielwestendorf](https://github.com/danielwestendorf)
48
+
49
+ ## v0.15.0 — 2025-08-08
50
+ [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.14.1...v0.15.0)
51
+ - Per-worker NDJSON output when `--output` is specified — [#113](https://github.com/danielwestendorf/specwrk/pull/113) by [@danielwestendorf](https://github.com/danielwestendorf) (fixes [#10](https://github.com/danielwestendorf/specwrk/issues/10))
52
+ - Print re-run commands for failures — [#114](https://github.com/danielwestendorf/specwrk/pull/114) by [@danielwestendorf](https://github.com/danielwestendorf) (fixes [#7](https://github.com/danielwestendorf/specwrk/issues/7))
53
+ - Show number of examples that did not execute; make runs resumable — [#115](https://github.com/danielwestendorf/specwrk/pull/115) by [@danielwestendorf](https://github.com/danielwestendorf)
54
+ - Report flake counts and re-run commands — [#116](https://github.com/danielwestendorf/specwrk/pull/116) by [@danielwestendorf](https://github.com/danielwestendorf) (fixes [#112](https://github.com/danielwestendorf/specwrk/issues/112))
20
55
 
21
56
  ## v0.14.1 — 2025-08-07
22
57
  [Compare](https://github.com/danielwestendorf/specwrk/compare/v0.14.0...v0.14.1)
data/README.md CHANGED
@@ -205,7 +205,7 @@ Multi-node, multi-process works best when have many nodes running tests. This di
205
205
  To accomplish this, a central queue server is required, examples must be explicitly seeded, and workers explicitly started.
206
206
 
207
207
  1. Start a centralized queue server (see [Running a persistent Queue Server](#running-a-persistent-queue-server))
208
- 2. Seed the server with the specs for the current `SPECWWRK_RUN` pointed at your central server
208
+ 2. Seed the server with the specs for the current `SPECWRK_RUN` pointed at your central server
209
209
  3. Execute `specwrk work` for the given process count, for the current `SPECWRK_RUN`, pointed at your central server
210
210
 
211
211
  [GitHub Actions Example](https://github.com/danielwestendorf/specwrk/blob/main/.github/workflows/specwrk-multi-node.yml)
@@ -223,6 +223,8 @@ Start a persistent Queue Server given one of the following methods
223
223
  - Secure your server with a key either with the `SPECWRK_SRV_KEY` environment variable or `--key` CLI option
224
224
  - Configure the server output to be a persisted volume so your timings survive between system restarts with the `SPECWRK_SRV_STORE_URI` environment variable or `--store-uri` CLI option. By default, `memory:///` will be used for the run's data stores (so run data will no survive server restarts) while `file://#{Dir.tmpdir}` will be used for run timings. Pass `--store-uri file:///whatever/absolute/path` to store all data on disk (required for multiple server processes).
225
225
 
226
+ See [specwrk-store-redis_adapter](https://github.com/danielwestendorf/specwrk-store-redis_adapter) for Redis-compatible backed storage.
227
+
226
228
  See [specwrk serve --help](#specwrk-serve) for all possible configuration options.
227
229
 
228
230
  ### Create a watchfile for the `watch` command
@@ -273,11 +275,16 @@ specwrk is different because it:
273
275
  5. Is free.
274
276
 
275
277
  [parallel_rspec](https://github.com/willbryant/parallel_rspec)
278
+
276
279
  [Knapsack](https://github.com/KnapsackPro/knapsack)
280
+
277
281
  [parallel_tests](https://github.com/grosser/parallel_tests)
282
+
278
283
  [rspecq](https://github.com/skroutz/rspecq)
284
+
279
285
  [RSpec ABQ](https://github.com/rwx-research/rspec-abq)
280
286
 
287
+
281
288
  ## Contributing
282
289
 
283
290
  Bug reports and pull requests are welcome on GitHub at https://github.com/dwestendorf/specwrk.
data/lib/specwrk/cli.rb CHANGED
@@ -131,9 +131,11 @@ module Specwrk
131
131
 
132
132
  desc "Seed the server with a list of specs for the run"
133
133
  option :max_retries, default: 0, desc: "Number of times an example will be re-run should it fail"
134
- argument :dir, required: false, default: "spec", desc: "Relative spec directory to run against"
134
+ argument :dir, type: :array, required: false, desc: "Relative spec directory to run against, default: spec/"
135
135
 
136
136
  def call(max_retries:, dir:, **args)
137
+ dir = ["spec"] if dir.length.zero?
138
+
137
139
  self.class.setup(**args)
138
140
 
139
141
  require "specwrk/list_examples"
@@ -208,9 +210,11 @@ module Specwrk
208
210
 
209
211
  desc "Start a server and workers, monitor until complete"
210
212
  option :max_retries, default: 0, desc: "Number of times an example will be re-run should it fail"
211
- argument :dir, required: false, default: "spec", desc: "Relative spec directory to run against"
213
+ argument :dir, type: :array, required: false, desc: "Relative spec directory to run against, default: spec/"
212
214
 
213
215
  def call(max_retries:, dir:, **args)
216
+ dir = ["spec"] if dir.length.zero?
217
+
214
218
  self.class.setup(**args)
215
219
  $stdout.sync = true
216
220
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Specwrk
4
- VERSION = "0.15.8"
4
+ VERSION = "0.15.10"
5
5
  end
@@ -46,6 +46,10 @@ module Specwrk
46
46
 
47
47
  attr_reader :request
48
48
 
49
+ def skip_lock
50
+ false
51
+ end
52
+
49
53
  def before_lock
50
54
  end
51
55
 
@@ -119,7 +123,11 @@ module Specwrk
119
123
  end
120
124
 
121
125
  def with_lock
122
- Store.with_lock(URI(ENV.fetch("SPECWRK_SRV_STORE_URI", "memory:///")), run_id) { yield }
126
+ if skip_lock
127
+ yield
128
+ else
129
+ Store.with_lock(URI(ENV.fetch("SPECWRK_SRV_STORE_URI", "memory:///")), run_id) { yield }
130
+ end
123
131
  end
124
132
  end
125
133
 
@@ -19,8 +19,17 @@ module Specwrk
19
19
 
20
20
  private
21
21
 
22
+ def before_lock
23
+ processing_examples
24
+ completed_examples
25
+ end
26
+
22
27
  def all_examples
23
- @all_examples ||= payload.map { |example| [example[:id], example] if processing[example[:id]] }.compact.to_h
28
+ @all_examples ||= payload.map { |example| [example[:id], example] if processing_examples[example[:id]] }.compact.to_h
29
+ end
30
+
31
+ def processing_examples
32
+ @processing_examples ||= processing.multi_read(*payload.map { |example| example[:id] })
24
33
  end
25
34
 
26
35
  def completed_examples
@@ -67,7 +76,7 @@ module Specwrk
67
76
  # So if we overwrite run times from another process it is nbd
68
77
  run_times.merge! run_time_data
69
78
 
70
- # workers are single proces, single-threaded, so safe to do this work without the lock
79
+ # workers are single process, single-threaded, so safe to do this work without the lock
71
80
  existing_status_counts = worker.multi_read(*EXAMPLE_STATUSES)
72
81
  new_status_counts = EXAMPLE_STATUSES.map do |status|
73
82
  [status, existing_status_counts.fetch(status, 0) + completed_examples_status_counts.fetch(status, 0)]
@@ -13,6 +13,12 @@ module Specwrk
13
13
 
14
14
  [200, {"content-type" => "application/json"}, [JSON.generate(completed_dump)]]
15
15
  end
16
+
17
+ private
18
+
19
+ def skip_lock
20
+ true
21
+ end
16
22
  end
17
23
  end
18
24
  end
@@ -12,6 +12,12 @@ module Specwrk
12
12
  [200, {"content-type" => "text/plain"}, ["✌️"]]
13
13
  end
14
14
 
15
+ private
16
+
17
+ def skip_lock
18
+ true
19
+ end
20
+
15
21
  def interupt!
16
22
  Thread.new do
17
23
  # give the socket a moment to flush the response
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.15.8
4
+ version: 0.15.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Westendorf