specwrk 0.15.8 → 0.15.9
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 +4 -4
- data/README.md +1 -1
- data/lib/specwrk/cli.rb +2 -2
- data/lib/specwrk/version.rb +1 -1
- data/lib/specwrk/web/endpoints/base.rb +9 -1
- data/lib/specwrk/web/endpoints/complete_and_pop.rb +11 -2
- data/lib/specwrk/web/endpoints/report.rb +6 -0
- data/lib/specwrk/web/endpoints/shutdown.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8afbccd28740ac63fbdbd2f71a6f60442664a2d19e6743c337266fd14cffe081
|
4
|
+
data.tar.gz: 5b2b645f3b93abcb320f9fb4e93ebac94df591bb4336dac8af946d5f771575a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb05bb7995ebd500c6935e0325f00d58ad7cd0d78f3f1fe133615258f53a8a3ec8832f43e4c383bfb6d09577c1d9e5e9830bc9043e5c3cc7a3d5e4a376986c52
|
7
|
+
data.tar.gz: 4bfbc09dde0c764df5ad01869b1ba86bb9acde760ab49ab46fcd509f9eba8db849237e272e46a3baf5e7c458c054a00450d3c9b1f657ecbeb84e81f2da9781c7
|
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 `
|
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)
|
data/lib/specwrk/cli.rb
CHANGED
@@ -131,7 +131,7 @@ 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, default: "spec", desc: "Relative spec directory to run against"
|
135
135
|
|
136
136
|
def call(max_retries:, dir:, **args)
|
137
137
|
self.class.setup(**args)
|
@@ -208,7 +208,7 @@ module Specwrk
|
|
208
208
|
|
209
209
|
desc "Start a server and workers, monitor until complete"
|
210
210
|
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"
|
211
|
+
argument :dir, required: false, type: :array, default: "spec", desc: "Relative spec directory to run against"
|
212
212
|
|
213
213
|
def call(max_retries:, dir:, **args)
|
214
214
|
self.class.setup(**args)
|
data/lib/specwrk/version.rb
CHANGED
@@ -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
|
-
|
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
|
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
|
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)]
|