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 <lewis.marshall@ably.com>
  • Loading branch information
lmars committed Aug 4, 2024
1 parent 092240b commit eb887f6
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/IO.Ably.Tests.Shared/AuthTests/AuthSandboxSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public async Task WithTokenId_WhenTryingToPublishToUnspecifiedChannel_ThrowsAbly

var token = ably.Auth.RequestTokenAsync(CreateTokenParams(capability)).Result;

var tokenAbly = new AblyRest(new ClientOptions { Token = token.Token, Environment = "sandbox" });
var tokenAbly = new AblyRest(new ClientOptions { Token = token.Token, Environment = "lmars-dev" });

var error =
await
Expand Down
8 changes: 4 additions & 4 deletions src/IO.Ably.Tests.Shared/ClientOptionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public void Options_WithCustomEnvironment()
{
var options = new ClientOptions
{
Environment = "sandbox"
Environment = "lmars-dev"
};
options.FullRealtimeHost().Should().Be("sandbox-realtime.ably.io");
options.FullRestHost().Should().Be("sandbox-rest.ably.io");
options.FullRealtimeHost().Should().Be("lmars-dev-realtime.ably.io");
options.FullRestHost().Should().Be("lmars-dev-rest.ably.io");
options.Port.Should().Be(80);
options.TlsPort.Should().Be(443);
Assert.Equal(Defaults.GetEnvironmentFallbackHosts("sandbox"), options.GetFallbackHosts());
Assert.Equal(Defaults.GetEnvironmentFallbackHosts("lmars-dev"), options.GetFallbackHosts());
options.Tls.Should().BeTrue();
}

