-
Notifications
You must be signed in to change notification settings - Fork 260
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
Improve test support #1197
Comments
I did a small analysis of your code and what could be done to implements this:
So maybe ignoring my concern about a test-dependency that needs to be added and that could be solved by adding it to the aggregator/parent POM the easiest fix would IMHO be to create yet another togglz module for testing. |
Quote from your website:
In general I love togglz for its simplicity so thank you for making it.
However, sorry to be frank but I would clearly state that for testing this "mission statement" definitely does not apply
Search the web for "IllegalStateException: Could not find the FeatureManager."
I do not want to be forced to add togglz test dependency to all my modules and pollute all my tests with stuff like
@AllDisabled(MyFeature.class)
.IMHO you could solve this way smarter for the 95% case.
This example is from your website:
So why can't togglz work in a way that without any configuration this is just giving me the defaults so that
FEATURE_ONE
is active (@EnabledByDefault
) andFEATURE_TWO
is not (in JUnit tests)?In case I want something else, I am happy to add custom JUnit dependencies and magic annotations.
I just introduced Togglz to a project with million lines of code and 600 maven modules.
Now with more components using feature-toggles all the existing tests fall apart.
I am fully aware that my "feature request" would need some magic fallback for testing in the productive togglz code.
Feel free to require some environment variable that developers could somehow set crosscutting via surefire, spring or whatever frameworks involved if you think there is no other way.
Also feel free to spam the logs with aggressive warnings if togglz is not configured and decides to fall back to this test mode since it somehow assumes it is currently running in a JUnit setup.
All is doable and has already been done by other Java libs.
IMHO this would increase your UX for developers significantly. Thanks for taking care.
The text was updated successfully, but these errors were encountered: