-
Notifications
You must be signed in to change notification settings - Fork 130
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
Got SecurityException when running JUnit 5 tests #477
Comments
I did a quick look into the code and the problem seemed to be from trying to add a selector based on the Module in DiscoveryRequestCreator.java. options.getSelectedModules().stream().map(DiscoverySelectors::selectModule).forEach(selectors::add); I removed this selector and tested it out and everything seems to work fine now. |
@jbelford Thank you for your contribution. I tried to use a multi-root workspace which has JUnit 5 projects but cannot repro this issue. Could you please describe more about your workspaces? Or it will be great if you are willing to share a sample to repro. |
Interesting. I think it has something to do with large multi-root workspaces then. I've got a 40+ multi-root workspace composed of various maven projects. It might be a bug with vscode handling that many roots in a workspace. I also double checked again and I still see this error happening prior to the change but not after. OS: macOS High Sierra v10.13.3 |
I see, worth investigating more on this. The original code is copied from here Do you have any idea why removing this line will make it work? |
I will need to look into this more. I do not know why it doesn't work for large workspaces - so far only that selecting modules causes issue and doesn't seem to be needed. |
@jbelford Much appreciate for your effort! 😄 |
Small update to this problem - it turns out that multi-root workspaces are likely not the problem here. The tests I am seeing getting skipped and run into errors are when a maven project is part of a multi-maven project. |
@jbelford Does this problem still occur in the newest Test Runner extension? |
@jdneo Unfortunately this is still present 😕 |
@keigezellig Did you meet the same problem as @jbelford's? |
@jbelford I'm suspecting that the problem is caused because the jars are signed before publishing. See: https://stackoverflow.com/questions/2877262/java-securityexception-signer-information-does-not-match Let me take a look. |
@keigezellig @jbelford Would be very appreciated if you can provide any sample project that can help us to repro this issue. |
So after some investigation, I think I might find out the root cause of this issue: Now we are using the assembly plugin to generate a fat jar and sign the fat jar, this will break the sign information of the dependencies. The recommended way is to use jar-plugin to package the executable jar and sign it. Meanwhile, use dependency-plugin to put the dependencies into the lib folder |
Thanks for taking a look :D |
Thank you for your help @jbelford. I'll check if it is possible to provide a private signed-build to you 😃 |
Hi @jbelford, could you please find me in the gitter channel, I'll give you a private build there. Thank you. |
I've had this issue for a while. Essentially, if I open up a project folder directly I can run JUnit5 tests.
If I am in a multi-root workspace it will skip JUnit5 tests when I try to run them. JUnit4 tests seem to still work fine though.
Here's the log
Using extension version 0.11.1 and vscode 1.29.1
The text was updated successfully, but these errors were encountered: