public async Task InitializeAsync()
        {
            await _testContainer.StartAsync();

            var result = await _testContainer.ExecAsync(new[]
            {
                "/bin/sh", "-c",
                "psql -U aspnetidentity -c \"CREATE EXTENSION plv8; SELECT extversion FROM pg_extensions WHERE extname = 'plv8';\""
            });
        }
Ejemplo n.º 2
0
        public async Task InitializeAsync()
        {
            await _testContainer.StartAsync();

            // https://github.com/clkao/docker-postgres-plv8
            // this way you can enable plv8 for the fancy features of marten 🤩
            var result = await _testContainer.ExecAsync(new[]
            {
                "/bin/sh", "-c",
                "psql -U postgres -c \"CREATE EXTENSION plv8; SELECT extversion FROM pg_extension WHERE extname = 'plv8';\""
            });
        }
        public async Task InitializeAsync()
        {
            _postgresContainer = new TestcontainersBuilder <PostgreSqlTestcontainer>()
                                 .WithDatabase(new PostgreSqlTestcontainerConfiguration("postgres:latest")
            {
                Database = "postgres",
                Username = "******",
                Password = "******",
            }).Build();

            await _postgresContainer.StartAsync();

            _dbContext = AppDbContextFactory.CreateDbContext(_postgresContainer.ConnectionString);
            await _dbContext.Database.MigrateAsync();

            _service = new BuildService(new NullLogger <BuildService>(), _dbContext, TestUtils.Tags.Value);
        }
Ejemplo n.º 4
0
        public async Task InitializeAsync()
        {
            //for the moment, use this testcontainer for dotnet https://github.com/HofmeisterAn/dotnet-testcontainers
            ITestcontainersBuilder <PostgreSqlTestcontainer> postgresBuilder =
                new TestcontainersBuilder <PostgreSqlTestcontainer>()
                .WithDatabase(new PostgreSqlTestcontainerConfiguration("postgres:11.5")
            {
                Database = "db",
                Username = "******",
                Password = "******",
            })
                .WithExposedPort(5432);

            _postgres = postgresBuilder.Build();
            await _postgres.StartAsync();

            _connection = new NpgsqlConnection(_postgres.ConnectionString);
            await _connection.OpenAsync();
        }
Ejemplo n.º 5
0
        public async Task InitializeAsync()
        {
            await _container.StartAsync();

            ConnectionString = _container.ConnectionString;
        }
Ejemplo n.º 6
0
        public async Task InitializeAsync()
        {
            await _postgreSqlTestcontainer.StartAsync();

            await GMapsServicesContext.Database.EnsureCreatedAsync();
        }