Skip to content

Commit 8810178

Browse files
junitmerge: Support --exclude-skip to filter skip results during merge
Skip results are often useless info, offer an option to drop them.
1 parent ad29eda commit 8810178

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/junitmerge/junitmerge.go

+6
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ func main() {
7070
log.SetFlags(0)
7171
opt := struct {
7272
JSONSummary bool
73+
Skip bool
7374
}{}
75+
flag.BoolVar(&opt.Skip, "exclude-skip", false, "Exclude skipped tests when merging")
7476
flag.BoolVar(&opt.JSONSummary, "json-summary", false, "Convert the result to a single JSON file that summarizes the output")
7577
flag.Parse()
7678

@@ -156,6 +158,9 @@ func main() {
156158

157159
for _, k := range keys {
158160
testCase := suite.runs[k]
161+
if opt.Skip && testCase.SkipMessage != nil {
162+
continue
163+
}
159164
out.TestCases = append(out.TestCases, testCase)
160165
switch {
161166
case testCase.SkipMessage != nil:
@@ -165,6 +170,7 @@ func main() {
165170
}
166171
out.Duration += testCase.Duration
167172
}
173+
out.NumTests = uint(len(out.TestCases))
168174
output.Suites = append(output.Suites, out)
169175
}
170176

0 commit comments

Comments
 (0)