buildkite-test_collector 2.3.0 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cecd9e001e4e3ead60507d46635e48fbe2468c183e215896ae4c92e69d207aee
4
- data.tar.gz: da88dde37e16f1ef279f05f84434fdefe1edc8488e864b669cba0741cc0799ca
3
+ metadata.gz: 0b48c795c760f5a77634bc30024c344925036c3b4f935848caf6dcaf861b1692
4
+ data.tar.gz: 263e4faa13017fa5f8e1465dc76f245e05b3f26f703e933c87cb547b17e5dfbd
5
5
  SHA512:
6
- metadata.gz: 7d8a965f5a1897a0ddce0ac3a03a527fbfb8d2683ce9555961ef1ba597742e7070cdd187d48f97b8e3111769e837eca69e1b65b52708515b7c87357811bc2c8f
7
- data.tar.gz: 00caaf80206b97b39d4f4f0e67c15e1b8b77ee5f7df85f74b4a569bff3cb0ec1e4f2a248eda5c0d302277e0fe44421c52a32d65e114d162334971af9fad03e75
6
+ metadata.gz: feaa2ec084069d17991bf5fda126b6b6d01fee4a807e4295bd644a02ccf30a02e9f1c0e912e2441347aee48f36bdae7eaa46ea4fe86075ac60e0b88424199aee
7
+ data.tar.gz: 7c31eafe74aa8cba48e74537940968c0b322b8939b33fa1cee2fdfb05600aa5ef9fc6192fb3b3c972bf4286edc3180cd375240eac2b6be8be08a4466bbed5567
data/CHANGELOG.md CHANGED
@@ -1,17 +1,31 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v2.3.2
4
+
5
+ - Add support for Codeship #198 - @swebb
6
+ - Restore compatibility with older Ruby versions #201 - @gchan
7
+ - Report Ruby version to Test Analytics #203 - @gchan
8
+
9
+ ## v2.3.1
10
+
11
+ - Log standard error raised during upload #195 - @nprizal
12
+
3
13
  ## v2.3.0
14
+
4
15
  - Stop sending execution id and safeguard SecureRandom.uuid #192 - @niceking
5
16
  - Rescue from StandardError when sending upload request #191 - @niceking
6
17
  - Fix nil pointer #188 - @ChrisBr
7
18
 
8
19
  ## v2.2.0
20
+
9
21
  - Gzip payload of request to Upload API #183 - @niceking
10
22
 
11
23
  ## v2.1.0
24
+
12
25
  - Major change: deprecates websocket connection in favour of sending HTTP requests to the Upload API. In future, websocket support will be completely removed from Buildkite and only version 2.1+ of this gem will continue to work.
13
26
 
14
27
  ## v2.1.0.pre
28
+
15
29
  - Minitest plugin to use HTTP Upload API instead of websocket connection to send test data #178 #179 - @niceking
16
30
 
17
31
  ## v2.0.0.pre
@@ -29,6 +43,7 @@
29
43
  - Update collector argument in the Analytics::API payload #170 - @KatieWright26
30
44
 
31
45
  ## v1.4.1
46
+
32
47
  - Add in support to create file with trace data #167
33
48
 
34
49
  ## v1.3.1
data/Gemfile.lock CHANGED
@@ -1,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buildkite-test_collector (2.3.0)
4
+ buildkite-test_collector (2.3.2)
5
5
  activesupport (>= 4.2)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (7.0.4.3)
10
+ activesupport (7.0.7.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 1.6, < 2)
13
13
  minitest (>= 5.1)
14
14
  tzinfo (~> 2.0)
15
15
  concurrent-ruby (1.2.2)
16
16
  diff-lcs (1.4.4)
17
- i18n (1.13.0)
17
+ i18n (1.14.1)
18
18
  concurrent-ruby (~> 1.0)
19
- minitest (5.18.0)
19
+ minitest (5.19.0)
20
20
  rake (13.0.6)
21
21
  rspec (3.10.0)
22
22
  rspec-core (~> 3.10.0)
