8000 Verify failures work by TravisEz13 · Pull Request #9306 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ ZoneId=$FileType
Get-ExecutionPolicy -Scope LocalMachine | Should -Be "ByPass"
}

It '-Scope LocalMachine is Settable' -Skip:(!(Test-CanWriteToPsHome)) {
It '-Scope LocalMachine is Settable' -Skip:$ShouldSkipTest {
# We need to make sure that both Process and CurrentUser policies are Undefined
# before we can set LocalMachine policy without ExecutionPolicyOverride error.
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Describe "JEA session Transcript script test" -Tag @("Feature", 'RequireAdminOnW
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()

if ( ! $IsWindows )
if ( ! $IsWindows -or !(Test-CanWriteToPsHome))
{
$PSDefaultParameterValues["it:skip"] = $true
}
Expand All @@ -54,7 +54,7 @@ Describe "JEA session Transcript script test" -Tag @("Feature", 'RequireAdminOnW
$global:PSDefaultParameterValues = $originalDefaultParameterValues
}

It "Configuration name should be in the transcript header" -Skip:(!(Test-CanWriteToPsHome)) {
It "Configuration name should be in the transcript header" {
[string] $RoleCapDirectory = (New-Item -Path "$TestDrive\RoleCapability" -ItemType Directory -Force).FullName
[string] $PSSessionConfigFile = "$RoleCapDirectory\TestConfig.pssc"
[string] $transScriptFile = "$RoleCapDirectory\*.txt"
Expand Down Expand Up @@ -82,7 +82,7 @@ Describe "JEA session Get-Help test" -Tag @("CI", 'RequireAdminOnWindows') {
BeforeAll {
$originalDefaultParameterValues = $PSDefaultParameterValues.Clone()

if ( ! $IsWindows )
if ( ! $IsWindows -or !(Test-CanWriteToPsHome))
{
$PSDefaultParameterValues["it:skip"] = $true
}
Expand All @@ -96,7 +96,7 @@ Describe "JEA session Get-Help test" -Tag @("CI", 'RequireAdminOnWindows') {
$global:PSDefaultParameterValues = $originalDefaultParameterValues
}

It "Get-Help should work in JEA sessions" -Skip:(!(Test-CanWriteToPsHome)) {
It "Get-Help should work in JEA sessions" {
[string] $RoleCapDirectory = (New-Item -Path "$TestDrive\RoleCapability" -ItemType Directory -Force).FullName
[string] $PSSessionConfigFile = "$RoleCapDirectory\TestConfig.pssc"
try
Expand Down
4 changes: 2 additions & 2 deletions tools/ci.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ function Invoke-LinuxTestsCore
$allTestResultsWithNoExpFeature = @($pesterPassThruNoSudoObject, $pesterPassThruSudoObject)
$allTestResultsWithExpFeatures = @($noSudoResultsWithExpFeatures, $sudoResultsWithExpFeatures)
# This throws if there was an error:
$allTestResultsWithNoExpFeature | ForEach-Object { Test-PSPesterResults -ResultObject $_ }
$allTestResultsWithExpFeatures | ForEach-Object { Test-PSPesterResults -ResultObject $_ -CanHaveNoResult }
$allTestResultsWithNoExpFeature | Where-Object {$null -ne $_} | ForEach-Object { Test-PSPesterResults -ResultObject $_ }
$allTestResultsWithExpFeatures | Where-Object {$null -ne $_} | ForEach-Object { Test-PSPesterResults -ResultObject $_ -CanHaveNoResult }
$result = "PASS"
} catch {
# The build failed, set the result:
Expand Down
0