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

Guide/code.quarkus.io native image testing re-work #18820

Closed
edeandrea opened this issue Jul 19, 2021 · 18 comments · Fixed by #23488
Closed

Guide/code.quarkus.io native image testing re-work #18820

edeandrea opened this issue Jul 19, 2021 · 18 comments · Fixed by #23488
Labels
area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven
Milestone

Comments

@edeandrea
Copy link
Contributor

Description

The Quarkus native image testing guide (https://quarkus.io/guides/getting-started-testing#native-executable-testing) says that @NativeImageTest is not yet deprecated but will be in the future and to use @QuarkusIntegrationTest.

If so, why does code.quarkus.io still generate projects using @NativeImageTest (& also the native image test extending the non-native base class).

Implementation ideas

No response

@edeandrea edeandrea added the kind/enhancement New feature or request label Jul 19, 2021
@geoand
Copy link
Contributor

geoand commented Jul 19, 2021

cc @ia3andy

@ia3andy
Copy link
Contributor

ia3andy commented Jul 19, 2021

Good point, it's just a matter of updating the templates, we really need that done for the next release and backported to previous versions:

This is one of the templates to update (it needs to be done in java/kotlin/scala and also in resteasy-reactive):

https://github.com/quarkusio/quarkus/blob/main/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/native-test/java/org/acme/Native%7Bresource.class-name%7DIT.tpl.qute.java

@ia3andy
Copy link
Contributor

ia3andy commented Jul 19, 2021

@edeandrea are u up for a PR?

else I'll have a look tomorrow.

@geoand what should we use now?

Also @gsmet the quickstarts are also using it:
https://github.com/quarkusio/quarkus-quickstarts/blob/main/getting-started/src/test/java/org/acme/getting/started/NativeGreetingResourceIT.java

@edeandrea
Copy link
Contributor Author

@ia3andy possibly. I'm just returning from a week's worth of PTO and have a ton of stuff to get through this week, so chances are it wouldn't be anything I could get to in the next week or 2.

@ia3andy
Copy link
Contributor

ia3andy commented Jul 19, 2021

@edeandrea thanks! no worries I'll have a look tomorrow..

@ia3andy
Copy link
Contributor

ia3andy commented Jul 19, 2021

the code generation tests (snapshots) will also need to be updated accordingly

@edeandrea
Copy link
Contributor Author

edeandrea commented Dec 7, 2021

Just wanted to give a gentle ping on this. Any updates? In addition to the test classes needing updating, the pom.xml would also need to be updated. Currently the failsafe plugin is only installed in the native profile. It would need to be moved into all profiles. like here (this project also has an example integration test).

@ia3andy
Copy link
Contributor

ia3andy commented Dec 7, 2021

@edeandrea I thought I did that one.. it must have slipped of my TODO list somehow.. do you want to provide a PR?

@ia3andy ia3andy removed kind/enhancement New feature or request triage/needs-triage labels Dec 7, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 7, 2021

/cc @quarkusio/devtools

@ia3andy ia3andy added area/maven area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins labels Dec 7, 2021
@edeandrea
Copy link
Contributor Author

I don't know anything about how the templating or code.quarkus.io works nor how I would test any changes before I've committed anything. If its not too much work I could probably do a PR so long as you give me some starting points...

@edeandrea
Copy link
Contributor Author

Looking at https://github.com/quarkusio/quarkus/blob/main/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/native-test/java/org/acme/Native%7Bresource.class-name%7DIT.tpl.qute.java - does it really belong in a directory called native-test if its now an integration test?

Would this be a much broader change? This guide would most likely need to be updated as well.

@ia3andy
Copy link
Contributor

ia3andy commented Dec 7, 2021

@edeandrea
the pom is here: https://github.com/quarkusio/quarkus/blob/main/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/buildtool/maven/base/pom.tpl.qute.xml#L164-L202

The tests are here:

@ia3andy
Copy link
Contributor

ia3andy commented Dec 7, 2021

Some tests might need to be run with -Dsnap option to update the test comparison snapshots

@ia3andy
Copy link
Contributor

ia3andy commented Dec 7, 2021

First make the changes and then see what fails

@ia3andy
Copy link
Contributor

ia3andy commented Dec 7, 2021

Looking at main/independent-projects/tools/base-codestarts/src/main/resources/codestarts/quarkus/extension-codestarts/resteasy-codestart/java/src/native-test/java/org/acme/Native%7Bresource.class-name%7DIT.tpl.qute.java - does it really belong in a directory called native-test if its now an integration test?

Would this be a much broader change? This guide would most likely need to be updated as well.

That's a good question, I think you can move them to the test directory we just need to make sure it's ok with gradle (cc @glefloch)

@ia3andy
Copy link
Contributor

ia3andy commented Dec 7, 2021

Yes I guess the guide also need to be udpated, but that could be a different PR..

@edeandrea
Copy link
Contributor Author

@ia3andy I created a draft PR for this at #21997

We can pick up the conversation over there.

@glefloch
Copy link
Member

glefloch commented Dec 7, 2021

Moving those test in the test directory would result in IT test execution every time we run ˋgradle test` we should keep a separate source set (maybe ˋsrc/integration-test/java ˋ) at least for gradle ..

edeandrea added a commit to edeandrea/quarkus that referenced this issue Feb 7, 2022
edeandrea added a commit to edeandrea/quarkus that referenced this issue Feb 8, 2022
Repository owner moved this from Todo to Done in Quarkus Roadmap/Planning Feb 22, 2022
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Feb 22, 2022
edeandrea added a commit to edeandrea/quarkus that referenced this issue Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codestarts area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/maven
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants