microsoft / microsoft/winget-cli

Add E2E coverage for the WinGetSourceCreator / IndexCreationTool layer

Open
#6,434 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Type: Bug (missing test coverage)
Area: WinGetSourceCreator, IndexCreationTool

There is good coverage for the low-level index API, but not for the layer above
it that actually assembles a source.

WinGetUtilSQLiteIndex.cs (src/AppInstallerCLIE2ETests/WinGetUtil/) already
tests the WinGetUtil SQLite index directly - add/update/remove manifest,
open/close, PrepareForPackaging + consistency check. That coverage is solid,
but it feeds a single pre-merged manifest file straight into the index API.

What isn't covered is the WinGetSourceCreator / IndexCreationTool layer that
sits on top of it - the part that discovers manifests, copies them into the
working directory, handles multi-file manifests, and drives the index build.
Today that layer is only run as unverified test setup:

  • TestIndex.GenerateE2ESource() (src/AppInstallerCLIE2ETests/Helpers/TestIndex.cs)
    calls WinGetLocalSource.CreateLocalSource(...).
  • It runs from [OneTimeSetUp] in src/AppInstallerCLIE2ETests/SetUpFixture.cs
    to build the source that other tests search against, so it isn't itself a test
    of the source-creation path and the produced index isn't verified.
  • The manifests it uses are all singleton, so the multi-file layout never goes
    through this path.

Because nothing exercises this layer directly, regressions in it can go
unnoticed for a long time. Two examples:

  • #4181 (re-filed as #6426) - the tool looks for data in the WorkingDirectory
    that isn't there; open for ~2 years.
  • #6433 - multi-file manifests can't be indexed.

Request

Could we add an E2E test for the WinGetSourceCreator / IndexCreationTool
path that builds a source from both a singleton and a multi-file manifest and
asserts the expected packages end up in the resulting index? This complements
the existing WinGetUtilSQLiteIndex tests rather than duplicating them.

We'd be glad to open a PR with this test if a maintainer is willing to review it.

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 WinGetUtilSQLiteIndex.cs in src/AppInstallerCLIE2ETests/WinGetUtil/ and follow TestIndex.GenerateE2ESource() in src/AppInstallerCLIE2ETests/Helpers/TestIndex.cs, including its OneTimeSetUp use in SetUpFixture.cs. Add E2E coverage that builds a source from singleton and multi-file manifests, then verify the expected packages are present in the resulting index.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.