buildkite-test_collector 1.2.5 → 1.3.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: 4c13aa0b11ea5a23c989efeec885d97c0236094f47f29d07dd449ac6c3516d3b
4
- data.tar.gz: 0e073c922b51517a1958fffaae0fd647ab053cf4267b3f785bfe41427a68548f
3
+ metadata.gz: aed40bbc13d64e1c76b5420ad3f528efe9a47d780d2cac90c7d0689321ff68fe
4
+ data.tar.gz: f158f323d0a8df32e3bb2fd1cfe04731d4b0d300747430708f8db792b0eff157
5
5
  SHA512:
6
- metadata.gz: 387a7e47f6ec18bc2c17be4e024c5f05efec899acbe7572bf8340e41d068eb5db0d9b40daf89459e8ff72f444366cf1012d588067fa6397ee570dfff9ee9c9df
7
- data.tar.gz: 58a0f453ef75a7072fd97424e784377a4bdb64e0aac192a2399376d0ca8f65e02581dda7756970cc12bfeda7398ece40ccd8a634e76a76f8e1e8b6b133c6097c
6
+ metadata.gz: 51a75be7bdd3f5a2af1569aae4986ab1691663e4639857b79fe466ee3e896c52e1d21792156608650c7937cb484d03630cfe5bd7f582a337586ce02fc91c52c0
7
+ data.tar.gz: 29823155c88495478391036edd43c7e536d7388cf7578ec8c32d98a65d100cf8bf646b3cf1d50158c15a9680120ed250d57e4406618f2296036aefe00b804bf2
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /vendor/bundle
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.3.1
4
+
5
+ - Cope with the gem being loaded but not configured when using minitest #165 - @billhorsman
6
+
7
+ ## v1.3.0
8
+
9
+ - Fix ETIMEDOUT during socket connection causing non-zero exit code #162 - @blaknite
10
+ - Add ability to pass custom run env to Test Analytics API #163 - @blaknite
11
+
3
12
  ## v1.2.5
4
13
 
5
14
  - Relax activesupport dependency to >= 4.2.0 #155 - @noodl
@@ -13,6 +22,7 @@
13
22
  - Add ability to specify execution prefix/suffix #140 - @JuanitoFatas
14
23
 
15
24
  ## v1.1.3
25
+
16
26
  - Use a private reference to JSON.parse to prevent it being mocked #149 - @ghcan
17
27
 
18
28
  ## v1.1.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buildkite-test_collector (1.2.5)
4
+ buildkite-test_collector (1.3.1)
5
5
  activesupport (>= 4.2)
6
6
  websocket (~> 1.2)
7
7
 
data/README.md CHANGED
@@ -70,6 +70,25 @@ git commit -am "Add Buildkite Test Analytics"
70
70
  git push origin add-buildkite-test-analytics
71
71
  ```
72
72
 
73
+ ## 🗨️ Annotations
74
+
75
+ This gem allows adding custom annotations to the span data sent to Buildkite using the [.annotate](https://github.com/buildkite/test-collector-ruby/blob/d9fe11341e4aa470e766febee38124b644572360/lib/buildkite/test_collector.rb#L64) method. For example:
76
+
77
+ ```ruby
78
+ Buildkite::TestCollector.annotate("User logged in successfully")
79
+ ```
80
+
81
+ This is particularly useful for tests that generate a lot of span data such as system/feature tests.
82
+
83
+ ## 🏷️ Tagging duplicate test executions with a prefix/suffix
84
+
85
+ For builds that execute the same test multiple times - such as when running the same test suite against multiple versions of ruby/rails - it's possible to tag each test execution with a prefix/suffix. This prefix/suffix is displayed for each execution on the test show page to differentiate the build environment. The prefix/suffix is specified using these environment variables:
86
+
87
+ ```
88
+ BUILDKITE_ANALYTICS_EXECUTION_NAME_PREFIX
89
+ BUILDKITE_ANALYTICS_EXECUTION_NAME_SUFFIX
90
+ ```
91
+
73
92
  ## 🔍 Debugging
74
93
 
75
94
  To enable debugging output, set the `BUILDKITE_ANALYTICS_DEBUG_ENABLED` environment variable to `true`.
@@ -8,7 +8,7 @@ class Buildkite::TestCollector::CI
8
8
  # The analytics env are more specific than the automatic ci platform env.
9
9
  # If they've been specified we'll assume the user wants to use that value instead.
10
10
  def env
11
- ci_env.merge(analytics_env)
11
+ ci_env.merge(analytics_env).merge(Buildkite::TestCollector.env)
12
12
  end
13
13
 
14
14
  private
@@ -11,8 +11,10 @@ module Buildkite::TestCollector::MinitestPlugin
11
11
  def record(result)
12
12
  super
13
13
 
14
- if trace = Buildkite::TestCollector.uploader.traces[result.source_location]
15
- Buildkite::TestCollector.session&.write_result(trace)
14
+ if Buildkite::TestCollector.uploader
15
+ if trace = Buildkite::TestCollector.uploader.traces[result.source_location]
16
+ Buildkite::TestCollector.session&.write_result(trace)
17
+ end
16
18
  end
17
19
  end
18
20
 
@@ -82,7 +82,7 @@ module Buildkite::TestCollector
82
82
  @session.disconnected(self)
83
83
  disconnect
84
84
  end
85
- rescue Errno::ECONNRESET => e
85
+ rescue Errno::ECONNRESET, Errno::ETIMEDOUT => e
86
86
  Buildkite::TestCollector.logger.error("#{e}")
87
87
  if @socket
88
88
  Buildkite::TestCollector.logger.error("attempting disconnected flow")
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Buildkite
4
4
  module TestCollector
5
- VERSION = "1.2.5"
5
+ VERSION = "1.3.1"
6
6
  NAME = "buildkite-test_collector"
7
7
  end
8
8
  end
@@ -43,13 +43,15 @@ module Buildkite
43
43
  attr_accessor :session
44
44
  attr_accessor :debug_enabled
45
45
  attr_accessor :tracing_enabled
46
+ attr_accessor :env
46
47
  end
47
48
 
48
- def self.configure(hook:, token: nil, url: nil, debug_enabled: false, tracing_enabled: true)
49
+ def self.configure(hook:, token: nil, url: nil, debug_enabled: false, tracing_enabled: true, env: {})
49
50
  self.api_token = (token || ENV["BUILDKITE_ANALYTICS_TOKEN"])&.strip
50
51
  self.url = url || DEFAULT_URL
51
52
  self.debug_enabled = debug_enabled || !!(ENV["BUILDKITE_ANALYTICS_DEBUG_ENABLED"])
52
53
  self.tracing_enabled = tracing_enabled
54
+ self.env = env
53
55
 
54
56
  self.hook_into(hook)
55
57
  end
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.2.5
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Buildkite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-21 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.3.3
132
+ rubygems_version: 3.1.6
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Track test executions and report to Buildkite Test Analytics