Skip to content

Set-Service.Tests.ps1 tests Failing builds #4800

@markekraus

Description

@markekraus

#4785 Introduced tests which are failing builds.

On Windows:

Description: New-Service with bad parameters will fail for 'badstarttype' where 'StartupType' = 'System'
Name:        Set/New-Service cmdlet tests..New-Service with bad parameters will fail for 'badstarttype' where 'StartupType' = 'System'
message:
Expected string length 66 but was 13. Strings differ at index 0.
Expected: {CouldNotNewService,Microsoft.PowerShell.Commands.NewServiceCommand}
But was:  {No Exception!}
-----------^
stack-trace:
at line: 65 in C:\projects\powershell\test\tools\Modules\HelpersCommon\HelpersCommon.psm1
65:             $_.FullyQualifiedErrorId | Should Be $FullyQualifiedErrorId | Out-Null

On Linux and macOS:

[-] Error occurred in Describe block 79ms

   The term 'Get-Service' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

   At /home/travis/build/PowerShell/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/Set-Service.Tests.ps1:25 char:48

System is a valid System.ServiceProcess.ServiceStartMode so either the test is flawed or there is an issue with New-Service.

The Linux/macOS failures are due to Get-Service being called in the TestCases HashTable literal. That literal gets parsed regardless of the OS skip resulting in calls to Get-Service on OSE's where it is not present.

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Quality-Testissues in a test or in test infrastructure

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions