microsoft / microsoft/winget-cli

COM InProc E2E tests cannot load the string resources

Open
#2,447 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

In the COM InProc E2E tests, if the COM call hits a path that needs to resolve a string resource, the call will fail with "File Not Found" when looking for the resources file, which later causes the tests to fail.

Steps to reproduce
  1. Add a use of the ResourceLoader in a path used by the COM commands, for example a Resource::LocString{ someStringId } in any common code path.
  2. Build the project.
  3. Copy the WindowsPackageManager.dll to the E2E tests build output folder (needed to run the InProc tests)
  4. Run the tests
Expected behavior

The tests should pass

Actual behavior

The tests fail due to the COM call not finding the Resources.pri. Using ProcMon one can see that it is looking for it under C:\Program Files\dotnet\Resources.pri, which likely means it's trying to find it next to the executable running.

A hacky solution is to copy the file there (and it did work for me), but we should find a better way before we hit this.

Environment
N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the COM InProc E2E tests and the COM command paths that use ResourceLoader. Reproduce the failure after copying WindowsPackageManager.dll to the E2E test output folder, then use ProcMon to confirm where Resources.pri is searched for. Done means the tests can resolve string resources without copying Resources.pri to C:\Program Files\dotnet.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.