-
Notifications
You must be signed in to change notification settings - Fork 5k
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
CAMEL-18201 Enhance CamelTestSupport to turn off context stopping #7813
CAMEL-18201 Enhance CamelTestSupport to turn off context stopping #7813
Conversation
|
WDYT? @davsclaus This change will allow camel quarkus to run |
Hmmm so this seems a bit like the camelContextPerClass functionality that is already there. |
Functionality may look similar but it is not. PerClass functionality will stop context after each class. This option won't stop context after each class, it will never stop context. As for the name, I see that it may be a bit unclear, what about |
Maybe what CEQ needs is being able to override some protected methods in CamelTestSupport to control more fine grained what CEQ needs to do in the doSetup and teardown methods. Then CEQ can override these methods and do something different. Maybe the existing doStopCamelContext and setup is useable as-is, eg you can try to implement this in CEQ and then override doStopCamelContext to not stop camel, or only stop when really needed. And doSetup you can then skip calling super if already started. Then maybe this is possible to just do in CEQ only and keep camel core as-is |
Overriding method in CEQ was me preferred solution, unfortunately method I need to override is private static If making it non-static protected is a better solution, I will use that. (I chose a configurable option, as I saw similar options there) If you agree, I'll modify the PR to change method signature and allow overriding of it. |
Yeah its better to make the method protected |
6dacb4f
to
bd510e5
Compare
Thank you! I change only 2 signatures and keep 1 test covering the overriding of both methods. |
✔️ Finished component verification: 0 component(s) test failed out of 1 component(s) tested |
LGTM great work @JiriOndrusek |
❌ Finished component verification: 1 component(s) test failed out of 14 component(s) tested |
1 similar comment
❌ Finished component verification: 1 component(s) test failed out of 14 component(s) tested |
There seems to be 1 error now Failed components/camel-test test test: 14 verified / 1 failed |
I'll check it. |
I see that problem is happening in the I see in the log:
My local execution ends with
|
No I dont know how to grab the test logs, @otavioprado knows how-to |
bd510e5
to
a4afdbc
Compare
I've found the reason in https://github.com/apache/camel/actions/runs/2515347416
fixed by running |
✔️ Finished component verification: 0 component(s) test failed out of 15 component(s) tested |
fixes https://issues.apache.org/jira/browse/CAMEL-18201
This PR adds an option to turn off the context stopping. It is possible by junit5's
ConfigurationProperty
(which falls back also to system variable - used in the junit test). If context does not stop automatically methoddoSetUp
is not called if context already exists.I added 2 tests to cover both option values (off and on).