microsoft / microsoft/aspire

Backfill parameterized unit tests for version-label-sensitive CLI / acquisition code paths

Open
#17,318 1 comment 0 reactions 0 assignees View on GitHub
area-cli triage:bot-seen
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 15h
Merged PRs (30d)
196

Description

Follow-up to #15681 / #15335.

Now that PR builds stay on prerelease versions (with the new `stabilization_check` job exercising stable shape only in a dedicated CI lane), the bulk of Aspire test execution against **stable-versioned** Aspire assemblies happens in that one lane and in the eventual stabilization PR. Code paths in the CLI / acquisition layers that branch on prerelease-vs-stable (e.g. `IsPrerelease`, channel detection, update-check, template version pinning) historically only get coverage when stabilization is on.

**Action:** audit `src/Aspire.Cli/` and the acquisition code (`get-aspire-cli*.{sh,ps1}` + their test fixtures) for branches that depend on whether a SemVer string is stable. For each, add unit/theory tests that feed in:

- `13.4.0` (clean stable)
- `13.4.0-dev.123` (Arcade dev build)
- `13.4.0-preview.1.123`
- `13.4.0-pr.NNNNN.gSHA-dev.NNNNN` (PR build with version suffix)
- `13.4.0-rc.1`

so the logic is exercised against the full space of version-label shapes regardless of the build flavor the test binary happened to be packed under.

**Why this matters:** even with the new `stabilization_check` job catching pack-time NU5104 + restore-against-stable-feed smoke, version-label-sensitive logic in the CLI is still only run against the prerelease label in regular PR CI. Backfilling parameterized theories closes the gap independent of CI build flavor.

Out of scope for #15681 — that PR is already cross-cutting and adding test backfill there would balloon the diff.

Originally raised as M1 in the discussion on #15681.

Contributor guide

Open the contributing guide

Research direction

Start by auditing src/Aspire.Cli/ for branches involving IsPrerelease, channel detection, update checks, or template version pinning, then inspect get-aspire-cli*.{sh,ps1} and their test fixtures. Add parameterized theories covering each version shape listed in the issue, and verify that all stable-versus-prerelease paths are exercised independently of the build flavor.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell, shell
Domain
cli, testing
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.