Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,18 @@
ErrorAction = 'Stop'
}

$importSucceeded = $false
try {
Invoke-PSDepend @psDependParameters
$importSucceeded = $true
Write-Verbose 'Successfully imported existing modules.' -Verbose
} catch {
Write-Verbose "Could not import all required modules: $_" -Verbose
Write-Verbose 'Attempting to install missing or outdated dependencies...' -Verbose
}
$psDependTestParameters = $psDependParameters.Clone()
$null = $psDependTestParameters.Remove('Import')
$psDependTestParameters['Test'] = $true
$psDependTestParameters['Quiet'] = $true

if (-not $importSucceeded) {
try {
Invoke-PSDepend @psDependParameters -Install
} catch {
Write-Error "Failed to install and import required dependencies: $_"
Write-Error 'This may be due to locked module files. Please restart the build environment or clear module locks.'
if ($_.Exception.InnerException) {
Write-Error "Inner exception: $($_.Exception.InnerException.Message)"
}
throw
}
if (-not (Invoke-PSDepend @psDependTestParameters)) {
$psDependInstallParameters = $psDependParameters.Clone()
$null = $psDependInstallParameters.Remove('Import')
Invoke-PSDepend @psDependInstallParameters -Install
}

Invoke-PSDepend @psDependParameters
} else {
if (-not (Get-Module -Name 'PSDepend' -ListAvailable)) {
throw 'Missing dependencies. Please run with the "-Bootstrap" flag to install dependencies.'
Expand All @@ -118,14 +108,14 @@
Format-Table -Property Name, Description, Alias, DependsOn
} else {
Set-BuildEnvironment -Force
$invokepsakeSplat = @{

Check warning on line 111 in build.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (invokepsake)
BuildFile = $psakeFile
TaskList = $Task
NoLogo = $true
}
if ($Env:GITHUB_ACTIONS) {
$invokepsakeSplat['OutputFormat'] = 'GitHubActions'

Check warning on line 117 in build.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (invokepsake)
}
Invoke-Psake @invokepsakeSplat

Check warning on line 119 in build.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (invokepsake)
exit ([int](-not $psake.build_success))
}
2 changes: 1 addition & 1 deletion requirements.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Target = 'CurrentUser'
}
'Pester' = @{
Version = '5.7.1'
Version = '6.2.0'
Parameters = @{
SkipPublisherCheck = $true
}
Expand Down
1 change: 1 addition & 0 deletions tests/Get-PlasterManifestPathForCulture.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Describe 'Get-PlasterManifestPathForCulture' {

It "falls back to invariant culture manifest if no specific match is found" {
$culture = New-Object System.Globalization.CultureInfo("xx-XX")
Mock -CommandName 'Test-Path' -MockWith { $False }
Mock -CommandName 'Test-Path' -MockWith { $False } -ParameterFilter { $Path -like "*en-US*" }
Mock -CommandName 'Test-Path' -MockWith { $True } -ParameterFilter { $Path -like "*fr-FR*" }
Mock -CommandName 'Test-Path' -MockWith { $True } -ParameterFilter { $Path -like "*plasterManifest.xml" }
Expand Down
4 changes: 2 additions & 2 deletions tests/Help.tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Taken with love from @juneb_get_help (https://raw.githubusercontent.com/juneb/PesterTDD/master/Module.Help.Tests.ps1)

Check warning on line 1 in tests/Help.tests.ps1

View workflow job for this annotation

GitHub Actions / Continuous Integration / Run Linters

Unknown word (juneb) Suggestions: (june, junes, June, Junes, jube)

BeforeDiscovery {
if ($null -eq $env:BHProjectPath) {
Expand Down Expand Up @@ -80,7 +80,7 @@
($commandHelp.Examples.Example.Remarks | Select-Object -First 1).Text | Should -Not -BeNullOrEmpty
}

It "Help link <_> is valid" -ForEach $helpLinks {
It "Help link <_> is valid" -ForEach $helpLinks -AllowNullOrEmptyForEach {
(Invoke-WebRequest -Uri $_ -UseBasicParsing).StatusCode | Should -Be '200'
}

Expand Down Expand Up @@ -115,7 +115,7 @@
}
}

Context "Test <_> help parameter help for <commandName>" -ForEach $helpParameterNames {
Context "Test <_> help parameter help for <commandName>" -ForEach $helpParameterNames -AllowNullOrEmptyForEach {

# Shouldn't find extra parameters in help.
It "finds help parameter in code: <_>" {
Expand Down
Loading