Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests not running inside docker container in 2.0.1 (DevServices kicking in when it should not?) #18569

Closed
Chexpir opened this issue Jul 9, 2021 · 2 comments · Fixed by #18582
Labels
area/devservices kind/bug Something isn't working
Milestone

Comments

@Chexpir
Copy link
Contributor

Chexpir commented Jul 9, 2021

Describe the bug

Our test inside docker container (with test DB in a different container) work on 2.0.0.Final they don´t work in 2.0.1.Final

I believe DevServices is jumping because of something: It does not pick up that we are really using a Database from another container. Not sure if it´s because we use profiles or what´s the reason.

I´ve tried to use quarkus.datasource.devservices.enabled=false to disable the behaviour, but it didn´t work. Same error hapenning.

Expected behavior

Tests to run

Actual behavior

In 2.0.1.Final, they don´t run inside docker.

To Reproduce

We are running our tests inside docker with

version: '2.1'
services:
  dbtest:
    image: "postgres:11.1"
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
    command: ["-c", "max_connections=500"]

  test:
    image: "12345678.dkr.ecr.eu-west-1.amazonaws.com/builders/ubuntu:v1.0.0_java11_enUS"
    environment:
      - GRADLE_USER_HOME=/gradle/cache
    volumes:
      - ./:/app/workdir
      - $HOME/.gradlecache/:/gradle/cache/
    depends_on:
      dbtest:
        condition: service_started
    command: ["./gradlew", "clean", "check", "-Dquarkus.test.profile=testdocker"]

and

Configuration

we have the following variables configured to point to that DB.

%testdocker.quarkus.datasource.db-kind=postgresql
%testdocker.quarkus.datasource.jdbc.url=jdbc:postgresql://dbtest/ourdbname?driver=org.postgresql.Driver

Screenshots

15:29:36  test_1    | > Task :compileTestJava
15:29:36  test_1    | warning: unknown enum constant Resolution.OPTIONAL
15:29:36  test_1    |   reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found
15:29:36  test_1    | warning: unknown enum constant Resolution.OPTIONAL
15:29:36  test_1    |   reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found
15:29:36  test_1    | warning: unknown enum constant Resolution.OPTIONAL
15:29:36  test_1    |   reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found
15:29:36  test_1    | warning: unknown enum constant Resolution.OPTIONAL
15:29:36  test_1    |   reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found
15:29:36  test_1    | warning: unknown enum constant Resolution.OPTIONAL
15:29:36  test_1    |   reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found
15:29:38  test_1    | 5 warnings
15:29:39  test_1    | 
15:29:39  test_1    | > Task :processTestResources
15:29:39  test_1    | > Task :testClasses
15:29:45  test_1    | No Docker binary found or general error: %s
15:29:45  test_1    | 
15:29:45  test_1    | > Task :test
15:29:45  test_1    | 
15:29:45  test_1    | OurTestResourceTest > ourTestName() FAILED
15:29:45  test_1    |     java.lang.RuntimeException at QuarkusTestExtension.java:699
15:29:45  test_1    |         Caused by: java.lang.RuntimeException at AugmentActionImpl.java:414
15:29:45  test_1    |             Caused by: io.quarkus.builder.BuildException at Execution.java:116
15:29:45  test_1    |                 Caused by: java.lang.IllegalStateException at DevServicesDatasourceProcessor.java:232
15:29:45  test_1    | 
15:29:45  test_1    | 88 tests completed, 1 failed, 83 skipped

Environment

Output of java -version

JDK11

GraalVM version (if different from Java)

Not used

Quarkus version or git rev

2.0.1.Final (not happening on 2.0.0Final)

Build tool (ie. output of mvnw --version or gradlew --version)

gradlew 6.8.3

@Chexpir Chexpir added the kind/bug Something isn't working label Jul 9, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 9, 2021

/cc @stuartwdouglas

@GregVes
Copy link

GregVes commented Jul 9, 2021

With the following maven command:

mvn clean package -Dquarkus.datasource.jdbc.url=jdbc:postgresql://db:5432/XXXXX -Dquarkus.package.type=uber-jar -Dsurefire.skipAfterFailureCount=1

Experiencing the same kind of issue:

io.quarkus.datasource.deployment.devservices.DevServicesDatasourceProcessor#launchDatabases threw an exception: java.lang.IllegalStateException: Please configure the datasource URL for the default datasource or ensure the Docker daemon is up and running.

It used to work until quarkus 2.0.0 included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devservices kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants