public async Task DisposeAsync()
 {
     if (options.Value.Enabled)
     {
         await _localStackContainer.StopAsync();
     }
 }
Ejemplo n.º 2
0
        private static async Task Main(string[] args)
        {
            Console.WriteLine("Press any key to start LocalStack container");
            Console.ReadLine();

            ITestcontainersBuilder <TestcontainersContainer> localStackBuilder = new TestcontainersBuilder <TestcontainersContainer>()
                                                                                 .WithName("LocalStack-0.12.10")
                                                                                 .WithImage("localstack/localstack:0.12.10")
                                                                                 .WithCleanUp(true)
                                                                                 .WithEnvironment("DEFAULT_REGION", "eu-central-1")
                                                                                 .WithEnvironment("SERVICES", "iam,lambda,dynamodb,apigateway,s3,sns,cloudformation,cloudwatch,sts")
                                                                                 .WithEnvironment("DOCKER_HOST", "unix:///var/run/docker.sock")
                                                                                 .WithEnvironment("LS_LOG", "info")
                                                                                 .WithPortBinding(4566, 4566);

            TestcontainersContainer container = localStackBuilder.Build();

            Console.WriteLine("Starting LocalStack Container");
            await container.StartAsync();

            Console.WriteLine("LocalStack Container started");

            Console.WriteLine("Press any key to stop LocalStack container");
            Console.ReadLine();

            Console.WriteLine("Stopping LocalStack Container");
            await container.StopAsync();

            Console.WriteLine("LocalStack Container stopped");
        }
Ejemplo n.º 3
0
        public async Task TearDownIntegrationTest()
        {
            client.Dispose();
            client = null;
            await container.StopAsync();

            container = null;
        }
 public async Task DisposeAsync()
 {
     await _localStackContainer.StopAsync();
 }
Ejemplo n.º 5
0
 public void RunAfterAnyTests()
 {
     _localStackContainer?.StopAsync();
 }