buildkite-test_collector 2.1.0.pre → 2.2.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: e85ba163eccc317f8e03168153e2018d6b3033b760c3479d7e569848dee8be64
4
- data.tar.gz: 2ee8f7c0088bd8cf0eff5b94bff12eaf93a5eec5b34e55e25f4bc31d130dbb53
3
+ metadata.gz: c3f61975dacef343c33cf6d550fc4dd5d765f02050bd2a8bc86b5e221afa751d
4
+ data.tar.gz: 340dc7bce50ef727dfea08a331260824aaa640c9e83b344bc620afbf153fbe1d
5
5
  SHA512:
6
- metadata.gz: 302e0420cf87e321faaaa4cf7843d322d1b9589a31411e4e7239c781f6176ab7d2a8ff2c0d3650912bccd0f863946d8815d7f0667e1cf132497b35410dcfa247
7
- data.tar.gz: ff0a31165893a7368465be84a8ba8fbc6f863198a3b8d8965cee9941a29b785a6c547eb70cfa6c6e1283d4378970c0e217dfff87b657cc91837736ccf6c7a978
6
+ metadata.gz: e692ebc6764114d7a70e854c8daf7acd09110ad78736163a2845538451cf5f6b424a709bbccc89007bdccc3e68fac391bb3d9ec041965167c2a709dd6d68ffd5
7
+ data.tar.gz: 7cb0d8141ebfa1b43c8bc5ae4de82bccbc3da9cb221566a9a54ca7f54b2eba3908be5fa923dc0d08c688fd41d1941f24e711d747ab7d0ecea44be8658f1a2ca8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v2.2.0
4
+ - Gzip payload of request to Upload API #183 - @niceking
5
+
6
+ ## v2.1.0
7
+ - 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.
8
+
3
9
  ## v2.1.0.pre
4
10
  - Minitest plugin to use HTTP Upload API instead of websocket connection to send test data #178 #179 - @niceking
5
11
 
@@ -11,7 +17,7 @@
11
17
 
12
18
  ## v1.5.0
13
19
 
14
- - Send `failure_expanded` from minitest #171 - @nprizal
20
+ - Send `failure_expanded` from minitest #171 - @nprizal
15
21
 
16
22
  ## v1.4.2
17
23
 
data/DESIGN.md CHANGED
@@ -2,17 +2,7 @@
2
2
 
3
3
  ## Threads
4
4
 
5
- The Buildkite ruby collector uses websockets and ActionCable to send and
6
- receive data with Buildkite. Execution information starts transmitting as soon
7
- as possible, without waiting for the test suite to finish running.
8
-
9
- This gem uses 3 ruby threads:
10
-
11
- * main thread: acts as the producer. It collects span data from the
12
- test suite and enqueues it into the send queue.
13
- * write thread: acts as the consumer. Removes data from the send queue and
14
- sends it to Buildkite.
15
- * read thread: receives and processes messages from Buildkite.
5
+ The Buildkite ruby collector uses threads to send data to the Upload API in the background. When the test suite has finished running, the collector waits UPLOAD_SESSION_TIMEOUT seconds for the Upload API requests to finish before exiting.
16
6
 
17
7
  ## Data
18
8
 
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- buildkite-test_collector (2.1.0.pre)
4
+ buildkite-test_collector (2.2.0)
5
5
  activesupport (>= 4.2)
6
- websocket (~> 1.2)
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
@@ -34,7 +33,6 @@ GEM
34
33
  rspec-support (3.10.3)
35
34
  tzinfo (2.0.6)
36
35
  concurrent-ruby (~> 1.0)
37
- websocket (1.2.9)
38
36
 
39
37
  PLATFORMS
40
38
  ruby
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Buildkite Collectors for Ruby
2
2
 
3
+ **DEPRECATION NOTICE**
4
+ Versions prior to 2.1.x are unsupported and will not work after mid-2023. Please upgrade to the latest version.
5
+
3
6
  Official [Buildkite Test Analytics](https://buildkite.com/test-analytics) collectors for Ruby test frameworks ✨
4
7
 
5
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).
@@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
26
26
 
