Skip to content

Cannot disable test failure behaviour #145

@lukeredpath

Description

@lukeredpath

The library automatically causes tests to fail when reportIssue is called, which is not always desirable behaviour and there is no easy way to stop this from happening.

I'm in the process of migrating our custom error handling code over to using swift-issue-reporting. Our app uses TCA. I already have a number of tests where I'm explicitly configuring a dependency to throw an error to test the error handling path - even if we have explicit error handling logic we might still use reportIssue to log that issue (to Sentry, using a custom reporter). There is no need for this to trigger a test failure.

I expected that this behaviour was just a custom "test" reporter but it isn't, it is hardcoded into reportIssue. I cannot use withExpectedIssue because the async version does not support XCTest - I cannot change over to Swift testing just to work around this issue. I can use XCTExpectFailure() directly but this is a very broad solution that could hide genuine test failures.

I think this behaviour should be configurable, or refactored into a default issue reporter that can be overridden using the existing API for configuring reporters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions