buildkite-test_collector 1.2.4 → 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: 520259c47eab4e04270473067134ca2666ff118b4158ef17ae8bf832d2d4b9b5
4
- data.tar.gz: 0baf54f0a8e69dab1d3794ba137469e9a4ce4b93108f0d69215b7f6409f92f22
3
+ metadata.gz: 005eb1bc1422132bd59f78f83bb1662d581c16ce44192688538ea6ef3bccc531
4
+ data.tar.gz: ade791ef34d74d83892ee310f6fd1c1f42d13db916033ac41e4960aa48e3a20a
5
5
  SHA512:
6
- metadata.gz: 0bd552f37653d8e4c55fb98797fd16884fad19fe693670dfc546a6e0883d206f7db4646c0e10f4c6f02f6e39adaa70f95e6c94e21d318cf5ec64810135afc15f
7
- data.tar.gz: 281311e6be534df2b1b6ff4fe3815683cfdeb0ab00ec2de0ad04ac9906256e0278aa8ccc5896f9a048ac7a9b87c950b5616b85b3dd1456671373f0235d2ed49e
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,14 @@
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
+
8
+ ## v1.2.5
9
+
10
+ - Relax activesupport dependency to >= 4.2.0 #155 - @noodl
11
+
3
12
  ## v1.2.4
4
13
 
5
14
  - Fix sleep instrumentation errors without argument #153 - @JuanitoFatas
@@ -9,6 +18,7 @@
9
18
  - Add ability to specify execution prefix/suffix #140 - @JuanitoFatas
10
19
 
11
20
  ## v1.1.3
21
+
12
22
  - Use a private reference to JSON.parse to prevent it being mocked #149 - @ghcan
13
23
 
14
24
  ## v1.1.2
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buildkite-test_collector (1.2.4)
5
- activesupport (>= 5.2, < 8)
4
+ buildkite-test_collector (1.3.0)
5
+ activesupport (>= 4.2)
6
6
  websocket (~> 1.2)
7
7
 
8
8
  GEM
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`.
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
26
26
 
27
- spec.add_dependency "activesupport", ">= 5.2", "< 8"
27
+ spec.add_dependency "activesupport", ">= 4.2"
28
28
  spec.add_dependency "websocket", '~> 1.2'
29
29
 
30
30
  spec.add_development_dependency "rspec-core", '~> 3.10'
@@ -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.4"
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.4
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-20 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
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.2'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '8'
19
+ version: '4.2'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '5.2'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '8'
26
+ version: '4.2'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: websocket
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
129
  - !ruby/object:Gem::Version
136
130
  version: '0'
137
131
  requirements: []
138
- rubygems_version: 3.3.3
132
+ rubygems_version: 3.3.7
139
133
  signing_key:
140
134
  specification_version: 4
141
135
  summary: Track test executions and report to Buildkite Test Analytics