-
Notifications
You must be signed in to change notification settings - Fork 26
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
#898: Improved output of get-version/edition and uninstall/-plugin #903
base: main
Are you sure you want to change the base?
#898: Improved output of get-version/edition and uninstall/-plugin #903
Conversation
Edition/VersionGetCommandlet changed them to log the configured option if the tool is not installed and the installed option if it is installed. Changed the toolInstallInfo method to log into IdeSublogger instead of using context.info or context.warning. Changed the uninstall commandlet to log a warning in case the requested commandlet is not installed. Changed the uninstallPlugin commandlet to give feedback wether the plugin could be deleted or if there was not installation found. Adjusted Tests for Edition/VersionGetCommandlet as well as Uninstall commandlet to expect the correct loglevel or content of logged messages. Added logAtProccessable to IdeTestContextAssertions to check if a log-message was logged on PROCESSABLE-level. Added .ide.software.version file to the npm software in the basic ide-test-project-ressource, since it was needed to test my implementation.
added CHANGELOG entry
Pull Request Test Coverage Report for Build 12435451937Details
💛 - Coveralls |
cli/src/main/java/com/devonfw/tools/ide/commandlet/VersionGetCommandlet.java
Outdated
Show resolved
Hide resolved
@jan-vcapgemini please have a look. |
So if I get this correct, the test was expecting the message |
* @return 0 if the uninstallation was successfull and 1 if it failed | ||
*/ | ||
public void uninstallPlugin(ToolPluginDescriptor plugin) { | ||
public int uninstallPlugin(ToolPluginDescriptor plugin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
boolean
success flag instead of int
?
Or throw an exception in case of failure/error?
Or do the logging in this method and keep void
return type?
IMHO the last option makes to most sense.
assertThat(context).log().hasEntries(IdeLogEntry.ofProcessable("No installation of tool java was found."), | ||
IdeLogEntry.ofProcessable("The configured edition for tool java is java"), | ||
IdeLogEntry.ofProcessable("To install that edition call the following command:"), | ||
IdeLogEntry.ofProcessable("ide install java")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment about the failing test...
assertThat(context).log().hasEntries(IdeLogEntry.ofProcessable("No installation of tool java was found."), | |
IdeLogEntry.ofProcessable("The configured edition for tool java is java"), | |
IdeLogEntry.ofProcessable("To install that edition call the following command:"), | |
IdeLogEntry.ofProcessable("ide install java")); | |
assertThat(context).log().hasEntries(IdeLogEntry.ofProcessable("java")); |
IdeLogEntry.ofInfo("The configured edition for tool az is az"), | ||
IdeLogEntry.ofInfo("To install that edition call the following command:"), | ||
IdeLogEntry.ofInfo("ide install az")); | ||
assertThat(context).logAtProcessable().hasMessage("az"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here it seems vice versa. The output in the test was like this:
14:20:56.527 [main] - INFO - c.d.tools.ide.log.IdeSubLoggerSlf4j - PROCESSABLE:No installation of tool az was found.
14:20:56.527 [main] - INFO - c.d.tools.ide.log.IdeSubLoggerSlf4j - PROCESSABLE:The configured edition for tool az is az
14:20:56.527 [main] - INFO - c.d.tools.ide.log.IdeSubLoggerSlf4j - PROCESSABLE:To install that edition call the following command:
14:20:56.527 [main] - INFO - c.d.tools.ide.log.IdeSubLoggerSlf4j - PROCESSABLE:ide install az
So IMHO something is still broken with the implementation.
Closes: #898
Edition/VersionGetCommandlet changed them to log the configured option if the tool is not installed and the installed option if it is installed.
Changed the toolInstallInfo method to log into IdeSublogger instead of using context.info or context.warning.
Changed the uninstall commandlet to log a warning in case the requested commandlet is not installed.
Changed the uninstallPlugin commandlet to give feedback wether the plugin could be deleted or if there was not installation found.
Adjusted Tests for Edition/VersionGetCommandlet as well as Uninstall commandlet to expect the correct loglevel or content of logged messages.
Added logAtProccessable to IdeTestContextAssertions to check if a log-message was logged on PROCESSABLE-level.
Added .ide.software.version file to the npm software in the basic ide-test-project-ressource, since it was needed to test my implementation.