question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quarkus (Gradle) build should not run tests

See original GitHub issue

Description

While building the application I’ve noticed that ./gradlew build -Dquarkus.package.type=fast-jar will also run all the tests:

[x80486@uplink:~/Workshop/Development/kotlin-quarkus]$ ./gradlew build -Dquarkus.package.type=fast-jar 
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.8.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build 

> Task :quarkusGenerateCode
preparing quarkus application

> Task :compileKotlin
> Task :compileJava NO-SOURCE
> Task :processResources
> Task :classes
> Task :inspectClassesForKotlinIC
> Task :jar
> Task :startScripts
> Task :distTar
> Task :distZip

> Task :quarkusGenerateCodeTests
preparing quarkus application

> Task :compileTestKotlin
> Task :compileTestJava NO-SOURCE
> Task :processTestResources
> Task :testClasses
> Task :test

> Task :quarkusBuild
building quarkus jar

> Task :assemble
> Task :check
> Task :build

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 6s
13 actionable tasks: 13 executed

I think this should be avoided because that’s a different (usually time consuming) stage/task that’s triggered on a different phase.

Implementation Ideas

Make the Gradle (and/or Maven) plugin avoid check and/or test, somehow like this command: ./gradlew -Dquarkus.package.type=fast-jar build --exclude-task=check — that simple I guess 😓

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
gleflochcommented, Mar 4, 2021

Actually build is a default gradle task. If you only need the quarkus build, you can call the quarkusBuild task which does not depend on test.

0reactions
gleflochcommented, Mar 4, 2021

yes, I’m going to update the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building Quarkus apps with Gradle
This task will resolve all the runtime, build time, test and dev mode dependencies of the application to the Gradle cache. Once executed,...
Read more >
quarkus gradle test not executed - Stack Overflow
With maven the contained unittest is executed. Then I tried the proposed gradle build file, because we use gradle instead of maven. When...
Read more >
Unit tests in gradle not running · Issue #2307 - GitHub
I am trying to run the simple 'getting-started'-type gradle project with quarkus and my unit test fails everytime with this error.
Read more >
Building Quarkus apps with Gradle
By default, Quarkus tests in JVM mode are run using the test configuration profile. If you are not familiar with Quarkus configuration profiles,...
Read more >
Skipping Tests With Gradle - Baeldung
Although skipping tests is usually a bad idea, there are some situations where it might be useful, and it saves us some time....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found