jenkinsci / peass-ci-plugin

Jenkins plugin for peass to support performance measurement in CI
https://plugins.jenkins.io/peass-ci/
GNU Affero General Public License v3.0
4 stars 13 forks source link

Mocked Static Execution Should Be Measurable #204

Closed bam-hbt closed 1 year ago

bam-hbt commented 1 year ago

What feature do you want to see added?

Kopeme runs the tests in a separate thread and the mocking static methods in a local thread-mock. Also, JUnit 5 starts the test initialization (including @BeforeAll), and then KoPeMe starts the test control later in the test cycle, and then starts BeforeAll again. However, since mock static instances are supposed to be closed, running BeforeAll multiple times will give an exception. Therefore, the Kopeme should be capable of calling the @beforAll method in the same thread.

Upstream changes

No response

DaGeRe commented 1 year ago

Thanks for the hint, calling @BeforeAll in the same thread and clearing the mockito cache should work starting with https://github.com/DaGeRe/peass/commit/c8f6fa35dfb51cbb948c5b2d8f60fa4371431f44 - can you confirm this?

bam-hbt commented 1 year ago

JUnitTestTransformer add "_peass_initializeMockito()" method to other test class, they didn't use any Mockito. Therefore, miss Mockito import in these classes, or is better don't add the method to the test classes without Mockito.

bam-hbt commented 1 year ago

This should fix that: https://github.com/DaGeRe/peass/pull/111

bam-hbt commented 1 year ago

Thanks for fix, looks fine.