This repository has been archived by the owner on Jul 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
interfaces.go
39 lines (28 loc) · 1.65 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package stack
import "github.com/openshift/origin/tools/junitreport/pkg/api"
// TestDataParser knows how to take raw test data and extract the useful information from it
type TestDataParser interface {
// MarksBeginning determines if the line marks the begining of a test case
MarksBeginning(line string) bool
// ExtractName extracts the name of the test case from test output lines
ExtractName(line string) (name string, succeeded bool)
// ExtractResult extracts the test result from a test output line
ExtractResult(line string) (result api.TestResult, succeeded bool)
// ExtractDuration extracts the test duration from a test output line
ExtractDuration(line string) (duration string, succeeded bool)
// ExtractMessage extracts a message (e.g. for signalling why a failure or skip occured) from a test output line
ExtractMessage(line string) (message string, succeeded bool)
// MarksCompletion determines if the line marks the completion of a test case
MarksCompletion(line string) bool
}
// TestSuiteDataParser knows how to take raw test suite data and extract the useful information from it
type TestSuiteDataParser interface {
// MarksBeginning determines if the line marks the begining of a test suite
MarksBeginning(line string) bool
// ExtractName extracts the name of the test suite from a test output line
ExtractName(line string) (name string, succeeded bool)
// ExtractProperties extracts any metadata properties of the test suite from a test output line
ExtractProperties(line string) (properties map[string]string, succeeded bool)
// MarksCompletion determines if the line marks the completion of a test suite
MarksCompletion(line string) bool
}