Questions tagged [testcontainers]

TestContainers is a Java library that supports (JUnit) tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.

Define your test dependencies as code, then simply run your tests and containers will be created and then deleted.

https://www.testcontainers.org/

881 questions
4
votes
1 answer

Can't connect to a testcontainer Postgres instance

I've created a Postgres instance using testcontainers. The container starts but I cannot access it. I have tried connecting at the containerized DB using DBeaver. In the eclipse console everything seems fine: 01:29:34.662 [main] DEBUG…
Kiroshi
  • 43
  • 1
  • 1
  • 4
4
votes
0 answers

Using Test Containers with code in a Java module

I am trying to write a simple test using Java 11 and TestContainers. However, the compiler is giving following errors. The module-info.java looks like the following. module com.oif.reader { requires org.junit.jupiter.api; requires…
GTY
  • 417
  • 4
  • 15
4
votes
1 answer

Testing-containers and clickhouse-driver error:Unexpected EOF while reading bytes

I have these libraries installed: testcontainers==2.5 clickhouse-driver==0.1.0 This code: from testcontainers.core.generic import GenericContainer from clickhouse_driver import Client def test_docker_run_clickhouse(): ch_container =…
techkuz
  • 3,608
  • 5
  • 34
  • 62
4
votes
1 answer

How to use TestContainers + Spring Boot + oracle-xe

I try to use Test Containers with Oracle-XE module and Spring Boot and so far, when I launch my test, I am confronted to exception : Caused by: java.lang.IllegalArgumentException: JDBC URL matches jdbc:tc: prefix but the database or tag name could…
L. CWI
  • 952
  • 9
  • 15
4
votes
0 answers

How store container logs from test-containers?

Test-containers project alllows start docker contaniders from compose file. They have integration with JUnit. But when test phase is finished, all I have is maven log - all started containers were removed by that time. It would be nice if6 for…
Cherry
  • 31,309
  • 66
  • 224
  • 364
4
votes
0 answers

How to set mysql global variables running on Docker instance started by TestContainers

I am currently running a Java Spring application using TestContainers to manage my datasources. I am having issues setting global variables for my MySQL instance on Docker during initialization of the docker instance. I've tried a few…
sv0341
  • 41
  • 1
4
votes
1 answer

Ordered starting and waiting for containers

I have two containers in my tests using @Testcontainers with Junit5, a Kafka and a KafkaConnect. @Container private final KafkaContainer kafka = new KafkaContainer() .withNetwork(network) …
kiuby_88
  • 334
  • 1
  • 6
  • 18
4
votes
2 answers

Unable to find the path PostgreSQLContainer testContainers

I am unable to find my resource map when using Test Containers, in Postgres version. I am trying something like it: private static PostgreSQLContainer postgresqlContainer = new PostgreSQLContainer("postgres") …
Julia Bel
  • 337
  • 4
  • 18
4
votes
2 answers

Spring Cloud: testing S3 client with TestContainters

I use Spring Cloud's ResourceLoader to access S3, e.g.: public class S3DownUpLoader { private final ResourceLoader resourceLoader; @Autowired public S3DownUpLoader(ResourceLoader resourceLoader) { this.resourceLoader = resourceLoader; } public…
Fedor
  • 559
  • 1
  • 7
  • 19
4
votes
1 answer

Testcontainers with a company proxy

Each start of different testcontainers will throw com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"Get https://quay.io/v1/_ping: dial tcp x.x.x.x: getsockopt: connection refused"} This is no surprise (docker is behind a…
ner0
  • 95
  • 3
  • 11
4
votes
0 answers

GenericContainer of SpringBoot Application: Timed out waiting for container port to open

I would test a spring boot application with TestContainers but i don't understand the right way. This is my controller: @RestController @RequestMapping(value = "snip") public class Controller { @RequestMapping(method = RequestMethod.GET, path…
3
votes
0 answers

testcontainers ComposeContainer missing in Maven Central?

On Github I find ComposeContainer in https://github.com/testcontainers/testcontainers-java/tree/main/core/src/main/java/org/testcontainers/containers, i.e. the containers subdirectory. When searching on Maven Central, (i.e.…
3
votes
2 answers

gradle build error: The org.gradle.util.GFileUtils type has been deprecated when building Kotlin Spring WebFlux code

Was following along with Spring + Kotlin = Modern + Reactive + Productive presentation on YouTube! by creating a Kotlin-based Spring Web Flux Reactive app using https://start.spring.io/... Generated the project using these dependencies (please note…
PacificNW_Lover
  • 4,746
  • 31
  • 90
  • 144
3
votes
1 answer

How to setup dotnet Testcontainers with a SQL Server database for Integration Tests?

I have an API REST .NET 7 and I want to build integrations tests using a sql server container database. I've tried to follow the example in the documentation (https://dotnet.testcontainers.org/examples/aspnet/): const string weatherForecastStorage =…
3
votes
1 answer

Disable RYUK (Testcontainers for Go)

I'm using bitbucket pipelines to run my Go project tests that use Testcontainers. Pipelines fail with message: Error response from daemon: authorization denied by plugin pipelines: --mounts is not allowed: creating reaper failed: failed to create…