data/README.md CHANGED
@@ -7,7 +7,7 @@ Official [Buildkite Test Analytics](https://buildkite.com/test-analytics) collec
7
7
 
8
8
  ⚒ **Supported test frameworks:** RSpec, Minitest, and [more coming soon](https://github.com/buildkite/test-collector-ruby/issues?q=is%3Aissue+is%3Aopen+label%3A%22test+frameworks%22).
9
9
 
10
- 📦 **Supported CI systems:** Buildkite, GitHub Actions, CircleCI, and others via the `BUILDKITE_ANALYTICS_*` environment variables.
10
+ 📦 **Supported CI systems:** Buildkite, GitHub Actions, CircleCI, Codeship, and others via the `BUILDKITE_ANALYTICS_*` environment variables.
11
11
 
12
12
  ## 👉 Installing
13
13
 
@@ -73,6 +73,15 @@ git commit -am "Add Buildkite Test Analytics"
73
73
  git push origin add-buildkite-test-analytics
74
74
  ```
75
75
 
76
+ ### VCR
77
+ If your test suites use [VCR](https://github.com/vcr/vcr) to stub network requests, you'll need to modify the config to allow actual network requests to Test Analytics.
78
+
79
+ ```
80
+ VCR.configure do |c|
81
+ c.ignore_hosts "analytics-api.buildkite.com"
82
+ end
83
+ ```
84
+
76
85
  ## 🗨️ Annotations
77
86
 
78
87
  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:
data/buildkite.yaml CHANGED
@@ -1,8 +1,41 @@
1
1
  steps:
2
- - label: ":rspec: Tests"
2
+ - label: ":rspec: Tests :ruby: 3.3-rc"
3
3
  command:
4
4
  - "bundle"
5
5
  - "bundle exec rake"
6
6
  plugins:
7
7
  - docker#v3.7.0:
8
- image: 445615400570.dkr.ecr.us-east-1.amazonaws.com/ecr-public/docker/library/ruby:3.1.4
8
+ image: "445615400570.dkr.ecr.us-east-1.amazonaws.com/ecr-public/docker/library/ruby:3.3-rc"
9
+ soft_fail: true
10
+
11
+ - label: ":rspec: Tests :ruby: {{matrix}}"
12
+ command:
13
+ - "bundle"
14
+ - "bundle exec rake"
15
+ plugins:
16
+ - docker#v3.7.0:
17
+ image: "445615400570.dkr.ecr.us-east-1.amazonaws.com/ecr-public/docker/library/ruby:{{matrix}}"
18
+ matrix:
19
+ - "latest"
20
+ - "3.2"
21
+ - "3.1"
22
+ - "3.0"
23
+ - "2.7"
24
+
25
+ - group: ":rspec: Legacy Ruby :ruby:"
26
+ steps:
27
+ - label: ":rspec: Tests :ruby: {{matrix}}"
28
+ command:
29
+ - "gem install bundler:2.3.25"
30
+ - "bundle"
31
+ - "bundle exec rake"
32
+ plugins:
33
+ - docker#v3.7.0:
34
+ # Images for older Ruby versions aren't available on AWS ECR
35
+ # so fall back to Docker Hub
36
+ image: "ruby:{{matrix}}"
37
+ matrix:
38
+ - "2.6"
39
+ - "2.5"
40
+ - "2.4"
41
+ - "2.3"
@@ -17,6 +17,7 @@ class Buildkite::TestCollector::CI
17
17
  return buildkite if ENV["BUILDKITE_BUILD_ID"]
18
18
  return github_actions if ENV["GITHUB_RUN_NUMBER"]
19
19
  return circleci if ENV["CIRCLE_BUILD_NUM"]
20
+ return codeship if ENV["CI_NAME"] == "codeship"
20
21
  return generic if ENV["CI"]
21
22
 
22
23
  {
@@ -36,9 +37,10 @@ class Buildkite::TestCollector::CI
36
37
  "message" => ENV["BUILDKITE_ANALYTICS_MESSAGE"],
37
38
  "execution_name_prefix" => ENV["BUILDKITE_ANALYTICS_EXECUTION_NAME_PREFIX"],
38
39
  "execution_name_suffix" => ENV["BUILDKITE_ANALYTICS_EXECUTION_NAME_SUFFIX"],
40
+ "language_version" => RUBY_VERSION,
39
41
  "version" => Buildkite::TestCollector::VERSION,
40
42
  "collector" => "ruby-#{Buildkite::TestCollector::NAME}",
41
- }.compact
43
+ }.select { |_, value| !value.nil? }
42
44
  end
43
45
 
44
46
  def generic
@@ -82,4 +84,16 @@ class Buildkite::TestCollector::CI
82
84
  "number" => ENV["CIRCLE_BUILD_NUM"],
83
85
  }
84
86
  end
87
+
88
+ def codeship
89
+ {
90
+ "CI" => "codeship",
91
+ "key" => "#{ENV["CI_BUILD_ID"]}",
92
+ "url" => ENV["CI_PULL_REQUEST"],
93
+ "branch" => ENV["CI_BRANCH"],
94
+ "commit_sha" => ENV["CI_COMMIT_ID"],
95
+ "number" => nil,
96
+ "message" => ENV["CI_COMMIT_MESSAGE"],
97
+ }
98
+ end
85
99
  end
@@ -38,7 +38,7 @@ module Buildkite::TestCollector::MinitestPlugin
38
38
  failure_reason: failure_reason,
39
39
  failure_expanded: failure_expanded,
40
40
  history: history,
41
- ).with_indifferent_access.compact
41
+ ).with_indifferent_access.select { |_, value| !value.nil? }
42
42
  end
43
43
 
44
44
  private
@@ -50,7 +50,7 @@ module Buildkite::TestCollector::MinitestPlugin
50
50
  end
51
51
 
52
52
  def file_name
53
- @file_name ||= File.join('./', source_location[0].delete_prefix(project_dir))
53
+ @file_name ||= File.join('./', source_location[0].sub(/\A#{project_dir}/, ""))
54
54
  end
55
55
 
56
56
  def line_number
@@ -74,7 +74,7 @@ module Buildkite::TestCollector::MinitestPlugin
74
74
  # remove the first line of message from the first failure
75
75
  # to avoid duplicate line in Test Analytics UI
76
76
  messages = strip_invalid_utf8_chars(failure.message).split("\n")
77
- messages = messages[1..] if index.zero?
77
+ messages = messages[1..-1] if index.zero?
78
78
 
79
79
  {
80
80
  expanded: messages,
@@ -32,7 +32,7 @@ module Buildkite::TestCollector::RSpecPlugin
32
32
  failure_reason: failure_reason,
33
33
  failure_expanded: failure_expanded,
34
34
  history: history,
35
- ).with_indifferent_access.compact
35
+ ).with_indifferent_access.select { |_, value| !value.nil? }
36
36
  end
37
37
 
38
38
  private
@@ -46,6 +46,7 @@ module Buildkite::TestCollector
46
46
  retry
47
47
  end
48
48
  rescue StandardError => e
49
+ $stderr.puts e
49
50
  $stderr.puts "#{Buildkite::TestCollector::NAME} #{Buildkite::TestCollector::VERSION} experienced an error when sending your data, you may be missing some executions for this run."
50
51
  end
51
52
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Buildkite
4
4
  module TestCollector
5
- VERSION = "2.3.0"
5
+ VERSION = "2.3.2"
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: 2.3.0
4
+ version: 2.3.2
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-05-24 00:00:00.000000000 Z
11
+ date: 2023-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.10'
55
- description:
55
+ description:
56
56
  email:
57
57
  - support+analytics@buildkite.com
58
58
  executables: []
@@ -99,7 +99,7 @@ licenses:
99
99
  metadata:
100
100
  homepage_uri: https://github.com/buildkite/test-collector-ruby
101
101
  source_code_uri: https://github.com/buildkite/test-collector-ruby
102
- post_install_message:
102
+ post_install_message:
103
103
  rdoc_options: []
104
104
  require_paths:
105
105
  - lib
@@ -114,8 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.1.6
118
- signing_key:
117
+ rubygems_version: 3.3.26
118
+ signing_key:
119
119
  specification_version: 4
120
120
  summary: Track test executions and report to Buildkite Test Analytics
121
121
  test_files: []