Skip to content

NullPointerException thrown from RuntimeReporter causes test to fail when utilizing TestNG successPercentage and a test doesn't fail because it is within a success percentage #352

Open
@ILikeToNguyen

Description

@ILikeToNguyen

SeLion Version

1.2.0

Component

client

Expected Behavior

Not to fail my test with a NPE from runtime reporter

Actual Behavior

Happens if you have a TestNG test that results in onTestFailedButWithinSuccessPercentage
Runtime reporter throws a NullPointerException. It is trying to read status field from the reporter's json file that written. Reason the reporter's json file is missing the status field is because in MethodInfo, we are not handling SUCCESS_PERCENTAGE_FAILURE and marking it as a status=success. Thus status is not set.

Steps to Reproduce

@test(successPercentage = 0)
public void test() {
double value = 10/0;
}

This will trigger the NPE.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions