vscode-maven icon indicating copy to clipboard operation
vscode-maven copied to clipboard

Feature request: toggle to skip tests

Open duke1995 opened this issue 3 years ago • 3 comments

Temporarily disabling the Maven test phase is something that is often done during development, for example to speed up the Maven build process. It would be handy if there were a button in the Maven view in the sidebar to easily toggle "Skip tests" for all phases, for example next to the other buttons in the main Maven toolbar: Visual Studio Code Maven View

duke1995 avatar Dec 06 '21 19:12 duke1995

maven.executable.options: Specifies default options for all mvn commands. E.g. -o -DskipTests

You can modify maven.executable.options. And as far as I know you can also use profiles to achieve that.

Eskibear avatar Dec 07 '21 02:12 Eskibear

maven.executable.options: Specifies default options for all mvn commands. E.g. -o -DskipTests

You can modify maven.executable.options. And as far as I know you can also use profiles to achieve that.

Thank you for your quick reply and for your recommendations. As a matter of fact, for the moment I am already using the solution of modifying maven.executable.options, but as I often switch the "skip tests" mode on and off, I thought it would be handy to be able to do this directly in the interface by toggling a button instead of having to go and change the settings manually every time.

By the way, a similar button to toggle offline mode on and off might be handy too (I see this option is enabled also in your example).

duke1995 avatar Dec 07 '21 21:12 duke1995

Neither toggle for "skip test" (simply adding -DskipTests) nor visual profile manager are present on maven plugin.

It would be nice and useful having them available!

giosooul avatar May 24 '22 21:05 giosooul

The profile support is on the plan, as long as the checkbox api is ready in vscode, we can implement it. See https://github.com/microsoft/vscode-maven/issues/744#issuecomment-1274327955 Hope it would mitigate the issue a little bit.

And I agree that a switch button would be super convenient, but it looks tricky to me and not generic enough. As someone wants to turn "-DskipTests" on and off, while someone else focus on "-o“, or both. Then we might add a new setting like maven.quickSwitchButton.command to configure the command, it's feasible. However, is it possible that you need two switch buttons to control "skipTests" and "offline" respectively...

Eskibear avatar Nov 28 '22 02:11 Eskibear