Skip to content

Add possibility to skip container initialization without exception, when Docker not available #2833

@alfrepo

Description

@alfrepo

Hello!

My setup

  • In my Integration Tests we use testcontainers to provide services to the tests. (LDAP, Databases etc.)
  • On the CI runners docker is available on the host.
  • In my developer environment - there is no Docker available on the host. (Only in my developer-Vagrant-VM, not visible to test containers)

Problem statement

I am seeking for a possibility
During the development to disable testcontainers, but not the test, if docker is not available.
I would take care of providing the services, usually running in containers
Disabling the testcontainers should happen, depending on the settings in the environment, like ENV variable.
Because right now the only solution I dound is - to comment the @container statements, what gets checked in all the time.

Proposal of a solution

I suggest to introduce a flag at the @org.testcontainers.junit.jupiter.TestContainers annotation:
skipContainersWithoutDocker=true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions