Repository navigation
Releases.Tests.ps1: replace hardcoded external dependency on ryanoasis/nerd-fonts #591
Description
Releases.Tests.ps1 contains one It block that exercises Get-GitHubRelease piping into Get-GitHubReleaseAsset — a valid pipeline-input code path worth testing. Today that block uses the public third-party repository ryanoasis/nerd-fonts as its data source.
Request
What is confusing or missing
The test has no connection to nerd-fonts as a concept. The repository is used purely because it has a release with many large assets attached — a property that any repository with release assets has. Using an external repository introduces a class of failures that have nothing to do with the module under test:
- The release, its tag, or its assets could be removed or renamed at any time by a third party.
- GitHub rate-limits unauthenticated and authenticated requests. A release with many large assets puts extra pressure on the shared secondary rate limit budget that #541 was specifically designed to protect.
- The test is blocked in air-gapped or restricted environments.
- The assertion is implicitly coupled to the shape of nerd-fonts releases (many assets, specific content types) — that shape can change.
The test should use assets already uploaded to the shared test repository during the same context BeforeAll, which the Release Assets sub-context creates specifically for this purpose. Those assets exist for the full duration of the test run and cover all content types needed to exercise the pipeline path.
Acceptance criteria
- The
Get-GitHubReleaseAsset - Gets assets from release using pipelinetest no longer references any repository outsidePSModuleor the test account family (psmodule-test-org,psmodule-test-org2, etc.). - The test continues to verify that a
Get-GitHubReleaseresult can be piped intoGet-GitHubReleaseAssetand that the returned collection matches the[GitHubReleaseAsset]type contract. - The test uses assets from the shared test repository that were already uploaded in the same
Release AssetscontextBeforeAll. - No new API calls to third-party repositories are made anywhere in the test suite.
Technical decisions
Replacement source: The Release Assets sub-context in Releases.Tests.ps1 already uploads several assets (TextFile.txt, Documentation.md, Config.json, Data.xml, Records.csv, a ZIP) to the latest release on $repo in its BeforeAll. That release is available as $release within the context. The pipeline test should call Get-GitHubRelease -Owner $Owner -Repository $repo and pipe to Get-GitHubReleaseAsset — identical pipeline semantics, internal data source.
Assertion adjustment: The existing assertions check $assets.Count | Should -BeGreaterThan 0 and validate each asset's type contract. The count and content-type values will reflect the test-controlled assets rather than nerd-fonts, so the count assertion stays valid (-BeGreaterThan 0) or can be made exact if desired. The per-asset assertions are already property-shape checks and require no changes.
No structural change needed: The replacement is a one-line change to the Get-GitHubRelease call — swap Owner ryanoasis -Repository nerd-fonts for -Owner $Owner -Repository $repo. The rest of the It block is unchanged.
Implementation plan
Core changes
- Replace
Get-GitHubRelease -Owner ryanoasis -Repository nerd-fontswithGet-GitHubRelease -Owner $Owner -Repository $repoin theGet-GitHubReleaseAsset - Gets assets from release using pipelinetest intests/Releases.Tests.ps1
Verification
- Confirm the replacement
Itblock is inside theRelease Assetssub-context (so$releaseand$repoare in scope) - Confirm no other test file references any repository outside the test account family
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
MariusStorhaug commentedon May 2, 2026
Heads up: when this work changes how tests provision, share, or tear down infrastructure, update
.github/instructions/tests.instructions.mdin the same PR. That file is the single source of truth for test conventions and is auto-loaded by Copilot for every edit undertests/**, so contributors and the agent stay aligned.