From 780e7a34f234c0915629de3a38535df9b65b62e9 Mon Sep 17 00:00:00 2001 From: zhangzujian Date: Mon, 25 Mar 2024 02:44:31 +0000 Subject: [PATCH] fix github output log level for skipped specs Signed-off-by: zhangzujian --- reporters/default_reporter.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reporters/default_reporter.go b/reporters/default_reporter.go index 4026859ec..980973370 100644 --- a/reporters/default_reporter.go +++ b/reporters/default_reporter.go @@ -419,7 +419,11 @@ func (r *DefaultReporter) emitFailure(indent uint, state types.SpecState, failur highlightColor := r.highlightColorForState(state) r.emitBlock(r.fi(indent, highlightColor+"[%s] %s{{/}}", r.humanReadableState(state), failure.Message)) if r.conf.GithubOutput { - 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))) + level := "error" + if state.Is(types.SpecStateSkipped) { + level = "notice" + } + 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))) } else { 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))) }