smart-testing icon indicating copy to clipboard operation
smart-testing copied to clipboard

Investigate classloading issues

Open bartoszmajsak opened this issue 7 years ago • 1 comments

If we don't define smart-testing-surefire-provider dependency both as project dependency as well as provider for surefire plugin we are encountering classloading issues. We have to investigate why is that happening and if it's possible to have provider defined only once.

bartoszmajsak avatar May 23 '17 10:05 bartoszmajsak

The reason is in the surefire plugin magic. To provide our own implementation of a provider, we need to specify the dependency in the surefire plugin part. Then surefire finds this custom provider and invokes it. The invocation of the provider is done in a new separated classloader that contains dependencies specified in the standard part - in other words, surefire separates dependencies needed for internal logic from the provider part that executes tests. So, to have all necessary libraries/strategies available (when the provider is being invoked), we need to have the smart-testing dependency as a standard dependency (not only as a surefire-plugin dependency) There is definitely a room for an improvement - we could have one light dependency containing only our provider implementation and then another one (some depchain) containing all strategies and additional libraries. But this is an optimization detail.

MatousJobanek avatar May 23 '17 17:05 MatousJobanek