Skip to content

Commit 780e7a3

Browse files
zhangzujianonsi
authored andcommittedMar 26, 2024·
fix github output log level for skipped specs
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
1 parent 9242338 commit 780e7a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎reporters/default_reporter.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,11 @@ func (r *DefaultReporter) emitFailure(indent uint, state types.SpecState, failur
419419
highlightColor := r.highlightColorForState(state)
420420
r.emitBlock(r.fi(indent, highlightColor+"[%s] %s{{/}}", r.humanReadableState(state), failure.Message))
421421
if r.conf.GithubOutput {
422-
r.emitBlock(r.fi(indent, "::error file=%s,line=%d::%s %s", failure.Location.FileName, failure.Location.LineNumber, failure.FailureNodeType, failure.TimelineLocation.Time.Format(types.GINKGO_TIME_FORMAT)))
422+
level := "error"
423+
if state.Is(types.SpecStateSkipped) {
424+
level = "notice"
425+
}
426+
r.emitBlock(r.fi(indent, "::%s file=%s,line=%d::%s %s", level, failure.Location.FileName, failure.Location.LineNumber, failure.FailureNodeType, failure.TimelineLocation.Time.Format(types.GINKGO_TIME_FORMAT)))
423427
} else {
424428
r.emitBlock(r.fi(indent, highlightColor+"In {{bold}}[%s]{{/}}"+highlightColor+" at: {{bold}}%s{{/}} {{gray}}@ %s{{/}}\n", failure.FailureNodeType, failure.Location, failure.TimelineLocation.Time.Format(types.GINKGO_TIME_FORMAT)))
425429
}

0 commit comments

Comments
 (0)
Please sign in to comment.