serenity-reportportal-integration icon indicating copy to clipboard operation
serenity-reportportal-integration copied to clipboard

Failed serenity test isn't reported as 'FAILED' in ReportPortal

Open divannn opened this issue 2 years ago • 4 comments

HI, I use serenity-reportportal-integration library for sending results of test execution to ReportPortal. I noticed strange behaviour. Run the following trivial test case :

@Slf4j @ExtendWith(SerenityJUnit5Extension.class) class TestXXX {

@Test
void test1() {
    log.info(">run 1");
    throw new RuntimeException("fail");
}

@Test
void test2() {
    log.info(">run 2");
    assertThat(1).isEqualTo(2);
}

}

Both tests are failed correctly. But when I see results in ReportPortal - they are both marked as PASSED.

Is this known issue or behavior?

I suspect that com.github.invictum.reportportal.ReportPortalListener doesn't handle failed test properly.

Thank you in advance, -Ivan

divannn avatar Jan 04 '23 14:01 divannn

I found out it only report failed test case if the error/exception happened inside step. If it failed from test directly, the report portal show it as pass. Do we have any any plan to fix this issue?

hunteryin avatar May 24 '23 20:05 hunteryin

@hunteryin @divannn I know, it's been a while, but I found where it comes from. It is Serenity bug coming from SerenityTestExecutionListener.java class. It seems like Serenity also does some post-processing AFTER listeners invocations to updates results, but no listeners has been invoked to receive updates, that's why you see it as "Failed" in ReportPortal. Long story short, I will try to propose PR to Serenity once I have time. Maybe integration rework will help to fix it as well, but I am not sure in it. In any case, it is not really related to integration implementation.

grey-rain avatar Oct 16 '23 20:10 grey-rain

@hunteryin @divannn here's related bug I reported and fixed in Serenity: https://github.com/serenity-bdd/serenity-core/issues/3298 It should resolve the issue in upcoming Serenity and integration versions. Thanks for bringing it up! 👍🏻

grey-rain avatar Oct 22 '23 12:10 grey-rain

Reopening until new Serenity version is released and wrapped into integration.

grey-rain avatar Oct 22 '23 18:10 grey-rain

Should be resolved with integration version 1.6.1. cc @hunteryin @divannn

grey-rain avatar Jul 29 '24 15:07 grey-rain