UT-SE-Research / iDFlakies

29 stars 33 forks source link

Support for projects containing both JUnit 4 and JUnit 5 #50

Open bmk15897 opened 1 year ago

bmk15897 commented 1 year ago

While running iDFlakies for https://github.com/alibaba/fastjson2, the following message was printed.

INFO: Located 4806 tests. Time taken: 521.3839998245239 seconds
INFO: This project contains both JUnit 4 and JUnit 5 tests, which currently is not supported by iDFlakies
---------------------------------------------------
Message was:
This project contains both JUnit 4 and JUnit 5 tests, which currently is not supported by iDFlakies
TRY_COPY_ALL_FAILING_TEST_OUTPUT

Commands to reproduce -

git clone https://github.com/alibaba/fastjson2
cd iDFlakies/
bash pom-modify/modify-project.sh ../fastjson2/
cd ../fastjson2/
mvn idflakies:detect -Ddetector.detector_type=random-class-method -Ddt.randomize.rounds=10 -Ddt.detector.original_order.all_must_pass=false -Denforcer.skip=true
august782 commented 1 year ago

Hi,

Sorry for the late response. Yes, we are aware that iDFlakies currently does not proceed when there are both JUnit 4 and JUnit 5 tests in the project at the same time. Potentially, we can modify iDFlakies to always use JUnit 5 even if there are JUnit 4 tests, as JUnit 5 should be able to still support JUnit 4, though we have not looked into this yet. I unfortunately will likely not have much time to try and implement such a feature this week; how urgent do you need to resolve this issue?

Alternatively, iDFlakies should already have an option, dt.detector.forceJUnit4, which can be set to force running JUnit 4 only, in case that suffices.