-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Revert changes to method search algorithm #3600
Comments
Never mind, it has apparently been declared in 5.10.1... Three questions:
Thanks! |
Reopening as this really breaks a lot for me... Would you accept a PR for an annotation |
What was declared in the release notes for 5.10.1 is that the documentation for the existing behavior was improved. As far as I know, we did not intentionally change the behavior for Are you saying your sample project demonstrates a change in behavior for |
Relates to #3462 |
Hi @sbrannen - where you able to verify the example project showing the change with |
Thanks for the reproducer! I can confirm that the behavior has indeed changed: public abstract class AbstractJUnitTest {
@Test
protected void someTestMethod() {
System.out.println("This should not run as disabled by AnstractJUnitTest2");
throw new RuntimeException("Should not be thrown");
}
@Test
protected void anotherTestMethod() {
System.out.println("This should run");
}
} public abstract class AbstractJUnitTest2 extends AbstractJUnitTest {
@Override
@Disabled
protected void someTestMethod() {
super.someTestMethod();
}
} public class JUnitTest3 extends AbstractJUnitTest2{
} In 5.10.0, |
If you rewrite public abstract class AbstractJUnitTest2 extends AbstractJUnitTest {
@Disabled
@Test
@Override
protected void someTestMethod() {
super.someTestMethod();
}
} If I recall correctly, we have never claimed in JUnit Jupiter that a So, I consider that the expected behavior (or at lest the behavior we originally intended). In light of that, I actually consider it a bug that the scenario without |
@Disabled
Here's a simplified all-in-one reproducer. class DisabledReproTests extends AbstractJUnitTest {
@Disabled
// @Test
@Override
void someTestMethod() {
super.someTestMethod();
}
}
abstract class AbstractJUnitTest {
@Test
void someTestMethod() {
throw new RuntimeException("Boom!");
}
} As has been pointed out, this scenario results in a test failure (unless you uncomment However, I think that should actually result in "no tests found", since So, let's discuss that behavior within the team. |
@Disabled
@Disabled
on a @Test
method
After further analysis, I realized that With 5.10.0 (and earlier versions), if you override a The reason is that the overriding method will no longer be discovered as a However, the change in 5.10.1 is in fact a regression since JUnit no longer "sees" the overriding method and therefore detects the overridden method in the super class as a valid In light of that, we have scheduled this for 5.10.2 and will investigate how best to address this in |
@Disabled
on a @Test
method
For the sake of clarity for anyone following this issue...
In 5.10.0, it is not discovered as a test method and therefore is also not reported as skipped.
That's correct. |
You guys are the best! Thanks for all the investigation... |
…3685) Overridden methods from `GenericBoundedElasticThreadPerTaskShedulerTest` were not previously executed but are now due to [a regression in junit](junit-team/junit5#3600 (comment)). This change restores the original behaviour of assumptions and excludes such tests using the parent class' facility.
that's correct, but sometimes not desirable, especially that IDEs like IntelliJ make it easy to override a test method, but do not add |
See junit-team/junit5#3600 In 5.10.1, the behavior changed and overridden tests now also need to be annotated with a test annotation.
See junit-team/junit5#3600 In 5.10.1, the behavior changed and overridden tests now also need to be annotated with a test annotation.
See junit-team/junit5#3600 In 5.10.1, the behavior changed and overridden tests now also need to be annotated with a test annotation.
Hi there, I'm Ronald, the creator of JobRunr. When upgrading my dependencies to 5.10.1 from 5.10.0, I noticed a breaking change which was not declared in the release notes.
When using tests and inheritance (which I do for testing JobRunr against different DB's), I noticed that
@Disabled
was not taking into account anymore in v5.10.1 whereas that was the case in v5.10.0.Steps to reproduce
Please see https://github.com/rdehuyss/junit-issue-disabled
If you run the test JUnitTest3, you notice that it fails. If you downgrade to 5.10.0, all is well again.
Context
The text was updated successfully, but these errors were encountered: