buildkite-test_collector 1.2.5 → 1.3.0

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: 005eb1bc1422132bd59f78f83bb1662d581c16ce44192688538ea6ef3bccc531
4
+ data.tar.gz: ade791ef34d74d83892ee310f6fd1c1f42d13db916033ac41e4960aa48e3a20a
5
5
  SHA512:
6
- metadata.gz: 387a7e47f6ec18bc2c17be4e024c5f05efec899acbe7572bf8340e41d068eb5db0d9b40daf89459e8ff72f444366cf1012d588067fa6397ee570dfff9ee9c9df
7
- data.tar.gz: 58a0f453ef75a7072fd97424e784377a4bdb64e0aac192a2399376d0ca8f65e02581dda7756970cc12bfeda7398ece40ccd8a634e76a76f8e1e8b6b133c6097c
6
+ metadata.gz: 3274a05d4df3f86f5e100652d301a27001b25f154a6710945a5b8759353ad017354e5b09569937b4af1cdc64b261f98385e3249ea53f24f03ed2e76902d63759
7
+ data.tar.gz: 192ebea65462cc08a4aef896bb89dfd29159aeb59bbb9c56683ef92128f190e2b4112c805f2e79d0b83888394a01909ff11c09a1b41512413c2f2094eb66b5a8
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,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.3.0
4
+
5
+ - Fix ETIMEDOUT during socket connection causing non-zero exit code #162 - @blaknite
6
+ - Add ability to pass custom run env to Test Analytics API #163 - @blaknite
7
+
3
8
  ## v1.2.5
4
9
 
5
10
  - Relax activesupport dependency to >= 4.2.0 #155 - @noodl
@@ -13,6 +18,7 @@
13
18
  - Add ability to specify execution prefix/suffix #140 - @JuanitoFatas
14
19
 
15
20
  ## v1.1.3
21
+
16
22
  - Use a private reference to JSON.parse to prevent it being mocked #149 - @ghcan
17
23
 
18
24
  ## 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.0)
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
@@ -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.0"
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.0
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-11-15 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.3.7
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: Track test executions and report to Buildkite Test Analytics