TNG / junit-dataprovider

A TestNG like dataprovider runner for JUnit with many additional features
Apache License 2.0
245 stars 164 forks source link

Can Gradle run these tests in parallel? #92

Closed thejohnfreeman closed 6 years ago

thejohnfreeman commented 7 years ago

Gradle cannot run JUnit @Parameterized tests in parallel, but TestNG has a parallel Boolean parameter on the @DataProvider annotation. Can Gradle run the junit-dataprovider tests in parallel?

aaschmid commented 7 years ago

Hi @thejohnfreeman,

I have never tried this but in theory every junit-dataprovider test is a separate FrameworkMethod. This means if Gradle is parallelizing on this level, it should run out-of-the-box. I will try to reproduce this within the next days. Or is it somehow urgent?

Cheers, Andreas

thejohnfreeman commented 7 years ago

Not urgent. Thanks!

gaponte1985 commented 7 years ago

Any update about this issue?

aaschmid commented 7 years ago

Hi @gaponte1985, thanks for the reminder. Currently my real spare time is a bit little but I will try to look at it as soon as possible ...

gaponte1985 commented 7 years ago

Thanks for the updated.

gaponte1985 commented 7 years ago

still working onm it?

aaschmid commented 7 years ago

Hi @gaponte1985,

sorry for the long delay. I tried to parallelize the integration tests on junit-dataprovider itself using test.maxParallelForks = 4 (see https://docs.gradle.org/3.0/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:maxParallelForks for details). And as I just use a normal runner as everybody else it should work. Also multiple threads are forked, though the tests are outputted in order ...

Can you try it and give feedback with a bigger test suite?

gaponte1985 commented 7 years ago

I dont get this one, can you please explain?

aaschmid commented 7 years ago

Hi @gaponte1985,

I used https://github.com/TNG/junit-dataprovider/blob/master/build.gradle and added test.maxParallelForks = 4 (see documentation on https://docs.gradle.org/3.0/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:maxParallelForks).

Running gradle build using above changed build.gradle everything worked and tests are executed using multiple forked threads.

Can you try it and give feedback with your test suite?

aaschmid commented 6 years ago

Hi @gaponte1985, is this still an isssue or could you resolve it? Otherwise, how can I still help? Cheers, Andreas

aaschmid commented 6 years ago

Hi @thejohnfreeman, looking at your issue now, you wanted to know if you can parallelize the dataprovider tests inherited from one single dataprovider for a single test method, right? Cheers, Andreas

aaschmid commented 6 years ago

Closing this because of no further response from issue creator and other participants such that I cannot help any further. Please don't hesitate to reopen and provide any further information or details.