◐ Shell
clean mode source ↗

Add GitHub Actions annotations for Pester test failures by Copilot · Pull Request #26789 · PowerShell/PowerShell

- Added Get-PesterFailureFileInfo helper function to parse stack traces
- Modified Show-PSPesterError to emit GitHub workflow error annotations with file/line info
- Added links to test logs when running in GitHub Actions
- Maintains backward compatibility when not in a GitHub workflow

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
- Added support for Pester 5 stack trace format (e.g., "at X, /path:line")
- Handle both Unix and Windows paths in all regex patterns
- Verified parsing with multiple test cases including real Pester output

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
…tackTraceString

- Renamed parameter to avoid conflict with PowerShell automatic variable
- Updated function call to use new parameter name
- Verified Pester 4 and Pester 5 format support

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>

Copilot AI changed the title [WIP] Add comments to test code with failure details Add GitHub Actions annotations for Pester test failures

Feb 12, 2026

@TravisEz13 TravisEz13 added the CL-Test

Indicates that a PR should be marked as a test change in the Change Log

label

Feb 12, 2026
- GitHub Actions expects paths relative to workspace root, not absolute paths
- Added path conversion logic using GITHUB_WORKSPACE environment variable
- Normalizes paths to use forward slashes for consistency
- Handles both Unix and Windows absolute paths
- Relative paths remain unchanged

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
- Added test in ciModule.Tests.ps1 to demonstrate the annotation feature
- Test intentionally fails to show annotations in CI output
- Verifies relative path conversion and test log links
- Can be removed after feature is verified in actual CI runs

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>

TravisEz13

- Removed test from ciModule.Tests.ps1 that manually called Show-PSPesterError
- Created DemoGitHubAnnotations.Tests.ps1 in test/powershell/Modules/
- New test runs through normal Pester execution and Test-PSPesterResults
- Demonstrates actual code path: Pester test fails -> Test-PSPesterResults -> Show-PSPesterError -> annotations
- Tagged with 'CI' so it runs in normal CI workflows
- DELETE DemoGitHubAnnotations.Tests.ps1 after verifying feature in production

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
- Moved GitHub Actions annotation logic from Show-PSPesterError to process-pester-results.ps1
- process-pester-results.ps1 is the central place where test results are processed in CI
- Removed redundant GITHUB_WORKFLOW check (already in workflow context)
- Show-PSPesterError now only displays error info (backward compatible)
- Get-PesterFailureFileInfo remains in build.psm1 for reuse

Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>

Copilot AI review requested due to automatic review settings

February 12, 2026 22:06

adityapatwardhan

@TravisEz13 TravisEz13 deleted the copilot/add-comments-on-test-failures branch

February 12, 2026 22:53

TravisEz13 added a commit to TravisEz13/PowerShell that referenced this pull request

Feb 12, 2026
…6789)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>

daxian-dbw pushed a commit to daxian-dbw/PowerShell that referenced this pull request

Feb 15, 2026
…6789)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>

daxian-dbw pushed a commit to daxian-dbw/PowerShell that referenced this pull request

Mar 9, 2026
…6789)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>

daxian-dbw pushed a commit to daxian-dbw/PowerShell that referenced this pull request

Mar 9, 2026
…6789)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>

JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request

Jun 2, 2026
…6789)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>