-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
[JSTEP-10] Migrate from using /failing
tests to /tofix
tests
#1372
[JSTEP-10] Migrate from using /failing
tests to /tofix
tests
#1372
Conversation
/failing
tests to /tofix
tests/failing
tests to /tofix
tests
* {@link JacksonTestFailureExpected} annotation. | ||
*/ | ||
@Override | ||
public void interceptTestTemplateMethod(Invocation<Void> invocation, |
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.
This API is for @ParameterizedTest
.
For every method invocation, this method is called.
ExpectedPassingTestCasePredicate predicate = findzExpectedPassingTestCasePredicate(invocationContext); | ||
if (predicate != null) { | ||
if (predicate.shouldPass(invocationContext.getArguments())) { | ||
// do-nothing, we do not expect an exception | ||
return; | ||
} | ||
} |
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.
What we are trying to do here is use ExpectedPassingTestCasePredicate
to allow passing test being part of test cases of provided by @ParameterizedTest
this way we can keep test cases in one place (like @MethodSource
)
@cowtowncoder Now that we have additional implementation like one here, around |
try { | ||
invocation.proceed(); | ||
} catch (Throwable t) { | ||
// do-nothing, we do expect an exception |
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.
Is there an expectation of always getting an exception, to indicate failing test? I guess this is true in that assert-methods do throw assertion exceptions.
implements ExpectedPassingTestCasePredicate | ||
{ | ||
@Override | ||
public boolean shouldPass(List<Object> arguments) { |
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 am not so sure about this -- seems bit fragile and not very easy to understand. Is something like this expected for all "tofix" parameterized tests?
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.
Oh. Looks like this is just one case, maybe there is something special about that one.
import java.util.List; | ||
|
||
/** | ||
* Interface that defines a predicate to determine if a test case is expected to pass. |
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 assume "pass" here mean that test completes without exception? (if so, fine, if not should probably be explained further).
Resolves #1370