Skip to content

Latest commit

 

History

History
163 lines (126 loc) · 3.93 KB

File metadata and controls

163 lines (126 loc) · 3.93 KB
external help file PSPublishModule-help.xml
Module Name PSPublishModule
online version https://github.com/EvotecIT/PSPublishModule
schema 2.0.0

Get-ModuleTestFailures

SYNOPSIS

Analyzes and summarizes failed Pester tests from either a Pester results object or an NUnit XML result file.

SYNTAX

Path (Default)

Get-ModuleTestFailures [-Path <string>] [-ProjectPath <string>] [-OutputFormat <ModuleTestFailureOutputFormat>] [-ShowSuccessful] [-PassThru] [<CommonParameters>]

TestResults

Get-ModuleTestFailures -TestResults <Object> [-ProjectPath <string>] [-OutputFormat <ModuleTestFailureOutputFormat>] [-ShowSuccessful] [-PassThru] [<CommonParameters>]

DESCRIPTION

This cmdlet is designed to make CI output and local troubleshooting easier by summarizing failures from:

Use -OutputFormat to control whether the cmdlet writes a concise host summary, detailed messages, or emits JSON to the pipeline.

EXAMPLES

EXAMPLE 1

PS> Get-ModuleTestFailures

Searches for TestResults.xml under the project and prints a detailed failure report.

EXAMPLE 2

PS> Get-ModuleTestFailures -Path 'Tests\TestResults.xml' -OutputFormat Summary

Writes a compact summary that is suitable for CI logs.

EXAMPLE 3

PS> Invoke-ModuleTestSuite -ProjectPath 'C:\Git\MyModule' | Get-ModuleTestFailures -OutputFormat Detailed -PassThru

Uses the in-memory results and returns the analysis object for further processing.

PARAMETERS

-OutputFormat

Format for displaying test failures.

Type: ModuleTestFailureOutputFormat
Parameter Sets: Path, TestResults
Aliases: None
Possible values: Summary, Detailed, Json

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-PassThru

Return the failure analysis object for further processing.

Type: SwitchParameter
Parameter Sets: Path, TestResults
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-Path

Path to the NUnit XML test results file. If not specified, searches for TestResults.xml under ProjectPath.

Type: String
Parameter Sets: Path
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ProjectPath

Path to the project directory used to locate test results when Path is not specified.

Type: String
Parameter Sets: Path, TestResults
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-ShowSuccessful

Include successful tests in the output (only applies to Summary format).

Type: SwitchParameter
Parameter Sets: Path, TestResults
Aliases: None
Possible values:

Required: False
Position: named
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-TestResults

Pester test results object from Invoke-Pester, a ModuleTestSuiteResult from Invoke-ModuleTestSuite, or a precomputed ModuleTestFailureAnalysis.

Type: Object
Parameter Sets: TestResults
Aliases: None
Possible values:

Required: True
Position: named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: True

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

  • System.Object

OUTPUTS

  • System.Object

RELATED LINKS

  • None