https://github.com/adobe/go-surefire
Surefire Result Aggregator for Golang
https://github.com/adobe/go-surefire
failsafe golang surefire surefire-reporting
Last synced: 5 months ago
JSON representation
Surefire Result Aggregator for Golang
- Host: GitHub
- URL: https://github.com/adobe/go-surefire
- Owner: adobe
- License: apache-2.0
- Created: 2024-11-13T08:27:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-04T03:52:45.000Z (7 months ago)
- Last Synced: 2025-11-04T05:33:34.439Z (7 months ago)
- Topics: failsafe, golang, surefire, surefire-reporting
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 7
- Watchers: 8
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Authors: AUTHORS
Awesome Lists containing this project
README
# Surefire Result Parser
Reads Surefire Results from multiple XML files and aggregates then for further processing.
## Features
Surefire XML Test results are parsed into structs. [Data Model](doc/datamodel.md) shows
the data-structure surefire results is converted to.
## Installation
- Install Go, at least version 1.21.0
- Run `make local-build`. This will resolve dependencies and run tests
## Usage
Add module by `go get github.com/adobe/go-surefire`.
Read test-result XML files from `~/test-results` directory.
```
files, _ := listTestReportFiles()
testResults, err := NewJUnitReportsReaderBuilder().Build().FromReportFiles(files)
func listTestReportFiles() ([]string, error) {
sureFireTestResult := []string{}
items, err := os.ReadDir(~/test-results)
if err != nil {
return nil, err
}
for _, item := range items {
if item.Type().IsRegular() && strings.HasSuffix(item.Name(), ".xml") {
sureFireTestResult = append(sureFireTestResult, fmt.Sprintf("%s/%s", path, item.Name()))
}
}
return sureFireTestResult, nil
}
```
There is also support for adding labels to results on Suite level.
```
files, _ := listTestReportFiles()
testResults, err := NewJUnitReportsReaderBuilder().WithLabeler(func(suite TestSuite) []string {
return []string{"label"}
}).Build().FromReportFiles(files)
```
### Contributing
Contributions are welcomed! Read the [Contributing Guide](./.github/CONTRIBUTING.md) for more information.
### Licensing
This project is licensed under the Apache V2 License. See [LICENSE](LICENSE) for more information.