Skip to content

Commit

Permalink
chore: Update LocalStack image from version 1.4 to 2.0 (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn authored Apr 4, 2023
1 parent 1bcc099 commit 6c1e815
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Testcontainers.LocalStack/LocalStackBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Testcontainers.LocalStack;
[PublicAPI]
public sealed class LocalStackBuilder : ContainerBuilder<LocalStackBuilder, LocalStackContainer, LocalStackConfiguration>
{
public const string LocalStackImage = "localstack/localstack:1.4";
public const string LocalStackImage = "localstack/localstack:2.0";

public const ushort LocalStackPort = 4566;

Expand Down
27 changes: 25 additions & 2 deletions tests/Testcontainers.LocalStack.Tests/LocalStackContainerTests.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
namespace Testcontainers.LocalStack;

public sealed class LocalStackContainerTest : IAsyncLifetime
public abstract class LocalStackContainerTest : IAsyncLifetime
{
private const string AwsService = "Service";

private readonly LocalStackContainer _localStackContainer = new LocalStackBuilder().Build();
private readonly LocalStackContainer _localStackContainer;

static LocalStackContainerTest()
{
Environment.SetEnvironmentVariable("AWS_ACCESS_KEY_ID", CommonCredentials.AwsAccessKey);
Environment.SetEnvironmentVariable("AWS_SECRET_ACCESS_KEY", CommonCredentials.AwsSecretKey);
}

private LocalStackContainerTest(LocalStackContainer localStackContainer)
{
_localStackContainer = localStackContainer;
}

public Task InitializeAsync()
{
return _localStackContainer.StartAsync();
Expand Down Expand Up @@ -142,4 +147,22 @@ public async Task CreateQueueReturnsHttpStatusCodeOk()
// Then
Assert.Equal(HttpStatusCode.OK, queueResponse.HttpStatusCode);
}

[UsedImplicitly]
public sealed class LocalStackDefaultConfiguration : LocalStackContainerTest
{
public LocalStackDefaultConfiguration()
: base(new LocalStackBuilder().Build())
{
}
}

[UsedImplicitly]
public sealed class LocalStackV1Configuration : LocalStackContainerTest
{
public LocalStackV1Configuration()
: base(new LocalStackBuilder().WithImage("localstack/localstack:1.4").Build())
{
}
}
}
1 change: 1 addition & 0 deletions tests/Testcontainers.LocalStack.Tests/Usings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
global using Amazon.SimpleNotificationService;
global using Amazon.SQS;
global using DotNet.Testcontainers.Commons;
global using JetBrains.Annotations;
global using Xunit;

0 comments on commit 6c1e815

Please sign in to comment.