Skip to content
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

save Throwable as Java object for each failure #151

Merged
merged 5 commits into from
Nov 7, 2024

Conversation

leonardhusmann
Copy link
Contributor

Hi,
the Throwable which is causing the test to fail is saved as an object. This allows for easier and more robust analysis and classification of the failures later.

Example:

TestResult result = EntryPoint.runTests(classpath, "org.example.TestMain");
Set<Failure> failures = result.getFailingTests();
for (Failure failure : failures) {
    if (failure.throwable instanceof AssertionError) {
        // handle failed assertions --> test failures
    } else if (failure.throwable instanceof RuntimeException) {
        //handle Runtime errors --> test errors
    }
}

@monperrus
Copy link
Member

thanks @leonardhusmann

CI is failing, could you fix it?

@leonardhusmann
Copy link
Contributor Author

Looking into it :)

@frankreyesgarcia frankreyesgarcia merged commit 323c709 into STAMP-project:master Nov 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants