Skip to content

Commit 8cd2b14

Browse files
authored
Skip Examples HQRM on PS6+ (#172)
1 parent 9576d76 commit 8cd2b14

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Fixed
1515

1616
- Add ability to filter out files in `ExampleFiles.common.v4` [#120](https://github.com/dsccommunity/DscResource.Test/issues/120).
17+
- `ExampleFiles.common.*` skip if on PowerShell 6+ [#169](https://github.com/dsccommunity/DscResource.Test/issues/169).
1718

1819
### Removed
1920

source/Tests/QA/ExampleFiles.common.v4.Tests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ if (-not $isPester5)
2323
return
2424
}
2525

26+
# Do not run on PowerShell Core / PowerShell 6+.
27+
if ($PSEdition -ne 'Desktop')
28+
{
29+
return
30+
}
31+
2632
Describe 'Common Tests - Validate Example Files' -Tag 'Common Tests - Validate Example Files' {
2733

2834
$examplesPath = Join-Path -Path $SourcePath -ChildPath 'Examples'

source/Tests/QA/ExampleFiles.common.v5.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ AfterAll {
8383
Import-Module -Name 'DscResource.Test' -Force
8484
}
8585

86-
Describe 'Common Tests - Validate Example Files' -Tag 'Common Tests - Validate Example Files' {
86+
Describe 'Common Tests - Validate Example Files' -Tag 'Common Tests - Validate Example Files' -Skip:($PSEdition -ne 'Desktop') {
8787
Context 'When the example ''<ExampleDescriptiveName>'' exist' -ForEach $exampleToTest {
8888
It 'Should compile the MOF schema for the example correctly' {
8989
{
9090
$mockPassword = ConvertTo-SecureString '&iPm%M5q3K$Hhq=wcEK' -AsPlainText -Force
91-
$mockCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList @('username', $mockPassword)
91+
$mockCredential = [System.Management.Automation.PSCredential]::new('username', $mockPassword)
9292

9393
$mockConfigurationData = @{
9494
AllNodes = @(

0 commit comments

Comments
 (0)