buildkite-test_collector 1.3.1 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aed40bbc13d64e1c76b5420ad3f528efe9a47d780d2cac90c7d0689321ff68fe
4
- data.tar.gz: f158f323d0a8df32e3bb2fd1cfe04731d4b0d300747430708f8db792b0eff157
3
+ metadata.gz: 9ac106c7e21ac22bb2c504e3485b53a1986ac34399847d24e1da23e3b373f519
4
+ data.tar.gz: 738bca3b38b36b16ebd639cd9d11569835405c3347b8e471ccdbff91efc5b0e6
5
5
  SHA512:
6
- metadata.gz: 51a75be7bdd3f5a2af1569aae4986ab1691663e4639857b79fe466ee3e896c52e1d21792156608650c7937cb484d03630cfe5bd7f582a337586ce02fc91c52c0
7
- data.tar.gz: 29823155c88495478391036edd43c7e536d7388cf7578ec8c32d98a65d100cf8bf646b3cf1d50158c15a9680120ed250d57e4406618f2296036aefe00b804bf2
6
+ metadata.gz: 1720f820c576654caeaab8a3513a4b8c34c1fc0ce825866e4ae4470daf20c2ffdd511037c4c57da503d2abad64a143153f8b1f2c6025b93137472c32a33f4afb
7
+ data.tar.gz: 92c8659c83f2c7dc4ad4b3bb3bcda4265f126a1f6104a399a57ea161805a364c5543abcedf5f7c6081fddad46b2f5c73c9dab50a932f8a12090779f29613ed98
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.4.1
4
+ - Add in support to create file with trace data #167
5
+
3
6
  ## v1.3.1
4
7
 
5
8
  - Cope with the gem being loaded but not configured when using minitest #165 - @billhorsman
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buildkite-test_collector (1.3.1)
4
+ buildkite-test_collector (1.4.1)
5
5
  activesupport (>= 4.2)
6
6
  websocket (~> 1.2)
7
7
 
@@ -29,6 +29,18 @@ RSpec.configure do |config|
29
29
  trace = Buildkite::TestCollector::RSpecPlugin::Trace.new(example, history: tracer.history)
30
30
  Buildkite::TestCollector.uploader.traces[example.id] = trace
31
31
  end
32
+
33
+ config.after(:suite) do
34
+ if Buildkite::TestCollector.artifact_path
35
+ filename = File.join(Buildkite::TestCollector.artifact_path, "buildkite-test-collector-rspec-#{SecureRandom.uuid}.json.gz")
36
+ data_set = { results: Buildkite::TestCollector.uploader.traces.values.map(&:as_hash) }
37
+ File.open(filename, "wb") do |f|
38
+ gz = Zlib::GzipWriter.new(f)
39
+ gz.write(data_set.to_json)
40
+ gz.close
41
+ end
42
+ end
43
+ end
32
44
  end
33
45
 
34
46
  Buildkite::TestCollector.enable_tracing!
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Buildkite
4
4
  module TestCollector
5
- VERSION = "1.3.1"
5
+ VERSION = "1.4.1"
6
6
  NAME = "buildkite-test_collector"
7
7
  end
8
8
  end
@@ -43,14 +43,16 @@ module Buildkite
43
43
  attr_accessor :session
44
44
  attr_accessor :debug_enabled
45
45
  attr_accessor :tracing_enabled
46
+ attr_accessor :artifact_path
46
47
  attr_accessor :env
47
48
  end
48
49
 
49
- def self.configure(hook:, token: nil, url: nil, debug_enabled: false, tracing_enabled: true, env: {})
50
+ def self.configure(hook:, token: nil, url: nil, debug_enabled: false, tracing_enabled: true, artifact_path: nil, env: {})
50
51
  self.api_token = (token || ENV["BUILDKITE_ANALYTICS_TOKEN"])&.strip
51
52
  self.url = url || DEFAULT_URL
52
53
  self.debug_enabled = debug_enabled || !!(ENV["BUILDKITE_ANALYTICS_DEBUG_ENABLED"])
53
54
  self.tracing_enabled = tracing_enabled
55
+ self.artifact_path = artifact_path
54
56
  self.env = env
55
57
 
56
58
  self.hook_into(hook)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildkite-test_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Buildkite
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2022-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.10'
69
- description:
69
+ description:
70
70
  email:
71
71
  - support+analytics@buildkite.com
72
72
  executables: []
@@ -114,7 +114,7 @@ licenses:
114
114
  metadata:
115
115
  homepage_uri: https://github.com/buildkite/test-collector-ruby
116
116
  source_code_uri: https://github.com/buildkite/test-collector-ruby
117
- post_install_message:
117
+ post_install_message:
118
118
  rdoc_options: []
119
119
  require_paths:
120
120
  - lib
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubygems_version: 3.1.6
133
- signing_key:
133
+ signing_key:
134
134
  specification_version: 4
135
135
  summary: Track test executions and report to Buildkite Test Analytics
136
136
  test_files: []