noconnor / JUnitPerf

API performance testing framework built using JUnit
Apache License 2.0
68 stars 18 forks source link

Does it support @Suite annotation of JUnit 5, rather than @RunWith as it is for JUnit 4 #85

Open nagkumar opened 1 year ago

nagkumar commented 1 year ago

Does it support @Suite annotation of JUnit 5, rather than @RunWith as it is for JUnit 4

noconnor commented 1 year ago

Should be an example of @Suite usage here

nagkumar commented 1 year ago

But this example expects @ExtendWith(JUnitPerfInterceptor.class) to be added to every testcase.. is it a must.. as we have 100s of TestCases.. don't wish to keep adding to each..

Is it possible to use this framework to do perf tests as little or zero code changes to Unit Tests as possible.. i.e. with some form of external configuration etc..

Can these annotations be put only for suite class so that it applies to all the unit tests.. that way, Unit Tests are unchanged.

  @JUnitPerfTest(threads = 1, durationMs = 1_000, maxExecutionsPerSecond = 1_000)
  @JUnitPerfTestRequirement(executionsPerSec = 10_000)
  @JUnitPerfTestActiveConfig
  @ExtendWith(JUnitPerfInterceptor.class)

all these annotations..

I am seeing perf tests are external load tests at top level..

noconnor commented 1 year ago

I think its possible with a small change to the core library to achieve what you've described.

If you had 100 test cases registered to a suite,

The final report would contain performance characteristics of each test case. You can have a look at the sample code and see if this is what you're looking for.