0
votes

I'm trying to change report generation for Allure to override the test status of failed tests. Tests that failed by assertion are marked as FAILED and red in a final report. Tests that failed due to timeout - BROKEN and yellow. I need to make all the reasons for test failures FAILED and red. I made it by creating a custom listener. And faced an issue that both mine and default allure listeners are working at the same time. As a result of each test 2 report files are being generated. is there any possibility to disable default AllureJunitPlatform listener? or are there any alternative ways to solve my issue?

I register my listener like this:

Launcher launcher = LauncherFactory.create();
TestExecutionListener listener = new MyCustomAllureListener();
launcher.registerTestExecutionListeners(listener);

As far as I can see, Under the hood of LauncherFactory.create() it is looking up for TestExecutionListener like described here: https://github.com/allure-framework/allure-java/issues/63 So, the default Allure listener is set in META-INF in Allure dependency.

Is it possible to delete(do not initialize) it?

2

2 Answers

0
votes

There is, but it's not merged yet I had a similar issue and added the fix for in Junit5 https://github.com/junit-team/junit5/issues/2181

Once this is merged, you should be able to add

junit.platform.execution.listeners.deactivate

Property in the junit-platform.properties file to deactivate Allure Listener

You'll have to wait for 5.7, till then, not sure what can be done

0
votes

Here the answer for allure dependency: https://github.com/allure-framework/allure-java/issues/428#issuecomment-594475036

you should update dependency like this(for gradle): testCompile ('io.qameta.allure:allure-junit5:2.12.1:spi-off')

spi-off

it is a classifier for dependency.