Skip to content

Commit

Permalink
fix github-server?
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmacgowan committed Dec 18, 2024
1 parent fc3b09b commit f739423
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions spec/acceptance/github-server/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,22 @@
require "webrick/https"
require "openssl"

webrick_options = {
Host: "0.0.0.0",
Port: 443,
Logger: WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
SSLEnable: true,
SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE,
SSLCertificate: OpenSSL::X509::Certificate.new(File.read("/acceptance/github-server/ssl.crt")),
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read("/acceptance/github-server/ssl.key")),
SSLCertName: [["CN", "github.fake"]]
}

class FakeGitHubApi < Sinatra::Base
set :server, %w[webrick]
set :server_settings, {
Host: "0.0.0.0",
Port: 443,
Logger: WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
SSLEnable: true,
SSLVerifyClient: OpenSSL::SSL::VERIFY_NONE,
SSLCertificate: OpenSSL::X509::Certificate.new(File.read("/acceptance/github-server/ssl.crt")),
SSLPrivateKey: OpenSSL::PKey::RSA.new(File.read("/acceptance/github-server/ssl.key")),
SSLCertName: [["CN", "github.fake"]]
}

set :port => 443
set :bind => "0.0.0.0"

BASE_DIR = "/tmp/github"

TEAM_MAP_FILE = File.join(BASE_DIR, "team_map.json")
Expand Down Expand Up @@ -405,4 +409,4 @@ def graphql_pending_query(query)
end
end

Rack::Handler::WEBrick.run FakeGitHubApi, **webrick_options
FakeGitHubApi.run!

0 comments on commit f739423

Please sign in to comment.