report

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package report provides ways to customize the JUnit XML report.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractProperties

func ExtractProperties(suites junit.Testsuites) map[string]map[string]string

ExtractProperties extracts a testName->propertyName->propertyValue map from the specified JUnit Testsuites. It assumes the specified Testsuites contains exactly one Testsuite, since the XML report always contains exactly one, and if the Testsuite contains multiple properties with the same name, later property values overwrite earlier property values.

func ReadXML

func ReadXML(r io.Reader) (junit.Testsuites, error)

ReadXML decodes XML bytes into a JUnit Testsuites element.

Types

type Report

type Report struct{}

Report is the API to customizing a JUnit XML report.

func (*Report) AddRawProperty

func (r *Report) AddRawProperty(test, name, value string)

AddRawProperty attaches a name-value property to the specified test name in the generated the XML report. If the test name is the empty string, the property is attached to the test suite. For improved test readability, callers should prefer using AddSuiteProperty or AddTestProperty.

func (*Report) AddSuiteProperty

func (r *Report) AddSuiteProperty(name, value string)

AddSuiteProperty attaches a name-value property to the test suite in the generated XML report. This is preferred, but equivalent, to calling AddRawProperty("", name, value).

func (*Report) AddTestProperty

func (r *Report) AddTestProperty(t testing.TB, name, value string)

AddTestProperty attaches a name-value property to the current test in the generated XML report. This is preferred, but equivalent, to calling AddRawProperty(t.Name(), name, value).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL