Closed TestBoost closed 11 months ago
Hi @TestBoost thanks for this PR. I agree, that expensive setup only needs to happen once per test class not per test method.
If this is a bot account please can you confirm you're happy for your contribution to be licensed under the BSD 2-clause license?
Thanks,
Chris
Hi Chris,
Thank you for your response!
I am not a bot haha. But I am happy to be licensed under the BSD 2-clause license.
Thanks, TestBoost
Thanks @TestBoost I've merged your patch.
The tests in the test class
TestBytecodeLoaderWithInnerClasses
tries to compile a Java file into bytecodes and then usesBytecodeLoader
to load the compiled bytecodes. However, among all the tests in this test class, there are no modifications on the compiled bytecodes and the fields defined in this test class.When running this test, all tests repeatly compile the Java file and load the bytecodes, which add a huge cost to this test. Thus, we propose to just run the @Before and @After method once for the tests in this test class.
The time to run all the tests in the test class
TestBytecodeLoaderWithInnerClasses
can jump from 4.370 s to 0.491 s on our local machine.