Skip to content

Commit

Permalink
Remove thin from BOSH Director integration specs
Browse files Browse the repository at this point in the history
The Director already uses Puma in production mode, but was still using
Thin for a local file server in the integration specs. This converts
that test server to Puma as well.

Additionally, the bosh-nats-sync gem declared a dependency on Thin that
it never used.

Signed-off-by: Aram Price <pricear@vmware.com>
  • Loading branch information
ystros authored and aramprice committed Feb 16, 2024
1 parent 20f4c1f commit a7eddab
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ PATH
sinatra (~> 2.2.0)
sys-filesystem (~> 1.4.1)
talentbox-delayed_job_sequel (~> 4.3)
thin
tzinfo-data
unix-crypt (~> 1.3.0)

Expand Down Expand Up @@ -97,7 +96,6 @@ PATH
openssl (>= 3.2.0)
rest-client
sinatra (~> 2.2.0)
thin

PATH
remote: bosh-template
Expand Down
1 change: 0 additions & 1 deletion src/bosh-director/bosh-director.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'sinatra', '~>2.2.0'
spec.add_dependency 'sys-filesystem', '~>1.4.1'
spec.add_dependency 'talentbox-delayed_job_sequel', '~>4.3'
spec.add_dependency 'thin'
spec.add_dependency 'tzinfo-data'
spec.add_dependency 'unix-crypt', '~>1.3.0'
end
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def requires_authentication?
true
end

after { headers('Date' => Time.now.rfc822) } # As thin doesn't inject date
after { headers('Date' => Time.now.rfc822) } # As puma doesn't inject date

configure do
set(:show_exceptions, false)
Expand Down
1 change: 0 additions & 1 deletion src/bosh-nats-sync/bosh-nats-sync.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'em-http-request'
spec.add_dependency 'nats-pure'
spec.add_dependency 'openssl', '>=3.2.0'
spec.add_dependency 'thin'
spec.add_dependency 'sinatra', '~>2.2.0'
spec.add_dependency 'rest-client'
end
12 changes: 10 additions & 2 deletions src/spec/support/local_file_server.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
require 'bosh/dev/sandbox/service'
require 'bosh/dev/sandbox/socket_connector'
require 'puma'
require 'puma/configuration'

module Bosh::Spec
class LocalFileServer
def initialize(directory, port, logger)
@port = port
@logger = logger

builder = Rack::Builder.new do
builder = ::Puma::Rack::Builder.app do
use Rack::CommonLogger
use Rack::ShowExceptions
run Rack::Directory.new(directory)
Expand All @@ -19,7 +21,13 @@ def initialize(directory, port, logger)

@server_thread = Thread.new do
begin
Rack::Handler::Thin.run builder, :Port => port
puma_configuration = ::Puma::Configuration.new do |user_config|
user_config.tag 'local-file-server'
user_config.bind "tcp://localhost:#{port}"
user_config.app builder
end
puma_launcher = ::Puma::Launcher.new(puma_configuration)
puma_launcher.run
rescue Interrupt
# that's ok, the spec is done with us...
end
Expand Down

0 comments on commit a7eddab

Please sign in to comment.