Expand Down
12 changes: 6 additions & 6 deletions src/IO.Ably.Tests.Shared/DefaultTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public void Defaults_WithEnvironment_ReturnsEnvironmentFallbackHosts()
{
var expectedFallBackHosts = new[]
{
"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",
"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",
};
var fallbackHosts = Defaults.GetEnvironmentFallbackHosts("sandbox");
var fallbackHosts = Defaults.GetEnvironmentFallbackHosts("lmars-dev");
Assert.Equal(expectedFallBackHosts, fallbackHosts);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TestEnvironmentSettings

public bool Tls { get; set; }

public string Environment { get; set; } = "sandbox";
public string Environment { get; set; } = "lmars-dev";

public CipherParams CipherParams { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/IO.Ably.Tests.Shared/Infrastructure/AblySandboxFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AblySandboxFixture

public static async Task<TestEnvironmentSettings> GetSettings(string environment = null)
{
environment = environment ?? "sandbox";
environment = environment ?? "lmars-dev";
if (Settings.ContainsKey(environment))
{
return Settings[environment];
Expand All @@ -25,7 +25,7 @@ public static async Task<TestEnvironmentSettings> GetSettings(string environment
return Settings[environment];
}

private static async Task<TestEnvironmentSettings> Initialise(string environment = "sandbox")
private static async Task<TestEnvironmentSettings> Initialise(string environment = "lmars-dev")
{
var settings = new TestEnvironmentSettings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public async Task WithFallbackHostsUseDefault_ConnectionGoesStraightToFailedInst
[Trait("spec", "RTN17b")]
public async Task WithCustomEnvironmentAndError_ConnectionGoesStraightToFailedInsteadOfDisconnected()
{
var client = await GetConnectedClient(opts => opts.Environment = "sandbox");
var client = await GetConnectedClient(opts => opts.Environment = "lmars-dev");

client.FakeProtocolMessageReceived(new ProtocolMessage(ProtocolMessage.MessageAction.Error)
{
Expand Down
4 changes: 2 additions & 2 deletions src/IO.Ably.Tests.Shared/Rest/ChannelSandboxSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public async Task IdempotentPublishing_SimulateErrorAndRetry(Protocol protocol)
const int numberOfRetries = 2;
var client = await GetRestClient(protocol, opts =>
{
opts.FallbackHosts = new[] { "sandbox-rest.ably.io" };
opts.FallbackHosts = new[] { "lmars-dev-rest.ably.io" };
opts.IdempotentRestPublishing = true;
});

Expand Down Expand Up @@ -278,7 +278,7 @@ public async Task IdempotentPublishing_WithClientSpecificMessage_ShouldRetry(Pro
const int numberOfRetries = 2;
var client = await GetRestClient(protocol, opts =>
{
opts.FallbackHosts = new[] { "sandbox-rest.ably.io" };
opts.FallbackHosts = new[] { "lmars-dev-rest.ably.io" };
opts.IdempotentRestPublishing = true;
});

Expand Down
4 changes: 2 additions & 2 deletions src/IO.Ably.Tests.Shared/Rest/JwtSandboxSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public async Task Jwt_Request_ReturnType(Protocol protocol)

var authParams = new Dictionary<string, string>
{
["environment"] = "sandbox",
["environment"] = "lmars-dev",
["keyName"] = key,
["keySecret"] = secret,
["returnType"] = "jwt"
Expand Down Expand Up @@ -209,7 +209,7 @@ private async Task<string> GetJwtStringAsync(
query["capability"] = capability;
query["jwtType"] = jwtType;
query["encrypted"] = encrypted.ToString();
query["environment"] = "sandbox";
query["environment"] = "lmars-dev";
builder.Query = query.ToQueryString();

var jwtStr = await _httpClient.GetStringAsync(builder.Uri);
Expand Down
2 changes: 1 addition & 1 deletion src/IO.Ably.Tests.Shared/Rest/RestSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public async Task WithEnvironmentAndCustomHost_ShouldUseCustomHostAsIs()
{
var client = CreateClient(options =>
{
options.Environment = "sandbox";
options.Environment = "lmars-dev";
options.RestHost = "www.test.com";
});
await MakeAnyRequest(client);
Expand Down
2 changes: 1 addition & 1 deletion unity/Assets/Tests/AblySandbox/AblyCollectionFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class TestEnvironmentSettings

public bool Tls { get; set; }

public string Environment { get; set; } = "sandbox";
public string Environment { get; set; } = "lmars-dev";

public CipherParams CipherParams { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions unity/Assets/Tests/AblySandbox/AblySandboxFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public class AblySandboxFixture

public async Task<TestEnvironmentSettings> GetSettings(string environment = null)
{
environment = environment ?? "sandbox";
environment = environment ?? "lmars-dev";
if (_settings.ContainsKey(environment))
{
return _settings[environment];
}

_settings[environment] = await Initialise("sandbox");
_settings[environment] = await Initialise("lmars-dev");
return _settings[environment];
}

Expand Down
2 changes: 1 addition & 1 deletion unity/Assets/Tests/EditMode/AuthSandboxSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ public IEnumerator WithTokenId_WhenTryingToPublishToUnspecifiedChannel_ThrowsAbl
var token = ably.Auth.RequestTokenAsync(CreateTokenParams(capability), null).Result;
var tokenAbly = new AblyRest(new ClientOptions { Token = token.Token, Environment = "sandbox" });
var tokenAbly = new AblyRest(new ClientOptions { Token = token.Token, Environment = "lmars-dev" });
var error =
await E7Assert.ThrowsAsync<AblyException>(tokenAbly.Channels.Get("boo").PublishAsync("test", "true"));
Expand Down
2 changes: 1 addition & 1 deletion unity/Assets/Tests/PlayMode/AuthSandboxSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ public IEnumerator WithTokenId_WhenTryingToPublishToUnspecifiedChannel_ThrowsAbl
var token = ably.Auth.RequestTokenAsync(CreateTokenParams(capability), null).Result;
var tokenAbly = new AblyRest(new ClientOptions { Token = token.Token, Environment = "sandbox" });
var tokenAbly = new AblyRest(new ClientOptions { Token = token.Token, Environment = "lmars-dev" });
var error =
await E7Assert.ThrowsAsync<AblyException>(tokenAbly.Channels.Get("boo").PublishAsync("test", "true"));
Expand Down

0 comments on commit eb887f6

Please sign in to comment.