#2251: add uninstall support for global tools windows - #2301
Conversation
86cac90 to
15b6180
Compare
15b6180 to
cbae6d3
Compare
Coverage Report for CI Build 31963401188Warning No base build found for commit Coverage: 72.887%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
cbae6d3 to
bab534c
Compare
|
Good work. All unit tests are passed. Could not test with pgAdmin installation as it does not work in my enviroment |
JoelAdbu
left a comment
There was a problem hiding this comment.
I also tested the installation and uninstallation of pgAdmin. Everything works perfectly. Well done!
| private String findUninstallKey(String appName) { | ||
|
|
||
| for (String registryBasePath : REGISTRY_BASE_PATHS) { | ||
| LOG.warn("Searching registry for {} in {}", appName, registryBasePath); |
There was a problem hiding this comment.
This is not a reasonable warning. Was that added for debugging and accidentally committed?
Otherwise this should be debug or trace.
| WindowsHelperImpl helper = new WindowsHelperImpl(context) { | ||
|
|
||
| @Override | ||
| public WindowsAppInstallation getAppInstallationFromRegistry( | ||
| String requestedAppName) { | ||
|
|
||
| assertThat(requestedAppName).isEqualTo(appName); | ||
|
|
||
| return new WindowsAppInstallation( | ||
| "1.0", | ||
| null, | ||
| uninstallString, | ||
| "C:\\Program Files\\Test"); | ||
| } | ||
|
|
||
| @Override | ||
| protected void executeUninstallCommand(String command) { | ||
| capturedCommand[0] = command; | ||
| } | ||
| }; |
There was a problem hiding this comment.
Instead of putting multiple redundant such anonymous classes into tests, you should simply extend WindowsHelperMock properly. I see two options:
- override
uninsallApplicationto simply remove the app fromregistryMap. - override the
executeUninstallCommandto capture the executed uninstall command without actually executing it and give a way to access it from tests e.g. via getter or even customassertThatlike we did for our logs. - do not override anything and just register a test application with uninstall command
echo test application has been uninstalledso you can assert thattest application has been uninstalledwas logged.
| * https://github.com/devonfw/IDEasy/issues/2131[#2131]: Improve `ide upgrade --mode=` auto-completion | ||
| * https://github.com/devonfw/IDEasy/issues/1870[#1870]: Add generic get-version implementation for global tools under windows | ||
| * https://github.com/devonfw/IDEasy/issues/1558[#1558]: Added installation log information to the "Select Project Folder" and exit dialogs and enhanced `windows-installer/README.adoc`. | ||
| * https://github.com/devonfw/IDEasy/issues/2251[#2251]: Provide generic uninstall support for globally installed tools (windows) |
There was a problem hiding this comment.
Sorry for the late review. You need to move this up to the current release.
This PR fixes #2251
Implemented changes:
Testing instructions
./build-local-dev.sh.ide install pgAdmin.ide -d uninstall pgadmin.Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.batand notfeature/921 fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internalpom.xmlfiles or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc