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

transitive runtime dependencies not available during tests #173

Closed
francisdb opened this issue Feb 26, 2018 · 8 comments · Fixed by #270
Closed

transitive runtime dependencies not available during tests #173

francisdb opened this issue Feb 26, 2018 · 8 comments · Fixed by #270
Assignees
Labels
solved The issue was fixed/resolved
Milestone

Comments

@francisdb
Copy link
Contributor

mill 0.1.3

I have tests using specs2 and specs2-mock
specs2-mock depends on mockito-core
mockito-core has runtime scoped dependencies declared

but when I run my tests they seem to be missing (this works correctly in sbt)

CAUSED BY
 java.lang.ClassNotFoundException: net.bytebuddy.dynamic.loading.ClassLoadingStrategy (Jvm.scala:115)
mill.modules.Jvm$$anon$1.findClass(Jvm.scala:115)
org.mockito.internal.creation.bytebuddy.SubclassByteBuddyMockMaker.<init>(SubclassByteBuddyMockMaker.java:33)
org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.<init>(ByteBuddyMockMaker.java:21)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:54)
org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:18)
org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:17)
org.mockito.internal.util.MockUtil.<clinit>(MockUtil.java:24)
org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java:22)
org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java:186)
org.mockito.internal.creation.MockSettingsImpl.confirm(MockSettingsImpl.java:180)
org.mockito.internal.MockitoCore.mock(MockitoCore.java:62)
org.mockito.Mockito.mock(Mockito.java:1729)
org.mockito.Mockito.mock(Mockito.java:1642)
@rockjam rockjam self-assigned this Mar 29, 2018
@rockjam
Copy link
Contributor

rockjam commented Mar 29, 2018

@francisdb Do you use the same version of specs2-mock in both mill and sbt version of build?

@francisdb
Copy link
Contributor Author

@rockjam yes same version but will first do another test now that #211 is fixed

@rockjam
Copy link
Contributor

rockjam commented Mar 30, 2018

I see. It looks like mockito is special in some regard, and it resolves differently from other libraries. You can check once again, but I'm pretty sure that this problem still persists

@francisdb
Copy link
Contributor Author

Confirmed to still be an issue. I guess coursier needs some extra config to include runtime scoped dependencies when mill is building the runClasspath

@rockjam
Copy link
Contributor

rockjam commented Mar 30, 2018

Yes, it seems so, however coursier cli handles mockito with runtime scoped dependencies nicely. I think that mill misses something in coursier integration code. I will look into it

@rockjam
Copy link
Contributor

rockjam commented Mar 31, 2018

@francisdb this issue is addressed by #270

@rockjam
Copy link
Contributor

rockjam commented Apr 1, 2018

@francisdb should be fixed in mill 0.1.7-28-bbd162 . Try it out

shengc pushed a commit to shengc/mill that referenced this issue Apr 2, 2018
@francisdb
Copy link
Contributor Author

I can confirm this is fixed on master 👍🏻

robby-phd added a commit that referenced this issue Apr 7, 2018
* fix build

* Detect sh/batch launcher, dev.assembly, and release filename.

* Updated appveyor cache.

* Added some entries for master in readme.md changelog.

* Updated readme.md changelog.

* fixes #173; use default(compile) configuration for deps as default (#270)

* revert #254 to fix bootstrapping #268

* Updated ci tests.

* Reverted Ammonite caching workaround (a796f0a) now that it's fixed

* Changed ci/test-mill-0.sh to use interactive mode due to intermittent client failures to connect to server in travis

* Added ci/test-mill-bootstrap.sh (ci/test-mill-0.sh with bootstrapping) and use it on oraclejdk9 instead of ci/test-mill-0.sh

* Upgraded mill used for ci to 0.1.7-29-f5097f

* revive #254 and fix #268 (#274)

* Test mill batch (.bat) in AppVeyor

* fix minor typos in docs

* Sync Ammonite in ScalaModule (with build.sc).
@lefou lefou added this to the 0.2.0 milestone May 2, 2019
@lefou lefou added the solved The issue was fixed/resolved label Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved The issue was fixed/resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants