-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
enhancementNew feature or requestNew feature or requesttestingTest infrastructure and test filesTest infrastructure and test files
Milestone
Description
Summary
Two GitHub Actions workflows contain embedded PowerShell logic that cannot be unit-tested in isolation. This issue tracks extracting that logic into standalone scripts with full Pester test coverage.
Target Workflows
| Workflow | Step | Embedded Logic |
|---|---|---|
pester-tests.yml |
Get changed PowerShell files | Git diff parsing, source-to-test mapping, skill directory discovery |
extension-package.yml |
Discover collection manifests | YAML parsing, maturity filtering, matrix JSON generation |
Approach
- Extract each embedded block into a standalone
.ps1script following the reference pattern fromInvoke-PSScriptAnalyzer.ps1(shebang, copyright, Requires, CmdletBinding, regions, script guard). - Use
CIHelpers.psm1(Set-CIEnv,Set-CIOutput) instead of raw$env:GITHUB_OUTPUTfile I/O. - Write Pester 5.7.1 tests for each extracted script using
GitMocks.psm1patterns. - Replace workflow embedded blocks with thin wrapper calls to the new scripts.
Deliverables
-
scripts/tests/Get-ChangedTestFiles.ps1— extracted changed-file detection logic -
scripts/tests/Get-ChangedTestFiles.Tests.ps1— Pester tests for changed-file detection -
scripts/extension/Find-CollectionManifests.ps1— extracted collection manifest discovery -
scripts/tests/extension/Find-CollectionManifests.Tests.ps1— Pester tests for manifest discovery - Updated
pester-tests.ymlwith thin wrapper call - Updated
extension-package.ymlwith thin wrapper call - All validation passes (
npm run lint:all,npm run test:ps)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesttestingTest infrastructure and test filesTest infrastructure and test files