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

Test fails when run without docker or podman, even if -Dstart-containers is not set #25108

Closed
holly-cummins opened this issue Apr 22, 2022 · 1 comment · Fixed by #25170
Closed
Labels
kind/bug Something isn't working
Milestone

Comments

@holly-cummins
Copy link
Contributor

Describe the bug

It looks like a -Dstart-containers guard is missing on NativeImageBuildContainerRunnerTest in quarkus/core/deployment. It's necessary to install Docker or Podman for the test to pass, even without -Dstart-containers; otherwise the test fails and breaks the build. This isn't consistent with CONTRIBUTING.md:

Docker is not strictly necessary: it is used to run the MariaDB and PostgreSQL tests which are not enabled by default.

It may be that containers are now required for too much of the core function, and maybe we should decide to make a container runtime a requirement. If we do, we should be intentional and update the documentation.

Expected behavior

Docker shouldn't be necessary for a normal build with the default set of tests to run cleanly.

Actual behavior

The build fails:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:28 min
[INFO] Finished at: 2022-04-22T16:51:47+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project quarkus-core-deployment: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/holly/Code/quarkus/main/quarkus/core/deployment/target/surefire-reports for the individual test results.

The failure is:

-------------------------------------------------------------------------------
Test set: io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunnerTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 s <<< FAILURE! - in io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunnerTest
io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunnerTest.testBuilderImageBeingPickedUp  Time elapsed: 0.007 s  <<< ERROR!
java.lang.IllegalStateException: No container runtime was found to. Make sure you have Docker or Podman installed in your environment.
	at io.quarkus.runtime.util.ContainerRuntimeUtil.detectContainerRuntime(ContainerRuntimeUtil.java:38)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner.<init>(NativeImageBuildContainerRunner.java:32)
	at io.quarkus.deployment.pkg.steps.NativeImageBuildLocalContainerRunner.<init>(NativeImageBuildLocalContainerRunner.java:20)
	at io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunnerTest.testBuilderImageBeingPickedUp(NativeImageBuildContainerRunnerTest.java:24)
	at java.base/

How to Reproduce?

  1. Uninstall docker and podman (or start on a fresh machine image)
  2. ./mvnw -Dquickly -DskipTests=false

Output of uname -a or ver

Darwin hcummins-mac 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64

Output of java -version

openjdk version "18" 2022-03-22 OpenJDK Runtime Environment Temurin-18+36 (build 18+36) OpenJDK 64-Bit Server VM Temurin-18+36 (build 18+36, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

commit 3ec92db (HEAD -> main, origin/main, origin/HEAD)

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

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: /Users/holly/.m2/wrapper/dists/apache-maven-3.8.4-bin/52ccbt68d252mdldqsfsn03jlf/apache-maven-3.8.4 Java version: 18, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "12.3.1", arch: "aarch64", family: "mac"

Additional information

No response

@holly-cummins
Copy link
Contributor Author

I've raised #25170. While we're making the longer term strategic decision about whether to hard-prereq docker, our tests can run clean.

@quarkus-bot quarkus-bot bot added this to the 2.10 - main milestone Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
1 participant