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

Using QuarkusTest and QuarkusMainTest in the same package breaks in 2.13.* #28486

Closed
ebullient opened this issue Oct 10, 2022 · 2 comments · Fixed by #28499
Closed

Using QuarkusTest and QuarkusMainTest in the same package breaks in 2.13.* #28486

ebullient opened this issue Oct 10, 2022 · 2 comments · Fixed by #28499
Assignees
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@ebullient
Copy link
Member

ebullient commented Oct 10, 2022

Describe the bug

Dependabot update from 2.12.3.Final to 2.13.0.Final failed in one of my projects with an error about using QuarkusTest and QuarkusMainTest "in the same run".

This behavior change was introduced in #27247

Agreed this should be doable in zulip thread: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/QuarkusTest.20and.20QuarkusMainTest/near/303196430, perhaps by treating these two types as different profiles so things are cleaned up around them.

Note that putting the two types of tests in different packages avoided this check, so I think some implied scoping is happening (which suggests "in the same run" phrasing would be a minimal improvement, if we decide the profile-esque behavior won't work).

Expected behavior

QuarkusTest and QuarkusMainTest should not be mutually exclusive, especially not "in the same run."

Actual behavior

https://github.com/ebullient/fc5-convert-cli/actions/runs/3175704762

Error:  Errors: 
Error:    Import5eToolsConvertTest.testCommandHelp(LaunchResult) » IllegalState Cannot mix both @QuarkusMainTest based tests and io.quarkus.test.junit.QuarkusTest based tests in the same run
Error:    Import5eToolsConvertTest.testIndexXmlData(TestInfo,QuarkusMainLauncher) » IllegalState Cannot mix both @QuarkusMainTest based tests and io.quarkus.test.junit.QuarkusTest based tests in the same run
Error:    Import5eToolsConvertTest.testMarkdownBook(TestInfo,QuarkusMainLauncher) » IllegalState Cannot mix both @QuarkusMainTest based tests and io.quarkus.test.junit.QuarkusTest based tests in the same run
Error:    Import5eToolsConvertTest.testMarkdownData(TestInfo,QuarkusMainLauncher) » IllegalState Cannot mix both @QuarkusMainTest based tests and io.quarkus.test.junit.QuarkusTest based tests in the same run

How to Reproduce?

Check out commit c0175664809447d6354a3b5e1528b08736f42466 of https://github.com/ebullient/fc5-convert-cli, and update to 2.13.(whatever is latest).

What "fixed" the broken project: ensuring that @QuarkusTest and @QuarkusMainTest weren't both used by classes in the same package (does that count as "in the same run"?)

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

I have two (similar) CLI repos:

https://github.com/ebullient/json5e-convert-cli
https://github.com/ebullient/fc5-convert-cli

The latter failed moving up to 2.13 while the former did not. It was luck that I spotted the test package difference.

@ebullient ebullient added the kind/bug Something isn't working label Oct 10, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 10, 2022

You added a link to a Zulip discussion, please make sure the description of the issue is comprehensive and doesn't require accessing Zulip.

This message is automatically generated by a bot.

@geoand geoand self-assigned this Oct 11, 2022
geoand added a commit to geoand/quarkus that referenced this issue Oct 11, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
@geoand
Copy link
Contributor

geoand commented Oct 11, 2022

#28499 should take care of the issue

geoand added a commit to geoand/quarkus that referenced this issue Oct 11, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
geoand added a commit that referenced this issue Oct 12, 2022
Properly allow mixing @QuarkusTest and @QuarkusMainTest
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Oct 12, 2022
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 16, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
igorregis pushed a commit to igorregis/quarkus that referenced this issue Oct 17, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
@gsmet gsmet modified the milestones: 2.14.0.CR1, 2.13.6.Final Dec 14, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Dec 14, 2022
This is done by "restarting" the application when one
test type follows the other.

Fixes: quarkusio#28486
(cherry picked from commit f997c67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants