public async Task InitializeAsync() { if (options.Value.Enabled) { await _localStackContainer.StartAsync(); } }
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"); }
public async Task <IZeebeClient> SetupIntegrationTest() { container = CreateZeebeContainer(); await container.StartAsync(); client = CreateZeebeClient(); await AwaitBrokerReadiness(); return(client); }
public async Task OneTimeSetup() { _testcontainersBuilder = new TestcontainersBuilder <TestcontainersContainer>() .WithImage("postgres:12.2") .WithName("gto-infra-test") .WithPortBinding(5432) .WithEnvironment("POSTGRES_USER", PostgresUser) .WithEnvironment("POSTGRES_PASSWORD", PostgresPassword) .WithEnvironment("POSTGRES_DB", PostgresDb) .WithCleanUp(true) .WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(5432)); _postgres = _testcontainersBuilder.Build(); await _postgres.StartAsync(); }
public void StartLocalStackContainer() { var localStackBuilder = new TestcontainersBuilder <TestcontainersContainer>() .WithImage("localstack/localstack") .WithCleanUp(true) .WithEnvironment("DEFAULT_REGION", "ap-southeast-2") .WithEnvironment("SERVICES", "sqs") .WithEnvironment("DOCKER_HOST", "unix:///var/run/docker.sock") .WithEnvironment("DEBUG", "1") .WithPortBinding(4566, 4566); _localStackContainer = localStackBuilder.Build(); _localStackContainer.StartAsync(); }
public PostgreSQLFixture() { if (_container == null) { _container = BuildConsulContainer(); _container.StartAsync(); // Let's wait for the container startup. Task.Delay(20 * 1000).Wait(); } var dbContext = new DevicesContext(new DbContextOptionsBuilder().UseNpgsql(CONNECTION_STRING).Options); _dataProvider = new DataProvider(dbContext); }
public ElasticSearchInContainerFixture() { var testContainersBuilder = new TestcontainersBuilder <TestcontainersContainer>() .WithImage("elasticsearch:6.4.0") .WithName("elasticsearch-33333") .WithEnvironment("discovery.type", "single-node") .WithPortBinding(9200, 9200) .WithPortBinding(9300, 9300) .WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(9200)); testContainer = testContainersBuilder.Build(); testContainer.StartAsync().Wait(); InsertData(); }
public Infra() { // Configure Host IHostBuilder hostBuilder = Program.CreateHostBuilder(null !); hostBuilder.UseEnvironment("test") .ConfigureWebHost(builder => { builder.UseTestServer(); }); TestServerHost = hostBuilder.Build(); ServiceProvider = TestServerHost.Services; // Create external dependencies and run _dbTestContainer = BuildSqlServerTestContainer(ServiceProvider); Task dbRunTask = _dbTestContainer.StartAsync(); Task.WaitAll(dbRunTask); // Run Test Server TestServerHost.Start(); HttpClient = TestServerHost.GetTestClient(); }
public async Task InitializeAsync() { await _localStackContainer.StartAsync(); }
internal Task StartAsync() => _container.StartAsync();
public async Task StartAsync() { await _container.StartAsync(); }