Clarify `No installed package matching the input criteria was found` in upgrade flow
- [x] Have you signed the Contributor License Agreement?
- [x] Are you working against an Issue?
- #2869
- #2691
It seems to work, I am sorry. I was wondering about the message: "No installed package matching the input criteria was found". So I thought my installed software wasnt recognized by winget. I expected something like "No updates available" or something else.
This change provides a separate message when there are no matching search results found. In order to keep things clean, I switched the boolean parameter to an enum to allow for more fine-grained control over the messaging and to keep it extensible.
I also decided to not use the existing No applicable upgrade found message, as there is a difference between an upgrade being available and an upgrade being applicable. The message for applicability is still used when an upgrade is available, but an install attempt finds no upgrade that is applicable.
Edit: Since #2861 was merged, I rebased this PR due to a merge conflict and changed the SearchPurpose enum to a higher scope level to increase re-use. I did re-validate all of the happy-paths after the rebase.
Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget upgrade windirstat
No applicable upgrade found.
Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget list nothinginstalledmatchingthis
No installed package found matching input criteria.
Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget search nothinginsourcematchingthis
No package found matching input criteria.
Trenly@CORSAIR-JLU545 MINGW64 /d/Git/winget-cli (NoUpdatesFound)
$ winget uninstall nothinginstalledmatchingthis
No installed package found matching input criteria.
Microsoft Reviewers: Open in CodeFlow
@yao-msft - Could I trouble you for a few moments of your time?
@yao-msft - Could I trouble you for a few moments of your time?
Sorry, I'll take a look now.
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
##[error]There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.
I can't seem to find the Tests tab to tell me which one is failing ;-;
##[error]There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.
I can't seem to find the Tests tab to tell me which one is failing ;-;

Looks like some tests were looking for the strings you changed:
FAILED: REQUIRE( installOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos )
@yao-msft - Can you trigger the pipelines and hopefully the unit tests pass this time around?
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
The failing test is UpdateFlow_UpdateExeSpecificVersionNotApplicable With failing stack: REQUIRE( updateOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos ) with expansion: 18446744073709551615 (0xffffffffffffffff) != 18446744073709551615 (0xffffffffffffffff) \x1B[0mThe install technology of the newer version specified is different from the current version installed. Please uninstall the package and install the newer version.
at D:\a\1\s\src\AppInstallerCLITests\UpdateFlow.cpp(513)
The failing test is UpdateFlow_UpdateExeSpecificVersionNotApplicable With failing stack: REQUIRE( updateOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos ) with expansion: 18446744073709551615 (0xffffffffffffffff) != 18446744073709551615 (0xffffffffffffffff) \x1B[0mThe install technology of the newer version specified is different from the current version installed. Please uninstall the package and install the newer version.
at D:\a\1\s\src\AppInstallerCLITests\UpdateFlow.cpp(513)
Ah. That makes sense. I don't know why I didn't see that before. Thank you for the detail (and the patience with me, as for some reason my computer refuses to run the unit tests, even though I know I've set the certificates)
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
InstallExeFoundExistingConvertToUpgradeNoAvailableUpgrade e2e test failed
at AppInstallerCLIE2ETests.InstallCommand.InstallExeFoundExistingConvertToUpgradeNoAvailableUpgrade() in \src\AppInstallerCLIE2ETests\InstallCommand.cs:line 591
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run
I apologize in advance if the unit tests fail again. I keep getting certificate errors anytime I try to run them locally and I can't figure out why. I've followed the steps in the readme to generate the cert and start the local web server, but no dice
/azp run
I apologize in advance if the unit tests fail again. I keep getting certificate errors anytime I try to run them locally and I can't figure out why. I've followed the steps in the readme to generate the cert and start the local web server, but no dice
Those are for e2e tests. And yes it's quite complex to setup. For unit tests, I think you can just run the AppInstallerCliTests.exe, and it should just start. And if there are any test failures, I can help fix them directly if you are ok.