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
0
votes
1 answer

Testing docker image. Easy start with exec and get log

I create small app for my CI. This app very easy, it print to console property, which i set as option, and exit. I can execute it in my cmd(i use windows), like this: docker run --rm myImage:latest say --param "hello world" and i see in cmd "hello…
Tim
  • 155
  • 1
  • 3
  • 13
0
votes
0 answers

Run testcontainer test OK in local environment but failed in jenkins

Background In my application, it needs to connect to zookeeper to get some useful information. So I start a zookeeper container in my integration test with port binding like -p 2859:2181. zookeeper = new…
lsongseven
  • 21
  • 5
0
votes
2 answers

Start MongoDb Test Container with credentials

I am able to start the mongo image, insert and read data just fine using the snippet below. Similar to the redis example on testcontainers.org. private static final int MONGO_PORT = 27017; @ClassRule public static MongoDBContainer mongo = new…
aemorales1
  • 312
  • 3
  • 13
0
votes
1 answer

Why Docker container is silently removed on start

I am trying to run Integration test written in Java using testcontainers library. OS: macOS Catalina 10.15.6 Docker Engine: 19.03.13 Docker Desktop: 2.4.0.0 Testcontainers version: 1.14.3 Java: 8 This library runs Ryuk Docker container responsible…
0
votes
0 answers

Oracle Test Container is throwing "IO Error: Got minus one from a read call"

I am getting an exception while connection to oracle 12c which is on oracle test container docker. Oracle 12c docker image is available here. Here is my code: OracleContainer oracleContainer = new…
unknown
  • 4,859
  • 10
  • 44
  • 62
0
votes
1 answer

Testcontainers Quickstart Example does not work?

I'm trying the Junit 5 Testcontainers Quickstart Example: https://www.testcontainers.org/quickstart/junit_5_quickstart/ I use version 5.6.1 for jupiter and version 1.14.3 for testcontainers. org.junit.jupiter
jschnasse
  • 8,526
  • 6
  • 32
  • 72
0
votes
0 answers

Why doesn't Gitlab CI want to run a container

I have a Spring Boot Application (2.0.0) I try to execute my tests with testcontainers: Locally : this work as excepted In Gitlab-Ci : throw me a TimeoutException, I assume is because my runner doesn't have permissions or something like that. I…
0
votes
2 answers

How to reuse TestContainer ? (Junit 4)

Hello everyone :) i have 3 questions : How Reuse TestContainer with Junit 4 ? How i can verify the amount of containers use during my test ? By default a new container started foreach @Test or for whole class ? Thank you in advance for your…
0
votes
2 answers

Creating a network which allows communication between containers but no internet access

How can I create a docker network using testcontainers which: allows for all containers in the network to communicate with each allows for containers to map ports to the host but does not allow containers to have access to the internet I have…
vab2048
  • 1,065
  • 8
  • 21
0
votes
1 answer

Run testcontainers in Bitbucket

I am adding Testcontainers to my integration tests. Locally everything works fine. To let it run on my Bitbucket Pipelines, I created following (simplified) bitbucket-pipeline.yml: image: maven:3.6.1 pipelines: default: - step: caches: …
Jacob van Lingen
  • 8,989
  • 7
  • 48
  • 78
0
votes
1 answer

Kafka testcontainer not running

I am trying to setup an integration test env for debezium integration (following the instructions in this example) but the test container (default image: confluentinc/cp-kafka:5.2.1) doesn't start but throws an exception. I am using below mentioned…
S. Arora
  • 11
  • 5
0
votes
0 answers

How to use Testcontainers' Dynalite module in JUnit 5 tests and SpringBoot 2.3.1

I can't figure out how to use Testcontainers' Dynalite module in a JUnit 5 test to be able to test Amazon DynamoDB, - documentation is really too succinct and minimalist. So I added the following dependencies in pom.xml:
belgoros
  • 3,590
  • 7
  • 38
  • 76
0
votes
1 answer

Forking a JVM process per feature file?

I have a number of feature files in my cucumber scenario test suite. I run the tests by launching Cucumber using the CLI. These are the steps which occur when the test process is running: We create a static instance of a class which manages the…
0
votes
1 answer

Better way to set testcontainer properties from default applicaton.yml in springboottest

I am using posgresql testcontainer in springboottest. As I have multiple tests involving this testcontainer, hence I have used static testcontainer which will be invoked once for all tests of 1 junit class and shutdown after all tests are…
user2800089
  • 2,015
  • 6
  • 26
  • 47
0
votes
1 answer

How to run a custom docker image testContainer

I have gone thru' multiple blogs and official documentation but couldn't resolve my issue. I am using testContainers-scala version 0.38.1 and scala version 2.11. I am trying to create a simple test using testContainer-scala as below: class…
Karttik Mishra
  • 150
  • 2
  • 14