-
Notifications
You must be signed in to change notification settings - Fork 44
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
Provide means to use RandomizedTesting without the test runner. #292
Comments
What is it that threw this exception? I am really hesitant about exposing too many internals for a number of reasons: once it's out, it's additional maintenance but mostly randomization without proper control and setup (done in the custom runner) is against the philosophy that I tried to convey with this project. If you don't isolate threads between threads then reproducibility is gone. Also, the default runner makes a number of tricks to ensure repetitions work properly, different seeds are picked for each run, test descriptions are formatted in a way that is IDE-friendly... There is probably more. If you only need test utilities then many of them accept an external Random instance [1] - then you don't need the context to be initialized. Some checks in the runner can be turned off via annotations if they're annoying. I would need to see a compelling reason for this though. |
I understand there is a lot of value in totally embracing all of what RandomizedTesting provides. I just think there should be a light-weight "Rule" based option for those that want/need something lighter weight, even if it's less rigorous (gotchas to repeatability -- may not be as repeatable in certain cases). Put differently, I don't think it needs to be all or nothing.
|
I don't think repeatable randomness can be implemented with a rule - that's the whole point I tried to make. Maybe with the new JUnit5 infrastructure it's different, I didn't look into this yet. |
I work on a project that depends on lucene-test-framework for its wonderful test utilities to validate use of text analysis components. The project does not use randomizedtesting's test runners. I want to use some test utilities that I cannot invoke now because they directly/indirectly invoke randomizedtesting which fails because there is no context:
Asking users/projects to a specific test runner can be an awkward constraint. For some of my tests, I can use your runner, for some, I cannot because another is used.
When I look at RandomizedContext, there isn't sufficient access for me to manually manage it's lifecycle outside of your runner. I would like this added and/or a JUnit Rule as an option. Such a Rule wouldn't bring all the baggage that RandomizedRunner has -- no thread leak detection. Just provide what this project's namesake is -- randomness. That's all.
The text was updated successfully, but these errors were encountered: