quick-perf / quickperf

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
https://github.com/quick-perf/doc/wiki/QuickPerf
Apache License 2.0
469 stars 67 forks source link

Support org.junit.jupiter.params.ParameterizedTest #139

Closed klu2 closed 3 years ago

klu2 commented 3 years ago

Describe the bug

The usage of JUnit5's org.junit.jupiter.params.ParameterizedTest leads to a RuntimeException.

Expected behavior QuickPerf can handle parameterized tests, the annotations are applied to all test runs

Actual behavior A RuntimeException is thrown.

To Reproduce

import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource
import org.quickperf.junit5.QuickPerfTest

@QuickPerfTest
class FooTest {

    @ParameterizedTest
    @ValueSource(strings = ["foo", "bar"])
    fun paramTest(param:String) {

    }
}

Leads to

Quickperf didn't support test template yet
java.lang.RuntimeException: Quickperf didn't support test template yet
    at org.quickperf.junit5.QuickPerfTestExtension.interceptTestTemplateMethod(QuickPerfTestExtension.java:87)
    at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)

Versions

Additional context (Add any other context about the problem here.)

jeanbisutti commented 3 years ago

@klu2 Thanks for using QuickPerf. Could you please bump to QuickPerf 1.0.1? QuickPerf 1.0.1 should work with parameterized tests.

klu2 commented 3 years ago

oh, 1.0.1 is already there, I didn't see that. just gave it a try, works like a charm. thanks for this awesame framework!