-
Notifications
You must be signed in to change notification settings - Fork 12
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
Scijava 36.0.0 breaks Mockito Wrapper tests #341
Comments
The offending methods in this example are: static <C extends Command> void test2DImagePlusCancelsPlugin(
final Gateway imageJ, final Class<C> commandClass) {
// SETUP
final UserInterface oldUI = imageJ.ui().getDefaultUI();
final UserInterface mockUI = mockUIDialogPrompt(imageJ);
final ImagePlus image = mock(ImagePlus.class);
when(image.getNSlices()).thenReturn(1);
try {
// EXECUTE
final CommandModule module = imageJ.command().run(commandClass, true,
"inputImage", image).get();
// VERIFY
assertTrue("2D image should have cancelled the plugin", module
.isCanceled());
assertEquals("Cancel reason is incorrect", CommonMessages.NOT_3D_IMAGE,
module.getCancelReason());
verify(mockUI, timeout(1000)).dialogPrompt(anyString(), anyString(), any(),
any());
} catch (InterruptedException | ExecutionException e) {
Assert.fail("Test timed out");
} finally {
imageJ.ui().setDefaultUI(oldUI);
}
} and (line number is weird though) public List<UserInterface> getVisibleUIs() {
final ArrayList<UserInterface> uis = new ArrayList<>();
for (final UserInterface ui : uiList()) {
if (ui.isVisible()) uis.add(ui);
}
return uis;
} |
Looks like |
This bug was introduced by |
Maven test reports for |
I just released pom-scijava 37.0.0 which does not fix this Mockito problem. But I wanted to mention that I haven't forgotten about this issue, and will try to investigate soon, and push another pom-scijava release fixing it. Thanks for the report and investigation so far, @mdoube. |
Thanks @ctrueden. I was thinking maybe we could try again to run these Mockito tests in the routine CI build via Github Actions. Richard pulled the slow tests out of the standard Maven build (so they have to be called specially with |
I think so... BoneJ2 is included in the melting pot build that runs every time pom-scijava is changed, which calls |
I made a PR #342 to see whether I could tweak the test configuration to make the wrapper tests run. They do, but I still get the same error even on older working versions of SciJava e.g. 34.1.0, when running as an automated build test on GitHub. Locally |
Just updated pom-scijava with the last Java 8 compatible Mockito so that wrapper tests run at all - they otherwise fail to build with an exception, on a new Eclipse installation. |
@mdoube IIUC: with Mockito 4.11.0, the tests compile and run, but... they still fail, right? Due to the |
Yes, I just checked with
I think so.
Looks like there is now 1 failing test (locally):
Plus lots of failing tests running under GitHub Actions, like this one, at https://github.com/bonej-org/BoneJ2/actions/runs/8613147702/job/23603867749?pr=342
|
Describe the bug
Updating
pom.xml
to use scijava 36.0.0 leads to the Mockito wrapper tests failing when runningmvn test -P allTests
Expected behavior
All the tests pass
Additional context
A large number of these errors are produced
The text was updated successfully, but these errors were encountered: