-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Handle AssumptionViolatedException in @Parameters method #1460
Handle AssumptionViolatedException in @Parameters method #1460
Conversation
8a50082
to
3bc3a3a
Compare
Object parameters; | ||
try { | ||
parameters = parametersMethod.invokeExplosively(null); | ||
} catch (AssumptionViolatedException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you catch this exception in the caller (RunnersFactory
)? If the exception gets caught, you can set a field in RunnersFactory
named runnerOverride
to a new AssumptionViolationRunner
. If runnerOverride
is set it would be returned from RunnersFactory.createRunners()
.
As a bonus, we could possibly catch any exception from there, and for the exceptions that aren't AssumptionViolatedException
use ErrorReportingRunner
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented the first part.
ErrorReportingRunner
is already applied in RunnerBuilder.safeRunnerForClass()
, seems like we should not care about other exceptions.
9f38f32
to
03987d9
Compare
@panchenko Thanks! Could you update the release notes on the wiki? |
Thank you! |
@kcooney I've updated release notes for this. |
Fixes #1329