Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 12, 2025

The CI pipeline was failing with Pester test errors due to two main issues in the PowerShell localization testing infrastructure.

Issues Fixed

1. LocalizationParser Missing Default Culture

The LocalizationParser.ps1 script was failing when no UICulture parameter was provided. The script uses Import-LocalizedData which requires a specific culture to locate files in culture-specific subdirectories (e.g., en-US/Example.psd1, fr-FR/Example.psd1). When running in environments with invariant culture, the localization files couldn't be found.

Before:

# Failed - no localization files found
pwsh -File ./resources/LocalizationParser.ps1 -ModuleFile ./tests/fixtures/Example/Example.psm1

After:

# Works - defaults to en-US culture
pwsh -File ./resources/LocalizationParser.ps1 -ModuleFile ./tests/fixtures/Example/Example.psm1

2. Outdated Pester Configuration Syntax

The psake.ps1 build script was using deprecated Pester configuration syntax that's incompatible with Pester 5.x. The script was attempting to create a [PesterConfiguration] object directly and use -PassThru as a parameter.

Before:

$script:PesterConfiguration = [PesterConfiguration]@{}
$results = Invoke-Pester -Configuration $script:PesterConfiguration -PassThru

After:

$script:PesterConfiguration = New-PesterConfiguration
$script:PesterConfiguration.Run.PassThru = $true
$results = Invoke-Pester -Configuration $script:PesterConfiguration

Validation Results

All tests now pass successfully:

  • ✅ LocalizationParser tests (8/8 tests pass)
  • ✅ MetaTests validation (3/3 tests pass)
  • ✅ English localization returns: "Value1", "Value2", "Value3"
  • ✅ French localization returns: "Valeur1", "Valeur2", "Valeur3"
  • ✅ TypeScript compilation and linting pass

The CI pipeline Pester task will now execute successfully without the previous Import-LocalizedData errors.

Fixes #10.


💡 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.

Copilot AI changed the title [WIP] Fix failing psakeFile Pester task Fix failing psakeFile Pester task - LocalizationParser default culture and psake configuration Aug 12, 2025
Copilot AI requested a review from HeyItsGilbert August 12, 2025 15:30
CHANGELOG.md Outdated
to structure this file.

## [Unreleased]
## [0.2.0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot don't change the version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted the version change in CHANGELOG.md. The entries now remain in the "Unreleased" section as requested. Commit 16f985e fixes this.

Copilot AI and others added 2 commits August 12, 2025 16:01
…ke configuration

Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com>
Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com>
@HeyItsGilbert HeyItsGilbert marked this pull request as ready for review August 12, 2025 23:01
Copilot AI requested a review from HeyItsGilbert August 12, 2025 23:02

### Fixed
- LocalizationParser.ps1 now defaults to en-US culture when UICulture parameter is not provided
- Fixes Import-LocalizedData failures in environments with invariant culture

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [alex] reported by reviewdog 🐶
Be careful with failures, it’s profane in some cases failures retext-profanities

@HeyItsGilbert HeyItsGilbert merged commit 36ecce3 into main Aug 12, 2025
4 checks passed
@HeyItsGilbert HeyItsGilbert deleted the copilot/fix-10 branch August 12, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix failing psakeFile Pester task

2 participants