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

[BREAKING CHANGE] Use Quarkus Maven plugin for JVM mode tests and isolate tested Quarkus application, simplify creating of reproducers #1375

Conversation

michalvavrik
Copy link
Member

@michalvavrik michalvavrik commented Oct 20, 2024

Summary

TL;DR;

  • if you let QE FW build native executable, the framework prepares for you standalone application with all the changes (forced dependencies, build-time properties)
    • than you can use same command to start application as you saw in logs (so you know exactly how to reproduce the failure)
    • please remember that we have Quarkus Maven plugin present in our projects, so when custom build is not required naturally (e.g. forced dependencies, custom build-time properties in native mode or Quarkus build is explicitly skipped with quarkus.build.skip=true), you need to enforce it, e.g. set ts.global.custom-build.required to use this
  • use Quarkus Maven plugin to test JVM mode, because that is what customers do, they don't use Quarkus bootstrap directly

Practical example:

cd examples/blocking-reactive-model
mvn clean verify -Dts.global.delete.folder.on.exit=false
## Quarkus REST
cd target/GreetingResourceIT/rest/mvn-build/
# now you are in actual tested Quarkus REST application, now you can run it with
# if you set runtime properties, you better check log for what QE FW set as system properties
java -jar target/quarkus-app/quarkus-run.jar
## RESTEasy Classic
cd target/GreetingResourceIT/resteasyClassic/mvn-build/
# now you are in actual tested RESTEasy Classic application, now you can run it with
java -jar target/quarkus-app/quarkus-run.jar

Longer version:

Before this PR, we build JVM move tests without forced dependencies directly with Quarkus boostrap. However:

  • this is not what users do
  • we are not certain we use the bootstrap in a samw way as Quarkus does
  • we don't have actual application that we can run separately from our framework as one of following could happen:
    • application properties were augmented
    • dependencies were added
    • only some classes were tested, not all the application classes on path

So this PR should make creating reproducers easier, because you will have independent application (no parent, no test framework):

  • app that you can copy without adjustments
  • command used to run application including all system properties set as -Dproperty-key=property-value

Cons:

  • file R/W operations and CLI commands are slower than running everthing in one Java process
  • merging profiles and plugins and dependency managements between parent and tested module is complex; IMO it can only be done properly with effective POM, which would slower tests down; so I only tested what we actually do ATM and that is what is supported and nothing more

Breaking changes:

  • you need to add io.quarkus.qe:quarkus-test-preparer to your project and run the prepare-pom-mojo goal

Other changes this PR contains:

What this PR doesn't do:

  • I leave OpenShift as is, current way how we build OpenShift can be really cumbersome when it comes to determine when is custom artifact build required, I'd need much more than few days to get this right.

Please check the relevant options

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Dependency update
  • Refactoring
  • Release (follows conventions described in the RELEASE.md)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update
  • This change requires execution against OCP (use run tests phrase in comment)

Checklist:

  • Example scenarios has been updated / added
  • Methods and classes used in PR scenarios are meaningful
  • Commits are well encapsulated and follow the best practices

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from cc35fa1 to 9e97527 Compare October 20, 2024 17:09
@michalvavrik michalvavrik marked this pull request as draft October 20, 2024 17:37
@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch 2 times, most recently from 145db90 to 7a75a25 Compare October 20, 2024 19:20
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from 7a75a25 to a7e9e83 Compare October 20, 2024 20:35
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from a7e9e83 to 1c70ddf Compare October 20, 2024 21:50
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from 1c70ddf to 80ad0ff Compare October 21, 2024 07:11
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch 3 times, most recently from 9d89922 to fcdeaf5 Compare October 21, 2024 15:56
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from fcdeaf5 to 9bd8ad2 Compare October 21, 2024 17:51
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from 9bd8ad2 to c73eccc Compare October 21, 2024 18:04
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik changed the title Isolate tested Quarkus application, simplify creating of reproducers, decrease test execution time [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, decrease test execution time Oct 21, 2024
@michalvavrik michalvavrik changed the title [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, decrease test execution time [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, decrease test execution time, use Quarkus Maven plugin everywhere Oct 21, 2024
@michalvavrik michalvavrik changed the title [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, decrease test execution time, use Quarkus Maven plugin everywhere [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, decrease native test execution time, use Quarkus Maven plugin everywhere Oct 21, 2024
@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from c73eccc to e243d50 Compare October 21, 2024 22:47
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from e243d50 to ecf7abc Compare October 22, 2024 08:38
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch 3 times, most recently from b31e5e2 to 4a65f7e Compare October 22, 2024 13:33
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from 4a65f7e to 006fb5f Compare October 22, 2024 17:02
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik changed the title [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, decrease native test execution time, use Quarkus Maven plugin everywhere [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, use Quarkus Maven plugin everywhere Oct 22, 2024
@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from 006fb5f to c83dc93 Compare October 22, 2024 17:26
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik
Copy link
Member Author

michalvavrik commented Nov 3, 2024

There is no chance I'll be able to finish this, I just don't have time. I'll reduce this PR to what works well and improves current state - use Maven plugin helper for all baremetal runs.

@michalvavrik michalvavrik changed the title [BREAKING CHANGE] Isolate tested Quarkus application, simplify creating of reproducers, use Quarkus Maven plugin everywhere Use Quarkus Maven plugin for JVM mode tests and isolate tested Quarkus application, simplify creating of reproducers Nov 13, 2024
@michalvavrik michalvavrik marked this pull request as ready for review November 13, 2024 18:45
@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from c83dc93 to 3a02630 Compare November 13, 2024 18:45
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from 3a02630 to f1c723f Compare November 13, 2024 20:11
@michalvavrik
Copy link
Member Author

run tests

@michalvavrik michalvavrik changed the title Use Quarkus Maven plugin for JVM mode tests and isolate tested Quarkus application, simplify creating of reproducers [BREAKING CHANGE] Use Quarkus Maven plugin for JVM mode tests and isolate tested Quarkus application, simplify creating of reproducers Nov 13, 2024
@michalvavrik michalvavrik force-pushed the feature/always-use-quarkus-maven-plugin-strategy branch from f1c723f to f995940 Compare November 14, 2024 09:30
@michalvavrik
Copy link
Member Author

run tests

Copy link
Member

@mjurc mjurc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works nicely and I cannot really find anything wrong about the PR itself.

Thanks for the enhancement.

@mjurc mjurc merged commit 166031a into quarkus-qe:main Nov 20, 2024
9 checks passed
@mjurc
Copy link
Member

mjurc commented Nov 20, 2024

About the

merging profiles and plugins and dependency managements between parent and tested module is complex; IMO it can only be done properly with effective POM, which would slower tests down; so I only tested what we actually do ATM and that is what is supported and nothing more

I think this would require a deeper change in framework (e.g. making applications more isolated) cos I don't really think making workarounds by figuring out the effective pom and the excluding the framework deps gives us much value

@michalvavrik michalvavrik deleted the feature/always-use-quarkus-maven-plugin-strategy branch November 20, 2024 12:04
@michalvavrik
Copy link
Member Author

Thanks @mjurc , I'll rerun TS with this FW version (both baremetal and OCP) to re-check there are no issues before I make release.

@michalvavrik
Copy link
Member Author

@michalvavrik
Copy link
Member Author

As there is a release in progress, I run daily build of this FW project and it is green https://github.com/quarkus-qe/quarkus-test-framework/actions/runs/11934859467 so that means K8 and Windows native are fine as well.

@michalvavrik
Copy link
Member Author

For record TS daily build with bumped FW was green quarkus-qe/quarkus-test-suite#2208 and OCP looked good as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants