Documentation
¶
Overview ¶
Package json2junit converts JSON Go test output to JUnit XML format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertFile ¶
ConvertFile reads a Go test JSON file and creates a JUnit XML file with converted content. Creates the directory containing the target file if necessary.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
A Converter holds the state of a JSON-to-JUnit conversion. It implements io.WriteCloser; call Write with JSON test output, then Close. The JUnit output is written to the writer w that was passed to NewConverter.
The JSON input is buffered, so the caller can write it in arbitrary size chunks that don't have to align with the JSON lines. The JUnit output is not written immediately, but chunked into test suites which are written to w as soon as they are complete.
func NewConverter ¶
NewConverter returns a "JSON to JUnit" converter. Writes on the returned writer are written as JUnit to w, with minimal delay.