fix: pass the environment variables from the BSP server when running tests
Fixes https://github.com/com-lihaoyi/mill/issues/5039.
Metals has two code paths for running tests, one where the build server provides debugging support and another where it does not. Mill does not provide the debug support.
Now Metals correctly:
- invokes either
buildTarget/jvmRunEnvironmentorbuildTarget/jvmTestEnvironmentBSP commands. - actually uses the environment variables from those (previously only the classpath was used)
You should also run sbt scalafixAll.
This should be ready for merging now.
CI run failed (https://github.com/scalameta/metals/actions/runs/15799102190/job/44613791634?pr=7544#step:5:26417), but I can't find the actual error and locally the tests run just fine for me:
tests.mill.MillLspSuite:
+ basic 36.725s
+ new-dependency 41.994s
+ error 43.453s
+ fatal-warnings 31.596s
Execution took 2m33s
4 tests, 4 passed
All tests in tests.mill.MillLspSuite passed
================================================================================
Total duration: 2m33s
All 1 test suites passed.
================================================================================
Can someone help me pinpoint the issue?
Can someone help me pinpoint the issue?
It might be flaky, the Mill tests somehow are. Let's see if they pass now
It might be flaky, the Mill tests somehow are. Let's see if they pass now
It seems an unrelated test now failed due to flakyness. Can we get this PR merged?