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

Fix build, remove TestModule.UTest from AmmInternalModule #1389

Merged
merged 1 commit into from
Nov 26, 2023
Merged

Conversation

lefou
Copy link
Member

@lefou lefou commented Nov 26, 2023

This fixes the issue #1386:

> ./mill -i amm.repl[3.2.2].test
GITHUB REF None
fatal: no tag exactly matches 'cdeaa580bf128779686991a838623dd3a75af49b'
[296/296] amm.repl[3.2.2].test
java.lang.ClassNotFoundException: utest.runner.Framework
java.lang.ClassNotFoundException: utest.runner.Framework
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
    at mill.api.ClassLoader$$anon$1.findClass(ClassLoader.scala:47)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:594)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
    at mill.testrunner.TestRunner$.framework(TestRunner.scala:412)
    at mill.testrunner.TestRunner$.$anonfun$main$2(TestRunner.scala:252)
    at mill.testrunner.TestRunner$.$anonfun$runTestFramework$2(TestRunner.scala:326)
    at mill.util.Jvm$.inprocess(Jvm.scala:30)
    at mill.testrunner.TestRunner$.runTestFramework(TestRunner.scala:320)
    at mill.testrunner.TestRunner$.main(TestRunner.scala:258)
    at mill.testrunner.TestRunner.main(TestRunner.scala)
1 targets failed
amm.repl[3.2.2].test Test execution failed.

The issue is, that amm.repl[3.2.2] (defined by ReplModule which extends AmmModule which itself extends AmmoniteInternalModule) is itself a TestModule.UTest. That means, it already has a test target, so that the resolver will never search for a submodule that implements a defaultCommand.

After removing TestModule.UTest from AmmoniteInternalModule, the cli call properly resolves to amm.repl[3.2.2].test.test.

I'm curious to know, why this even compiled. We end up with two class members test, one def with the test target, and one object with the test sub-module.

@lefou lefou linked an issue Nov 26, 2023 that may be closed by this pull request
@lefou lefou merged commit 89836cd into main Nov 26, 2023
@lefou lefou deleted the fix-build branch November 26, 2023 22:41
@lefou lefou added this to the 3.0.0-M1 milestone Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

running tests failed unable to find utest
2 participants