-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Tests loading resources don't work in Intellij triggered tests with BSP import #4427
Comments
Is there a reason you use Mill 0.12.3 to reproduce, which is not the latest at them time you opened this issue? Also, a quick idea: could you try to rename the |
I can reproduce the issue with Mill |
Sorry, I should have put the latest version. Editing the reproduction step with 0.12.5 |
I noticed this too and was thinking it's an Intellij bug. mkdir mill-issue-4427-mill-older-works && cd $_
curl -L https://github.com/com-lihaoyi/mill/releases/download/0.12.5/0.12.5 > mill && chmod +x mill
cat > build.sc <<EOF
import mill._
import mill.scalalib._
object project extends ScalaModule {
override def scalaVersion = "2.13.15"
object test extends Tests with TestModule.Munit {
override def ivyDeps = Agg(ivy"org.scalameta::munit::1.0.4")
}
}
EOF
cat > .mill-version <<EOF
0.10.15
EOF
mkdir -p project/test/src
cat > project/test/src/Test.scala <<EOF
class Test extends munit.FunSuite {
test("Load resources") {
assert(getClass.getResource(s"/somefile") != null, "Unable to find somefile in the resources")
}
}
EOF
mkdir -p project/test/resources
cat > project/test/resources/somefile <<EOF
blablabla
EOF |
Reproduce
The following works:
But if you open the project in Intellij (loads with BSP), open the
Test.scala
file and run the test with the Run button next to the test decalaration:It fails to find the resource:
I tested a similar setup with Scala CLI and Intellij to make sure it's a mill issue and not an Intellij issue. Works fine with Scala CLI.
Thanks
The text was updated successfully, but these errors were encountered: