OpenLiberty / ci.gradle

Gradle plugins for managing Liberty profile servers #devops
Apache License 2.0
48 stars 49 forks source link

Questions on skipTests behavior #889

Open sreich opened 2 weeks ago

sreich commented 2 weeks ago

According to docs: skipTests If this option is enabled, do not run any tests in dev mode. The default value is false.

What does behavior does this create exactly?

cherylking commented 2 weeks ago

@sreich All excellent questions which caused us to go back and look at how this design evolved over the years. Let me answer them here and then we will make some updates to the docs accordingly.

Does Dev mode by default run tests after every change? I thought that was only the hot tests command?

Tests are only run after every change if hotTests is set to true. The default for hotTests is false.

How about for first run on dev mode?

The first run of dev mode will not cause tests to run unless hotTests is set to true.

Does this effectively disable explicitly telling it to run tests, like when pressing the enter command?

Yes, setting skipTests to true disables the running of tests while in dev mode when pressing the enter key. It also overrides the setting for hotTests. So if hotTests is set to true and skipTests is set to true, then no tests will run either with the enter key or automatically after changes occur. The default for skipTests is false.

cherylking commented 2 weeks ago

In addition to updating docs for this, we should make the following updates to the code:

  1. Do not print the message "To run tests on demand, press Enter." when skipTests has been set to true.
  2. Do not print the message "Tests will run automatically when changes are detected. You can also press the Enter key to run tests on demand." when hotTests is set to true and skipTests is also set to true.
  3. When the Enter key is pressed in dev mode and skipTests is set to true, print a message like "Tests will not run on demand because the skipTests parameter has been set to true."

It would also be a good idea to log a message when both skipTests and hotTests are set to true to warn the user that the hotTests configuration has been overridden and tests will not run automatically after changes occur.

sreich commented 2 weeks ago

Excellent, this clears that up. And thank you for taking action items for improving the docs & especially the log messages! 😄