-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add new state-based method for deciding if tests should run in a new classloader #45484
Conversation
…me classloader
Status for workflow
|
In the current test model, we order tests, and then, at the point of execution, decide if a new classloader is needed. In the post-https://github.com/orgs/quarkusio/projects/30 world, we decide if a new classloader is needed when we load the tests, which is before ordering.
Since we call it before the orderer is called, there’s no notion of a sequence. This means moving from a sequence-based calculation to a state-based calculation. (I know the current parameter is literally called “state,” but really what’s being looked at is the sequence.)
I've implemented this by generating a uniqueness key for every test.
But this new code isn't used anywhere
This code isn't used yet, but once #34681 drops, it will be. I'm being optimistic, and starting to pull incremental chunks.
My new method could be used in the implementation of
testResourcesRequireReload
. I didn’t yet, for two reasons:testResourcesRequireReload
, I wouldn’t have anything to compare behaviour against in unit tests :) I guess this doesn’t actually matter since there are unit tests and as long as the unit tests pass, we can assume the new behaviour is good, but it made me hesitate.I think this method perhaps could and should also be called in the junit orderer, because it can be used to group and sort test classes. That would ensure consistency across all three paths – the ordering in the orderer, the grouping in the
FacadeClassLoader
(coming soon ™), and the reload decision in the test extensions. I didn’t do this yet, just to keep things incremental and get feedback first.If it’s used on the orderer, it would also needs to look at the profile (and not just the profile resources), but that’s doable, as long as we didn't accidentally conflate it with the reload decision and reload for every profile.