Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/joshdk/go-junit

🐜 Go library for ingesting JUnit XML reports
https://github.com/joshdk/go-junit

go golang hacktoberfest junit junit-report junit-test junit-xml xml

Last synced: about 4 hours ago
JSON representation

🐜 Go library for ingesting JUnit XML reports

Awesome Lists containing this project

README

        

[![License][license-badge]][license-link]
[![Actions][github-actions-badge]][github-actions-link]
[![Go Report Card][go-report-badge]][go-report-link]
[![Go Dev][godev-badge]][godev-link]
[![Releases][github-release-badge]][github-release-link]

# Go JUnit

🐜 Go library for ingesting JUnit XML reports

## Installing

You can fetch this library by running the following

```bash
go get -u github.com/joshdk/go-junit
```

## Usage

### Data Ingestion

This library has a number of ingestion methods for convenience.

The simplest of which parses raw JUnit XML data.

```xml








Assertion failed





```

```go
xml := []byte(`

```

A single top level `testsuites` tag, containing multiple `testsuite` instances.

```xml




```

(Despite not technically being valid XML) Multiple top level `testsuite` tags, containing multiple `testcase` instances.

```xml



```

In all cases, omitting (or even duplicated) the XML declaration tag is allowed.

```xml

```

## Contributing

Found a bug or want to make go-junit better? Please [open a pull request](https://github.com/joshdk/go-junit/compare)!

To make things easier, try out the following:

- Running `go test -v` will run the test suite to verify behavior.

- Running `golangci-lint run` will report any linting issues using [golangci/golangci-lint](https://github.com/golangci/golangci-lint/releases/tag/v1.50.1).

## License

This code is distributed under the [MIT License][license-link], see [LICENSE.txt][license-file] for more information.


Created by Josh Komoroske

[github-actions-badge]: https://github.com/joshdk/go-junit/workflows/Test/badge.svg?branch=master
[github-actions-link]: https://github.com/joshdk/go-junit/actions
[github-release-badge]: https://img.shields.io/github/release/joshdk/go-junit/all.svg
[github-release-link]: https://github.com/joshdk/go-junit/releases
[go-report-badge]: https://goreportcard.com/badge/github.com/joshdk/go-junit
[go-report-link]: https://goreportcard.com/report/github.com/joshdk/go-junit
[godev-badge]: https://pkg.go.dev/badge/github.com/joshdk/go-junit.svg
[godev-link]: https://pkg.go.dev/github.com/joshdk/go-junit
[license-badge]: https://img.shields.io/badge/license-MIT-green.svg
[license-file]: https://github.com/joshdk/go-junit/blob/master/LICENSE.txt
[license-link]: https://opensource.org/licenses/MIT