27
27
  spec.add_dependency "activesupport", ">= 4.2"
28
- spec.add_dependency "websocket", '~> 1.2'
29
28
 
30
29
  spec.add_development_dependency "rspec-core", '~> 3.10'
31
30
  spec.add_development_dependency "rspec-expectations", '~> 3.10'
data/buildkite.yaml CHANGED
@@ -5,4 +5,4 @@ steps:
5
5
  - "bundle exec rake"
6
6
  plugins:
7
7
  - docker#v3.7.0:
8
- image: ruby:latest
8
+ image: 445615400570.dkr.ecr.us-east-1.amazonaws.com/ecr-public/docker/library/ruby:3.1.4
@@ -10,24 +10,6 @@ module Buildkite::TestCollector
10
10
  @authorization_header = "Token token=\"#{Buildkite::TestCollector.api_token}\""
11
11
  end
12
12
 
13
- def post
14
- contact_uri = URI.parse(url)
15
-
16
- http = Net::HTTP.new(contact_uri.host, contact_uri.port)
17
- http.use_ssl = contact_uri.scheme == "https"
18
-
19
- contact = Net::HTTP::Post.new(contact_uri.path, {
20
- "Authorization" => authorization_header,
21
- "Content-Type" => "application/json",
22
- })
23
- contact.body = {
24
- run_env: Buildkite::TestCollector::CI.env,
25
- format: "websocket"
26
- }.to_json
27
-
28
- http.request(contact)
29
- end
30
-
31
13
  def post_json(data)
32
14
  contact_uri = URI.parse(url)
33
15
 
@@ -37,16 +19,25 @@ module Buildkite::TestCollector
37
19
  contact = Net::HTTP::Post.new(contact_uri.path, {
38
20
  "Authorization" => authorization_header,
39
21
  "Content-Type" => "application/json",
22
+ "Content-Encoding" => "gzip",
40
23
  })
41
24
 
42
25
  data_set = data.map(&:as_hash)
43
26
 
44
- contact.body = {
27
+ body = {
45
28
  run_env: Buildkite::TestCollector::CI.env,
46
29
  format: "json",
47
30
  data: data_set
48
31
  }.to_json
49
32
 
33
+ compressed_body = StringIO.new
34
+
35
+ writer = Zlib::GzipWriter.new(compressed_body)
36
+ writer.write(body)
37
+ writer.close
38
+
39
+ contact.body = compressed_body.string
40
+
50
41
  http.request(contact)
51
42
  end
52
43
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Buildkite
4
4
  module TestCollector
5
- VERSION = "2.1.0.pre"
5
+ VERSION = "2.2.0"
6
6
  NAME = "buildkite-test_collector"
7
7
  end
8
8
  end
@@ -8,13 +8,10 @@ end
8
8
  require "json"
9
9
  require "logger"
10
10
  require "net/http"
11
- require "openssl"
12
11
  require "time"
13
12
  require "timeout"
14
13
  require "tmpdir"
15
14
  require "securerandom"
16
- require "socket"
17
- require "websocket"
18
15
 
19
16
  require "active_support/core_ext/object/blank"
20
17
  require "active_support/core_ext/hash/indifferent_access"
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.1.0.pre
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Buildkite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-30 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.2'
27
- - !ruby/object:Gem::Dependency
28
- name: websocket
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '1.2'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '1.2'
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rspec-core
43
29
  requirement: !ruby/object:Gem::Requirement
@@ -123,9 +109,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
109
  version: 2.3.0
124
110
  required_rubygems_version: !ruby/object:Gem::Requirement
125
111
  requirements:
126
- - - ">"
112
+ - - ">="
127
113
  - !ruby/object:Gem::Version
128
- version: 1.3.1
114
+ version: '0'
129
115
  requirements: []
130
116
  rubygems_version: 3.1.6
131
117
  signing_key: