Skip to content

Add Pester Tests for YamlCreate.InstallerDetection#327538

Merged
denelon merged 6 commits intomicrosoft:masterfrom
Trenly:copilot/add-pester-tests-for-installer-detection
Apr 11, 2026
Merged

Add Pester Tests for YamlCreate.InstallerDetection#327538
denelon merged 6 commits intomicrosoft:masterfrom
Trenly:copilot/add-pester-tests-for-installer-detection

Conversation

@Trenly
Copy link
Copy Markdown
Contributor

@Trenly Trenly commented Jan 2, 2026

Adds comprehensive Pester tests for the YamlCreate.InstallerDetection PowerShell module, which provides installer type detection and PE file parsing capabilities.

Changes

  • YamlCreate.InstallerDetection.Tests.ps1 (375 lines, 35 tests)

    • Tests for all 11 exported functions covering byte manipulation, PE section parsing, and installer type detection (ZIP, MSIX, MSI, WIX, Nullsoft, Inno, Burn, fonts)
    • Stub functions for external dependencies (Get-MSITable, Get-MSIProperty, Get-Win32ModuleResource) that may not be available in all test environments
    • 32 passing tests with proper cleanup of temporary test files
  • README.md

    • Usage examples for running tests with Pester
    • Test structure documentation and coverage overview
    • Known limitations for tests requiring complex binary structures
  • .github/workflows/pesterTests.yaml

    • GitHub Actions workflow that automatically runs all Pester tests on pull requests and pushes
    • Discovers and executes all *.Tests.ps1 files in the repository
    • Based on the existing ScriptAnalyzer workflow template
    • Runs on Windows runners with Pester 5.x

Test Coverage

# Module validation
Get-Module 'YamlCreate.InstallerDetection' | Should -Not -BeNullOrEmpty

# Byte extraction with endianness
Get-OffsetBytes -ByteArray $bytes -Offset 2 -Length 3 -LittleEndian $true

# Font signature detection
Test-IsFont -Path $file  # TTF: 0x00010000, OTF: OTTO, TTC: ttcf

# Main resolver following detection priority
Resolve-InstallerType -Path $installer  # Returns: font, wix, msi, msix, zip, nullsoft, inno, burn, or $null

Test results: 32 passed, 3 skipped (require valid ZIP/PE structures), 0 failed.

Original prompt

On YamlCreate.InstallerDetection, Create a new set of Pester tests for the Powershell module at Tools/Modules/YamlCreate/YamlCreate.InstallerDetection


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Microsoft Reviewers: Open in CodeFlow

@Trenly Trenly requested a review from denelon as a code owner January 2, 2026 23:52
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Attention This work item needs to be reviewed by a member of the core team. label Jan 2, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot added the Moderator-Approved One of the Moderators has reviewed and approved this PR label Jan 2, 2026
denelon
denelon previously approved these changes Mar 14, 2026
Comment thread .github/workflows/pesterTests.yaml Outdated
@microsoft-github-policy-service microsoft-github-policy-service bot removed Moderator-Approved One of the Moderators has reviewed and approved this PR Needs-Attention This work item needs to be reviewed by a member of the core team. Unexpected-File labels Mar 20, 2026
Copilot AI and others added 3 commits March 20, 2026 16:22
Co-authored-by: Trenly <12611259+Trenly@users.noreply.github.com>
Co-authored-by: Trenly <12611259+Trenly@users.noreply.github.com>
Co-authored-by: Trenly <12611259+Trenly@users.noreply.github.com>
@Trenly Trenly force-pushed the copilot/add-pester-tests-for-installer-detection branch from 113e497 to 6987a50 Compare March 20, 2026 21:23
Copilot AI and others added 2 commits March 26, 2026 14:28
@Trenly Trenly requested a review from msftrubengu March 26, 2026 21:29
@denelon
Copy link
Copy Markdown
Collaborator

denelon commented Mar 27, 2026

@msftrubengu any other concerns?

@Trenly
Copy link
Copy Markdown
Contributor Author

Trenly commented Mar 27, 2026

@denelon - Mind clicking to approve the workflows for this PR so they can have at least one run before this is merged?

@microsoft-github-policy-service microsoft-github-policy-service bot added the Moderator-Approved One of the Moderators has reviewed and approved this PR label Apr 11, 2026
@denelon denelon merged commit 70b6148 into microsoft:master Apr 11, 2026
3 checks passed
@Trenly Trenly deleted the copilot/add-pester-tests-for-installer-detection branch April 12, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Moderator-Approved One of the Moderators has reviewed and approved this PR Project-File

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants