bitfab 0.23.3 → 0.23.4

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: b16e8767e1610a6e1a1ec7ab0f03a17b4eb365b991d26fa60f4aa6b9f3d39ac4
4
- data.tar.gz: f511a486af389b33aafbdcab66518f8b4381cceb137faec4e483fe81484379c6
3
+ metadata.gz: 4c6103564370cdb20d6ed221a57c1cd29f8e410cd23ad3218b4eb0bda3ff3bd1
4
+ data.tar.gz: aded540c60d09f0838e529fc7616659fc6d64ad5dbcaf12baf396b164d741f7d
5
5
  SHA512:
6
- metadata.gz: e4e09e2cba8fe57b31adbedceabaff1720a80a20e4216821bbd0389bc5b45c05203a4aca205e49623ff934670a21d181bff8a27a0777ea905682f149d97360d4
7
- data.tar.gz: d2b56368cd69b9555e95431679e98acec87fb54d6c4da9ec2db2f72f0c86074b24e43abe67f5ae0a02355de7244280b31730a3feef6574a68ee0437e672ffd02
6
+ metadata.gz: 4ee3df19ee7101db92bea5305f61c67cc92d1bb5cdf4999cde05f31ee15b7e5090d5f474a35abb5814ca799a8849cea1cc3eda55064ec72bd2ac601c251622a0
7
+ data.tar.gz: 6729607659c50822d1799e86dfc3219cf7cfa5d47a8d9e82d5e8904918f3378a4d98b8f6a0bf9435ed8f34b147d96b061730424cbd2ce0a132d82e3a10c3f415
data/lib/bitfab/replay.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "fileutils"
4
+ require "json"
5
+
3
6
  require_relative "constants"
4
7
  require_relative "serialize"
5
8
  require_relative "traceable"
@@ -239,11 +242,26 @@ module Bitfab
239
242
  end
240
243
  end
241
244
 
242
- {
245
+ replay_result = {
243
246
  items: result_items,
244
247
  test_run_id:,
245
248
  test_run_url: "#{client.service_url}#{test_run_url}"
246
249
  }
250
+ write_replay_result_file(replay_result)
251
+ replay_result
252
+ end
253
+
254
+ def write_replay_result_file(result)
255
+ result_path = ENV["BITFAB_REPLAY_RESULT_PATH"]
256
+ return if result_path.nil? || result_path.empty?
257
+
258
+ begin
259
+ dir = File.dirname(result_path)
260
+ FileUtils.mkdir_p(dir) unless dir.nil? || dir.empty? || dir == "."
261
+ File.write(result_path, "#{JSON.pretty_generate(result)}\n")
262
+ rescue => e
263
+ warn "Bitfab: failed to write replay result to BITFAB_REPLAY_RESULT_PATH (#{result_path}): #{e.message}"
264
+ end
247
265
  end
248
266
 
249
267
  # Process all replay items, optionally in parallel using threads.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitfab
4
- VERSION = "0.23.3"
4
+ VERSION = "0.23.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.3
4
+ version: 0.23.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harvest Team