Vscode-java-test: Always use test configuration or make it configurable

Created on 5 Aug 2018  路  5Comments  路  Source: microsoft/vscode-java-test

Java Test Runner 0.7.1

For out tests we need to provide env and vmargs, but they don't work with code lens (which actually took quite some time to realize). We use Code lens a lot since we practice TDD.

Ideally, once we define test run/debug configuration - it should be automatically picked up everywhere: in Test Explorer, Code Lens, Maven test, etc.

It would help to have the following configuration options for this extension:

  • show/hide "Run/Debug with Config" in Code Lens
  • configuration to use in "Run with Config" in Code Lens = none/ref to cfg
  • configuration to use in "Debug with Config" in Code Lens = none/ref to cfg
enhancement

Most helpful comment

@ansyral Actually, my point is quite the opposite from what you did: if there is a config to run test - then there is no use for running tests without the config.

If project has config - it means that it is needed. I cannot find any use case why would I create a config and later want to run without it. This is a primary use case.

If project has 2+ configs (which is most likely only a very tiny % of all the projects) - then you need a way to pick a config on start or configure default one. So, support for those rare projects should not complicate config usage for simple projects.

In all our current projects in 99% cases we run/debug tests from Code Lens and in 100% of our test runs we need a configuration. We ended up creating our own runtime configuration loading since current VSCode config approach doesn't work for us.

All 5 comments

@lashchev unfortunately we removed Run/Debug with Config from the code lens as it would make the code lens rather long and not every one needs this feature. Adding an option to show/hide is a good way. However, we also provide a default property for people who use this feature often, you can edit your test config and specify the default field with the name of a config item, and then this config item would be picked even you choose Run/Debug. Does this make sense to you? Looking forward to your feedback.

@ansyral Actually, my point is quite the opposite from what you did: if there is a config to run test - then there is no use for running tests without the config.

If project has config - it means that it is needed. I cannot find any use case why would I create a config and later want to run without it. This is a primary use case.

If project has 2+ configs (which is most likely only a very tiny % of all the projects) - then you need a way to pick a config on start or configure default one. So, support for those rare projects should not complicate config usage for simple projects.

In all our current projects in 99% cases we run/debug tests from Code Lens and in 100% of our test runs we need a configuration. We ended up creating our own runtime configuration loading since current VSCode config approach doesn't work for us.

@lashchev I think your requirement should be achieved if we resolve #524.

Please feel free to let us know your thoughts about it.

Closing this issue since the experience of running/debugging with configuration has been changed.

More details can be found here: https://aka.ms/java-test-config

Works great for me. Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NikolasKomonen picture NikolasKomonen  路  3Comments

gabloe picture gabloe  路  7Comments

brianngo313 picture brianngo313  路  6Comments

spottedmahn picture spottedmahn  路  7Comments

jimliuxyz picture jimliuxyz  路  7Comments