buildkite-test_collector 1.4.2 → 1.5.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: c89588cb63374f9a2bd84b29cd575133aa84c2a684e10e0e7d78dd63a54ad34e
4
- data.tar.gz: a05196237e4d03ae61f9953c94de3d54253a40c89a6f0557c3fa8e42b800e163
3
+ metadata.gz: 90ace3070ba5267cd956e59f09db4c065556295c916a042abeb5e9f6d6d2ff06
4
+ data.tar.gz: 8ea5a68cdeb8fe4cbab374e8f5769daf867e913433ab45cc8630cad0ce1033c4
5
5
  SHA512:
6
- metadata.gz: ab0e5a4fc6a21adc7f8f240331f5a80b27fb7442ca1ae5f81b5d0721e4143007ee0b4c4d1b1122c83c0e1aeaa5bea48167a6b2c3c92b3ad4d1100f7e768e607e
7
- data.tar.gz: d7e0ea4e7ad204b9e5e6d11136008580a435bfe43e7ea9784926e6af60c0347dd556dd4d4410e542e29eb3c7a75be0fae3f6164a2bfbd7c451d37f121f62b932
6
+ metadata.gz: c8d067d2b24e5baab884443ec5911a9f9642cd94c61329f214ed2fbea642f6324e094e7d8adb909057986b85339f2757dc54b6904aaa0272ef6e0c93bf63f097
7
+ data.tar.gz: d16f6a95ae882f1fc2c24ed4838b6a9e4af7a5648c94f15788463cb3a1080357f2ae4b797ae80b66a2cdb110235d4d1900bd59133b350f6430705fdeaae23438
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.5.0
4
+
5
+ - Send `failure_expanded` from minitest #171 - @nprizal
6
+
3
7
  ## v1.4.2
4
8
 
5
9
  - Update collector argument in the Analytics::API payload #170 - @KatieWright26
data/Gemfile.lock CHANGED
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buildkite-test_collector (1.4.2)
4
+ buildkite-test_collector (1.5.0)
5
5
  activesupport (>= 4.2)
6
6
  websocket (~> 1.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.4.1)
11
+ activesupport (7.0.4.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
15
15
  tzinfo (~> 2.0)
16
- concurrent-ruby (1.1.10)
16
+ concurrent-ruby (1.2.0)
17
17
  diff-lcs (1.4.4)
18
18
  i18n (1.12.0)
19
19
  concurrent-ruby (~> 1.0)
@@ -32,7 +32,7 @@ GEM
32
32
  diff-lcs (>= 1.2.0, < 2.0)
33
33
  rspec-support (~> 3.10.0)
34
34
  rspec-support (3.10.3)
35
- tzinfo (2.0.5)
35
+ tzinfo (2.0.6)
36
36
  concurrent-ruby (~> 1.0)
37
37
  websocket (1.2.9)
38
38
 
@@ -15,12 +15,10 @@ module Buildkite::TestCollector::MinitestPlugin
15
15
 
16
16
  FILE_PATH_REGEX = /^(.*?\.(rb|feature))/
17
17
 
18
- def initialize(example, history:, failure_reason: nil, failure_expanded: [])
18
+ def initialize(example, history:)
19
19
  @id = SecureRandom.uuid
20
20
  @example = example
21
21
  @history = history
22
- @failure_reason = failure_reason
23
- @failure_expanded = failure_expanded
24
22
  end
25
23
 
26
24
  def result
@@ -72,17 +70,20 @@ module Buildkite::TestCollector::MinitestPlugin
72
70
  end
73
71
 
74
72
  def failure_reason
75
- @failure_reason ||= example.failure&.message
73
+ @failure_reason ||= strip_invalid_utf8_chars(example.failure&.message)&.split("\n")&.first
76
74
  end
77
75
 
78
76
  def failure_expanded
79
- @failure_expanded ||= begin
80
- example.failures.map do |failure|
81
- {
82
- expanded: failure.message,
83
- backtrace: failure.backtrace,
84
- }
85
- end
77
+ @failure_expanded ||= example.failures.map.with_index do |failure, index|
78
+ # remove the first line of message from the first failure
79
+ # to avoid duplicate line in Test Analytics UI
80
+ messages = strip_invalid_utf8_chars(failure.message).split("\n")
81
+ messages = messages[1..] if index.zero?
82
+
83
+ {
84
+ expanded: messages,
85
+ backtrace: failure.backtrace
86
+ }
86
87
  end
87
88
  end
88
89
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Buildkite
4
4
  module TestCollector
5
- VERSION = "1.4.2"
5
+ VERSION = "1.5.0"
6
6
  NAME = "buildkite-test_collector"
7
7
  end
8
8
  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.4.2
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Buildkite
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-19 00:00:00.000000000 Z
11
+ date: 2023-01-29 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
@@ -129,8 +129,8 @@ 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.26
133
- signing_key:
132
+ rubygems_version: 3.4.1
133
+ signing_key:
134
134
  specification_version: 4
135
135
  summary: Track test executions and report to Buildkite Test Analytics
136
136
  test_files: []