-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use JVM opts in test called by code lens #239
Comments
Thanks for reporting! It's not possible to do it currently, best to open an issue here https://github.com/scalameta/metals-feature-requests/issues We can also just move the issue there if you prefer. |
Okay thanks, please move this issue if possible :) |
First action would be to add an ability for BSP to specify jvm options for running test classes |
Is this a Bloop issue? Does sbt BSP have the same problem? |
Bloop and sbt have the same problem. To run the tests, the current implementation in Bloop and sbt only accepts a list of test suites, as However I don't think we need to add anything to BSP. We already have So we just need to adapt the implementation in Bloop, sbt and Metals. |
Does sbt use those JVM options when running |
Agreed that the However I think that export interface ScalaMainClassesItem {
/** The build target that contains the test classes. */
target: BuildTargetIdentifier;
/** The main class item. */
classes: ScalaMainClass[];
}
export interface ScalaMainClass {
/** The main class to run. */
class: String;
/** The user arguments to the main entrypoint. */
arguments: String[];
/** The jvm options for the application. */
jvmOptions: String[];
/** The environment variables for the application. */
environmentVariables?: String[];
} Unfortunately export interface ScalaTestClassesItem {
/** The build target that contains the test classes. */
target: BuildTargetIdentifier;
/** The fully qualified names of the test classes in this target */
classes: String[];
} And I think it should be: export interface ScalaTestClassesItem {
/** The build target that contains the test classes. */
target: BuildTargetIdentifier;
/** The jvm options for the application. */
jvmOptions: String[];
/** The environment variables for the application. */
environmentVariables?: String[];
/** The fully qualified names of the test classes in this target */
classes: String[];
} Assuming Metals receives those
Option 1 is easier to use in Metals but it won't be possible to override the existing options. I am slightly more in favor of 1 because in any case the user can change the |
Until this feature is implemented, do you think there a workaround? |
Do you use sbt or Bloop as the build server? If sbt you can try to set |
Thanks, will try asap (blocked by scalameta/metals-vscode#758 atm...) |
|
Has this been solved? I'm still seeing this issue and can't seem to get my Scala tests to respect the JVM args for |
I'd like to launch tests using the code lens given by metal, however I need options set in
.jvmopts
:This applies when I run
sbt test
and test pass, but not when I use Metal's code lens.How can I fix that?
The text was updated successfully, but these errors were encountered: