Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
divannn opened this issue Jan 4, 2023 · 5 comments
Closed

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

divannn opened this issue Jan 4, 2023 · 5 comments

Comments

@divannn
Copy link

divannn commented Jan 4, 2023

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

@hunteryin
Copy link

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?

@grey-rain
Copy link
Collaborator

@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
Copy link
Collaborator

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

@grey-rain
Copy link
Collaborator

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

@grey-rain
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants