Skip to content

Provide machine-friendly, streaming output format #2581

Open
@davidmatson

Description

Checklist

Summary of the feature request

Our ES testing infrastructure has its own reporting mechanism, and we've previously integrated with many other test frameworks, including GoogleTest, Catch2, Boost.Test, VSTest / xUnit.Net / NUnit / MSTest. Most of these frameworks provide a built-in output format that is streamed (provides the data as the tests are running) as well as programmatically-processible (XML written to stdout for Catch2 and Boost.Test, URL-like lines written to a socket for GoogleTest). Could Pester provide such an output format as well?

This would provide a mechanism that could be used to adapt Pester test results to any other format, while the Pester tests are running. Runners such as VS Code might also make use of this format as a stable way of presenting results, rather than needing the currently-non-public add-in mechanism.

How should it work?

Invoke-Pester (or the configuration object) provides a way to specify that the output mode is machine-friendly (rather than the default of human-friendly). Perhaps a new Output.Mode on PesterConfiguration, with values of 'Human' (default) and 'Machine' (new), with machine output looking something like this (inspired by the GoogleTest machine-friendly output format):

pester_streaming_protocol_version=1.0
event=PesterStart&version=6.0.0
event=DiscoveryStart
event=Discovered&path=C:\t\Planets\Get-Planet.Tests.ps1
event=DiscoveryEnd
event=RunStart&path=C:\t\Planets\Get-Planet.Tests.ps1
event=DescribeStart&name=Get-Planet
event=ItStart&name=Given%20no%20parameters,%20it%20lists%20all%208%20planets
event=ItEnd&result=fail&duration=40ms&message=The%20term...&file=C:\t\Planets\Get-Planet.Tests.ps1&line=7
event=DescribeEnd
event=RunEnd

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions