Skip to content

Commit e339f1f

Browse files
Fix CI artifact path and linter gates
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 1464ded commit e339f1f

2 files changed

Lines changed: 18 additions & 25 deletions

File tree

tests/Packaging.Tests.ps1

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
'PSUseDeclaredVarsMoreThanAssignments', '',
99
Justification = 'Required for Pester tests'
1010
)]
11+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
12+
'PSProvideCommentHelp', '',
13+
Justification = 'Internal test helper function for packaging assertions.'
14+
)]
1115
[CmdletBinding()]
1216
param()
1317

@@ -16,8 +20,6 @@ $script:resolvedArtifactManifestPath = $null
1620
$script:artifactManifestPath = $null
1721

1822
function Test-YamlArtifactManifestAvailable {
19-
[CmdletBinding()]
20-
[OutputType([bool])]
2123
param()
2224

2325
if (-not [string]::IsNullOrWhiteSpace($env:PSMODULE_YAML_TEST_ARTIFACT)) {
@@ -33,23 +35,20 @@ BeforeAll {
3335
. (Join-Path $PSScriptRoot 'TestBootstrap.ps1')
3436
$script:repositoryRoot = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot '..')).Path
3537
$defaultArtifactManifestPath = Join-Path $script:repositoryRoot 'outputs\module\Yaml\Yaml.psd1'
36-
$script:resolvedArtifactManifestPath = if (Test-Path -LiteralPath $defaultArtifactManifestPath -PathType Leaf) {
37-
$defaultArtifactManifestPath
38+
$script:resolvedArtifactManifestPath = if (
39+
Test-Path -LiteralPath $defaultArtifactManifestPath -PathType Leaf
40+
) {
41+
(Resolve-Path -LiteralPath $defaultArtifactManifestPath).Path
3842
} elseif (-not [string]::IsNullOrWhiteSpace($env:PSMODULE_YAML_TEST_ARTIFACT)) {
39-
$env:PSMODULE_YAML_TEST_ARTIFACT
40-
} else {
41-
$null
42-
}
43-
$loadedYamlModule = if (-not [string]::IsNullOrWhiteSpace($script:resolvedArtifactManifestPath)) {
44-
Import-Module -Name $script:resolvedArtifactManifestPath -Force -Global -PassThru |
45-
Where-Object Name -EQ 'Yaml' |
46-
Select-Object -First 1
47-
}
48-
$script:artifactManifestPath = if ($null -ne $loadedYamlModule) {
49-
Join-Path $loadedYamlModule.ModuleBase 'Yaml.psd1'
43+
if (Test-Path -LiteralPath $env:PSMODULE_YAML_TEST_ARTIFACT -PathType Leaf) {
44+
(Resolve-Path -LiteralPath $env:PSMODULE_YAML_TEST_ARTIFACT).Path
45+
} else {
46+
$null
47+
}
5048
} else {
5149
$null
5250
}
51+
$script:artifactManifestPath = $script:resolvedArtifactManifestPath
5352
}
5453

5554
Describe 'Dependency-free package source' {

tests/tools/Invoke-YamlTestSuite.ps1

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
2+
'PSProvideCommentHelp', '',
3+
Justification = 'Internal test helper functions in this tooling script.'
4+
)]
15
[CmdletBinding()]
26
param (
37
[Parameter(Mandatory)]
@@ -23,7 +27,6 @@ if (-not $PSBoundParameters.ContainsKey('CompareJson') -and
2327
}
2428

2529
function Invoke-InYamlModule {
26-
[CmdletBinding()]
2730
param (
2831
[Parameter(Mandatory)]
2932
[scriptblock] $ScriptBlock,
@@ -40,7 +43,6 @@ function Invoke-InYamlModule {
4043
}
4144

4245
function Split-YamlSuiteJsonDocument {
43-
[CmdletBinding()]
4446
param (
4547
[Parameter(Mandatory)]
4648
[AllowEmptyString()]
@@ -111,8 +113,6 @@ function Split-YamlSuiteJsonDocument {
111113
}
112114

113115
function ConvertTo-YamlSuiteCanonicalValue {
114-
[CmdletBinding()]
115-
[OutputType([string])]
116116
param (
117117
[AllowNull()]
118118
[object] $Value
@@ -173,7 +173,6 @@ function ConvertTo-YamlSuiteCanonicalValue {
173173
}
174174

175175
function ConvertTo-YamlSuiteReferenceSignature {
176-
[CmdletBinding()]
177176
[OutputType([string])]
178177
param (
179178
[AllowNull()]
@@ -244,7 +243,6 @@ function ConvertTo-YamlSuiteReferenceSignature {
244243
}
245244

246245
function Get-YamlSuitePolicyReason {
247-
[CmdletBinding()]
248246
[OutputType([string])]
249247
param (
250248
[string] $YamlText,
@@ -266,7 +264,6 @@ function Get-YamlSuitePolicyReason {
266264
}
267265

268266
function ConvertFrom-YamlSuiteEventText {
269-
[CmdletBinding()]
270267
[OutputType([string[]])]
271268
param (
272269
[Parameter(Mandatory)]
@@ -433,7 +430,6 @@ function ConvertFrom-YamlSuiteEventText {
433430
}
434431

435432
function ConvertTo-YamlSuiteActualEvent {
436-
[CmdletBinding()]
437433
[OutputType([string[]])]
438434
param (
439435
[Parameter(Mandatory)]
@@ -540,7 +536,6 @@ function ConvertTo-YamlSuiteActualEvent {
540536
}
541537

542538
function Compare-YamlSuiteCanonicalList {
543-
[CmdletBinding()]
544539
[OutputType([bool])]
545540
param (
546541
[string[]] $Left,
@@ -559,7 +554,6 @@ function Compare-YamlSuiteCanonicalList {
559554
}
560555

561556
function Get-YamlSuiteAnchorToken {
562-
[CmdletBinding()]
563557
[OutputType([string])]
564558
param (
565559
[Parameter(Mandatory)]

0 commit comments

Comments
 (0)