Skip to content

Commit

Permalink
WIP test against the lmars-dev cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Lewis Marshall <[email protected]>
  • Loading branch information
lmars committed Jul 5, 2024
1 parent cb684b4 commit e2a41a4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion spec/acceptance/realtime/connection_failures_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ def kill_connection_transport_and_prevent_valid_resume
end

context 'with non-production environment' do
let(:environment) { 'sandbox' }
let(:environment) { 'lmars-dev' }
let(:expected_host) { "#{environment}-#{Ably::Realtime::Client::DOMAIN}" }
let(:client_options) { timeout_options.merge(environment: environment) }

Expand Down
8 changes: 4 additions & 4 deletions spec/acceptance/rest/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def encode64(text)

context 'when environment is NOT production (#RSC15b)' do
context 'and custom fallback hosts are empty' do
let(:client_options) { default_options.merge(environment: 'sandbox', key: api_key, fallback_hosts: []) }
let(:client_options) { default_options.merge(environment: 'lmars-dev', key: api_key, fallback_hosts: []) }
let!(:default_host_request_stub) do
stub_request(:post, "https://#{environment}-#{Ably::Rest::Client::DOMAIN}#{path}").to_return do
raise Faraday::TimeoutError.new('timeout error message')
Expand All @@ -325,14 +325,14 @@ def encode64(text)
end

context 'and no custom fallback hosts are provided' do
let(:client_options) { default_options.merge(environment: 'sandbox', key: api_key) }
let(:client_options) { default_options.merge(environment: 'lmars-dev', key: api_key) }

it 'should make connection attempts to sandbox-a-fallback.ably-realtime.com, sandbox-b-fallback.ably-realtime.com, sandbox-c-fallback.ably-realtime.com, sandbox-d-fallback.ably-realtime.com, sandbox-e-fallback.ably-realtime.com (#RSC15a)' do
it 'should make connection attempts to lmars-dev-a-fallback.ably-realtime.com, lmars-dev-b-fallback.ably-realtime.com, lmars-dev-c-fallback.ably-realtime.com, lmars-dev-d-fallback.ably-realtime.com, lmars-dev-e-fallback.ably-realtime.com (#RSC15a)' do
hosts = []
5.times do
hosts << client.fallback_connection.host
end
expect(hosts).to match_array(%w(a b c d e).map { |id| "sandbox-#{id}-fallback.ably-realtime.com" })
expect(hosts).to match_array(%w(a b c d e).map { |id| "lmars-dev-#{id}-fallback.ably-realtime.com" })
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rspec_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
key_name: 'app_id.key_name',
key_secret: 'secret',
api_key: 'app_id.key_name:secret',
environment: 'sandbox'
environment: 'lmars-dev'
))
WebMock.enable!
end
Expand Down
4 changes: 2 additions & 2 deletions spec/shared/client_initializer_behaviour.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ def rest?
end

context 'with environment option' do
let(:client_options) { default_options.merge(environment: 'sandbox', auto_connect: false) }
let(:client_options) { default_options.merge(environment: 'lmars-dev', auto_connect: false) }

it 'uses an alternate endpoint' do
expect(subject.endpoint.to_s).to eql("#{protocol}s://sandbox-#{subdomain}.ably.io")
expect(subject.endpoint.to_s).to eql("#{protocol}s://lmars-dev-#{subdomain}.ably.io")
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/support/test_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def delete
end

def environment
ENV['ABLY_ENV'] || 'sandbox'
ENV['ABLY_ENV'] || 'lmars-dev'
end

def create_test_app
Expand Down

0 comments on commit e2a41a4

Please sign in to comment.