-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Dev mode gets incorrect classpath for (some) test-scoped extension dependencies #30317
Comments
/cc @evanchooly(kotlin), @geoand(kotlin) |
cc @aloubyansky |
Status update on this: #30383 fixed the issue, but @aloubyansky would like to add tests, so we are keeping this issue open. |
I think the following problem is related (if not, please let me know and I will open a separate issue): The repository for Red Hat's "The Containers and Cloud-Native Roadshow Dev Track - Module 4" uses a H2 DB for the It includes the corresponding H2 extension/dependency in As a result, Since the H2 DB is only needed for testing purposes, the dependency should use
I wonder what is the recommended way to include dependencies only needed for |
Hmm, the recommended way is to use the maven One slight-workaround you can do is set scope |
Hi @holly-cummins, thx for your feedback. 🙏 Unfortunately, the problem seems to persist with the newest (3.2.2.Final) Quarkus version. I have created a reproducer based on the default app ( beatngu13/code-with-quarkus@a241758 The build launches the dev mode via |
Oh, how sad! Thanks for checking on the latest version, and for the reproducer. |
Looking at your reproducer, @beatngu13, it doesn't look (to me) like it should work. If H2 is used by the main application code, the scope can't be I think it's perhaps a similar use case to what we were discussing in https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/JPA.20and.20Panache.20with.20multiple.20datasources/near/378423815. What's the reason to use H2 in dev mode, rather than just using a postgres dev service? The dev service would be less effort, and give you more realism. Is it to avoid using containers? |
@holly-cummins there is no particular reason, we – who are new to the Quarkiverse – are just trying to understand the roadshow codebase. As you already said, the Quarkus documentation also states:
I suspect the roadshow example, using H2 for So, my conclusion would be: if you are using H2 and the like (for whatever reason), only do it "to run simple integration tests"? |
I agree, @beatngu13, it seems like the roadshow app you're using isn't showing Quarkus best practices. Can you point me to where you got it from? I'll raise an issue there (we should try and move the discussion off this issue, since it's something else). I've had a look at your reproducer but I can't work out the original URL from that. |
Unfortunately, I don't remember the exact course title. But maybe I can summon @karstengresch, who helped us during that (and other) course(s). Karsten, do you recall to which of the courses we did the repository for Red Hat's "The Containers and Cloud-Native Roadshow Dev Track - Module 4" belongs? |
I've asked around, and the reason the workshop uses H2 is because containers can't be run in the Cloud IDE being used. There actually is an in-memory H2 dev service, so the workshop could be switched to use that ... but it doesn't resolve the scope/packaging issue. #34021 (sort of) covers the ability to specify an extension should only be included in some launch modes, so it's probably worth moving this discussion over to that work item. |
Describe the bug
See quarkiverse/quarkus-pact#28, which has a reproducer. An alternate reproducer is https://github.com/holly-cummins/quarkus-pact/tree/test-test-and-dev-modes (just re-enable the
@Disable
d tests).#30238 fixes the issue for test mode, but the dev mode fix is more complex.
Expected behavior
Test behaviour in dev mode should be the same as normal mode.
Actual behavior
Dependencies need to be scoped with
provided
,runtime
, orcompile
to be correctly resolved. This isn't true for all dependencies, but I haven't isolated exactly what the defining characteristic is (beyond providing a reproducer :) ) - it's perhaps that the dependency is an extension, or that the problematic dependencies involve kotlin, or that they're using the JUnit libraries so are in a different classloader.How to Reproduce?
quarkiverse/quarkus-pact#28, has a reproducer. An alternate reproducer is https://github.com/holly-cummins/quarkus-pact/tree/test-test-and-dev-modes (just re-enable the
@Disable
d tests, and then runmvn clean install
from the top level).Output of
uname -a
orver
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
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: