Announcement Announcement Module
No announcement yet.
Gradle tests run automatically even though Test task isn't selected Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gradle tests run automatically even though Test task isn't selected


    I'm running gradle in eclipse.
    I was wondering if you could add an explicit "-x test" to the command if the Test task isn't selected from the build model in the next release.
    Currently gradle 1.4 looks through the code that is being compiled & if it finds test classes it executes them.
    So for the tests not to run you need to explicitly add -x test to the command.



  • Kris De Volder
    You can probably add the commandline options via either one of these two mechanisms:

    1) Workspace Gradle preferences. Open "Window >> Preferences >> Gradle >> Arguments"

    2) Via the "Gradle Launch Configuration Editor". You get this one, for example, when "Run As >> Gradle Build" from the project context menu. The editor has an 'Arguments' tab.

    Launch configurations are saved in the workspace. So it should remember the arguments if you run the same tasks next time. And you can also get to them via the "run" menu. "Run >> External Tools >> External Tools Configuration >> Gradle".

    It sounds to me though like you are arguing that running the tests should not be the default behavior for a build. That seems to be what the Gradle Devs have chosen to do. If you disagree you should probably argue with them about changing that. I doesn't seem like a great idea for Gradle tools to make the IDE tools explicitly deviate from the default behavior.

    But... I hope the options to add '-x test' via global preferences in STS might work for your use case.


    Leave a comment: