Skip to content

Commit

Permalink
Merge pull request #181 from buildkite/pie-1576/remove-websocket-depe…
Browse files Browse the repository at this point in the history
…ndancy

Remove remaning "websocket" references
  • Loading branch information
niceking authored Apr 4, 2023
2 parents 653a668 + 5aea53f commit 7bb612c
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 35 deletions.
12 changes: 1 addition & 11 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@

## Threads

The Buildkite ruby collector uses websockets and ActionCable to send and
receive data with Buildkite. Execution information starts transmitting as soon
as possible, without waiting for the test suite to finish running.

This gem uses 3 ruby threads:

* main thread: acts as the producer. It collects span data from the
test suite and enqueues it into the send queue.
* write thread: acts as the consumer. Removes data from the send queue and
sends it to Buildkite.
* read thread: receives and processes messages from Buildkite.
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.

## Data

Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ PATH
specs:
buildkite-test_collector (2.1.0.pre)
activesupport (>= 4.2)
websocket (~> 1.2)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -34,7 +33,6 @@ GEM
rspec-support (3.10.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
websocket (1.2.9)

PLATFORMS
ruby
Expand Down
1 change: 0 additions & 1 deletion buildkite-test_collector.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")

spec.add_dependency "activesupport", ">= 4.2"
spec.add_dependency "websocket", '~> 1.2'

spec.add_development_dependency "rspec-core", '~> 3.10'
spec.add_development_dependency "rspec-expectations", '~> 3.10'
Expand Down
3 changes: 0 additions & 3 deletions lib/buildkite/test_collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@ module TestCollector
require "json"
require "logger"
require "net/http"
require "openssl"
require "time"
require "timeout"
require "tmpdir"
require "securerandom"
require "socket"
require "websocket"

require "active_support/core_ext/object/blank"
require "active_support/core_ext/hash/indifferent_access"
Expand Down
18 changes: 0 additions & 18 deletions lib/buildkite/test_collector/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ def initialize(url)
@authorization_header = "Token token=\"#{Buildkite::TestCollector.api_token}\""
end

def post
contact_uri = URI.parse(url)

http = Net::HTTP.new(contact_uri.host, contact_uri.port)
http.use_ssl = contact_uri.scheme == "https"

contact = Net::HTTP::Post.new(contact_uri.path, {
"Authorization" => authorization_header,
"Content-Type" => "application/json",
})
contact.body = {
run_env: Buildkite::TestCollector::CI.env,
format: "websocket"
}.to_json

http.request(contact)
end

def post_json(data)
contact_uri = URI.parse(url)

Expand Down

0 comments on commit 7bb612c

Please sign in to comment.