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

Quarkus CLI test are run even if --no-tests is specified #18391

Closed
tqvarnst opened this issue Jul 5, 2021 · 4 comments · Fixed by #18625
Closed

Quarkus CLI test are run even if --no-tests is specified #18391

tqvarnst opened this issue Jul 5, 2021 · 4 comments · Fixed by #18625
Assignees
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) kind/bug Something isn't working
Milestone

Comments

@tqvarnst
Copy link
Contributor

tqvarnst commented Jul 5, 2021

Describe the bug

When building using the CLI with command quarkus build --no-tests the tests are still executed.

Expected behavior

No tests should be run

Actual behavior

Tests are run

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:

  1. quarkus create app -a bug-reproducer
  2. cd bug-reproducer
  3. quarkus build --no-tests

Configuration

Screenshots

(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

Output of uname -a or ver

Darwin tqvarnst-mac 20.5.0 Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)

GraalVM version (if different from Java)

Quarkus version or git rev

2.0.0.Final

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

Quarkus CLI

> quarkus --version
Client Version 2.0.0.Final

Additional context

(Add any other context about the problem here.)

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

quarkus-bot bot commented Jul 5, 2021

/cc @ebullient, @gsmet, @maxandersen

@quarkus-bot quarkus-bot bot added the area/cli Related to quarkus cli (not maven/gradle/etc.) label Jul 5, 2021
@tqvarnst
Copy link
Contributor Author

tqvarnst commented Jul 6, 2021

Currently, the CLI is documented to default run the test and then the user can control it with --tests or --no-tests. However, the way that Piccoli works a boolean command line option works adding the option will flip the default value, which means that when you add --tests it actually set io.quarkus.cli.common.BuildOptions.runTest to false, and the negotiated flag --no-tests set it to true given the inverted behavior of what we want.

@ebullient What I suggest is that we change the command line option to --skip-tests, which would work just like it does for Maven. E.g. the default is that we run the test and only if you add --skip-tests it will actually skip running the tests. I know this is a change to the CLI, but as it is right now it doesn't work as intended and if we are to change the options it's better we do it now before users have started depending on this parameter. If we do this --skip-tests would not have a negotable option. WDYT?

I will prepare a PR with this behavior and we can discuss it there.

@ebullient
Copy link
Member

ebullient commented Jul 6, 2021

Currently, the CLI is documented to default run the test and then the user can control it with --tests or --no-tests. However, the way that Piccoli works a boolean command line option works adding the option will flip the default value, which means that when you add --tests it actually set io.quarkus.cli.common.BuildOptions.runTest to false, and the negotiated flag --no-tests set it to true given the inverted behavior of what we want.

@ebullient What I suggest is that we change the command line option to --skip-tests, which would work just like it does for Maven. E.g. the default is that we run the test and only if you add --skip-tests it will actually skip running the tests. I know this is a change to the CLI, but as it is right now it doesn't work as intended and if we are to change the options it's better we do it now before users have started depending on this parameter. If we do this --skip-tests would not have a negotable option. WDYT?

I will prepare a PR with this behavior and we can discuss it there.

i must not have tested this properly, but I know how the negation works, and the tests/no-tests is preferred.. probably need to adjust a little, but I do not want to move to skip.

@maxandersen
Copy link
Member

The default is just wrong then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Related to quarkus cli (not maven/gradle/etc.) kind/bug Something isn't working
Projects
None yet
4 participants