bitfab 0.23.0 → 0.23.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 +4 -4
- data/lib/bitfab/replay.rb +16 -5
- data/lib/bitfab/version.rb +1 -1
- data/lib/bitfab.rb +3 -4
- 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: 3827f24f9f67b8264b588233b5e1eb3ffe6581dca039951a391253a87cf7c10b
|
|
4
|
+
data.tar.gz: 744d87d7188cb454c03242b95ff0ba7e1a0c0d53f131df9aff7449920ec69414
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a376efa4cba26a1aff6728acea5deded7982f12fcc60fe586dbc84850653a2649565bdf88d3ac49eb2ddaac78c4e257533a22aebf5fbe8b559f4dd0699e572f
|
|
7
|
+
data.tar.gz: 726b98d0e1516d621bed5bda08b26fc62a47fbdcc3b3bfd17777208513b3c5979213761aa1175cb7ec18d4351fe729f49562fcbea3ddf73d5d1744f25f308c25
|
data/lib/bitfab/replay.rb
CHANGED
|
@@ -266,7 +266,7 @@ module Bitfab
|
|
|
266
266
|
# SOURCE (historical) trace that was replayed, taken from the server
|
|
267
267
|
# item: the result's own :trace_id at this stage is the new replay
|
|
268
268
|
# trace id (assigned in run() after complete_replay), not the source.
|
|
269
|
-
report = lambda do |result, source_trace_id|
|
|
269
|
+
report = lambda do |result, source_trace_id, test_run_id|
|
|
270
270
|
return unless on_progress
|
|
271
271
|
|
|
272
272
|
progress_mutex.synchronize do
|
|
@@ -275,8 +275,19 @@ module Bitfab
|
|
|
275
275
|
error.nil? ? (succeeded += 1) : (errored += 1)
|
|
276
276
|
begin
|
|
277
277
|
on_progress.call({
|
|
278
|
-
completed:, total:, succeeded:, errored:,
|
|
279
|
-
item: {
|
|
278
|
+
test_run_id:, completed:, total:, succeeded:, errored:,
|
|
279
|
+
item: {
|
|
280
|
+
trace_id: source_trace_id,
|
|
281
|
+
replay_trace_id: result[:trace_id],
|
|
282
|
+
input: result[:input],
|
|
283
|
+
result: result[:result],
|
|
284
|
+
original_output: result[:original_output],
|
|
285
|
+
error:,
|
|
286
|
+
duration_ms: result[:duration_ms],
|
|
287
|
+
tokens: result[:tokens],
|
|
288
|
+
model: result[:model],
|
|
289
|
+
db_snapshot_ref: result[:db_snapshot_ref]
|
|
290
|
+
}
|
|
280
291
|
})
|
|
281
292
|
rescue => e
|
|
282
293
|
warn "Bitfab: replay on_progress callback raised: #{e.message}"
|
|
@@ -288,7 +299,7 @@ module Bitfab
|
|
|
288
299
|
server_items.map do |item|
|
|
289
300
|
result = process_single_item(http_client, item, receiver, method_name, test_run_id, mock_strategy,
|
|
290
301
|
adapt_inputs, include_db_branch_lease)
|
|
291
|
-
report.call(result, item["traceId"])
|
|
302
|
+
report.call(result, item["traceId"], test_run_id)
|
|
292
303
|
result
|
|
293
304
|
end
|
|
294
305
|
else
|
|
@@ -306,7 +317,7 @@ module Bitfab
|
|
|
306
317
|
result = process_single_item(http_client, item, receiver, method_name, test_run_id, mock_strategy,
|
|
307
318
|
adapt_inputs, include_db_branch_lease)
|
|
308
319
|
results_mutex.synchronize { results[idx] = result }
|
|
309
|
-
report.call(result, item["traceId"])
|
|
320
|
+
report.call(result, item["traceId"], test_run_id)
|
|
310
321
|
end
|
|
311
322
|
end
|
|
312
323
|
end
|
data/lib/bitfab/version.rb
CHANGED
data/lib/bitfab.rb
CHANGED
|
@@ -110,10 +110,9 @@ module Bitfab
|
|
|
110
110
|
# line per trace to stderr, which the Bitfab plugin polls to report live
|
|
111
111
|
# progress while the replay runs in the background, so replay scripts never
|
|
112
112
|
# hand-format the protocol. stdout stays the ReplayResult JSON. Never raises
|
|
113
|
-
# (progress must not crash a run). The progress hash's item
|
|
114
|
-
#
|
|
115
|
-
#
|
|
116
|
-
# settled.
|
|
113
|
+
# (progress must not crash a run). The progress hash's item is forwarded
|
|
114
|
+
# verbatim through to_json, so the plugin sees the source trace id, local
|
|
115
|
+
# replay trace id, outputs, error, and duration of the item that just settled.
|
|
117
116
|
#
|
|
118
117
|
# @example
|
|
119
118
|
# Bitfab.client.replay(..., on_progress: Bitfab.method(:report_replay_progress))
|