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

Now tests with assumption violations are flagged with 'I' #1528

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/junit/runner/Result.java
Expand Up @@ -137,7 +137,7 @@ public void testIgnored(Description description) throws Exception {

@Override
public void testAssumptionFailure(Failure failure) {
ignoreCount.getAndIncrement();
// do nothing: same as passing (for 4.5; may change in 4.6)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is absolutely wrong. We rely on it!
You cannot remove the line. There is no field counter for assumptions and even if it was there, it is a change in behavior in all other frameworks and their integration tests will fail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tibor17 I suggest commenting on the bug.

}
}

Expand Down
Expand Up @@ -40,7 +40,7 @@ public void assumptionsFail() {
public void failedAssumptionsMeanPassing() {
Result result = JUnitCore.runClasses(HasFailingAssumption.class);
assertThat(result.getRunCount(), is(1));
assertThat(result.getIgnoreCount(), is(1));
assertThat(result.getIgnoreCount(), is(0));
assertThat(result.getFailureCount(), is(0));
}

Expand Down
Expand Up @@ -808,7 +808,7 @@ public void testAssumptionFailure(Failure failure) {
Result failureResult = core.run(ParameterizedAssumtionViolation.class);
assertTrue(failureResult.wasSuccessful());
assertEquals(0, failureResult.getRunCount());
assertEquals(1, failureResult.getIgnoreCount());
assertEquals(0, failureResult.getIgnoreCount());
assertEquals(1, assumptionFailures.size());
}
}