Skip to content

Commit

Permalink
add a simple junit error utility
Browse files Browse the repository at this point in the history
  • Loading branch information
BenTheElder authored and amwat committed Jul 7, 2020
1 parent cd717b4 commit 75f1cca
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkg/metadata/junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ type JUnitError interface {
SystemOut() string
}

type simpleJUnitError struct {
error
systemOut string
}

// ensure simpleJUnitError implements JUnitError
var _ JUnitError = &simpleJUnitError{}

func (s *simpleJUnitError) SystemOut() string {
return s.systemOut
}

// NewJUnitError returns a simple instance of JUnitError wrapping systemOut
func NewJUnitError(inner error, systemOut string) error {
return &simpleJUnitError{
error: inner,
systemOut: systemOut,
}
}

// testSuite holds a slice of TestCase and other summary metadata.
//
// A build (column in testgrid) is composed of one or more TestSuites.
Expand Down

0 comments on commit 75f1cca

Please sign in to comment.