Skip to content

Commit 3a6097a

Browse files
lahabanaonsi
authored andcommitted
add test
Signed-off-by: Charly Molter <[email protected]>
1 parent 6e80d3f commit 3a6097a

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

reporters/default_reporter.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ func (r *DefaultReporter) wrapTextBlock(sectionName string, fn func()) {
187187
if r.conf.GithubOutput {
188188
r.emitBlock(r.fi(1, "::group::%s", sectionName))
189189
} else {
190-
r.emitBlock(r.fi(1, "{{gray}}<< %s{{/}}", sectionName))
190+
r.emitBlock(r.fi(1, "{{gray}}%s >>{{/}}", sectionName))
191191
}
192192
fn()
193193
if r.conf.GithubOutput {
194194
r.emitBlock(r.fi(1, "::endgroup::"))
195195
} else {
196-
r.emitBlock(r.fi(1, "{{gray}}%s >>{{/}}", sectionName))
196+
r.emitBlock(r.fi(1, "{{gray}}<< %s{{/}}", sectionName))
197197
}
198198

199199
}

reporters/default_reporter_test.go

+17
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ const (
176176
VeryVerbose
177177
FullTrace
178178
ShowNodeEvents
179+
GithubOutput
179180

180181
Parallel //used in the WillRun => DidRun specs to capture behavior when running in parallel
181182
)
@@ -204,6 +205,9 @@ func (cf ConfigFlag) String() string {
204205
if cf.Has(Parallel) {
205206
out = append(out, "parallel")
206207
}
208+
if cf.Has(GithubOutput) {
209+
out = append(out, "github-output")
210+
}
207211
return strings.Join(out, "|")
208212
}
209213

@@ -226,6 +230,7 @@ func C(flags ...ConfigFlag) types.ReporterConfig {
226230
VeryVerbose: f.Has(VeryVerbose),
227231
FullTrace: f.Has(FullTrace),
228232
ShowNodeEvents: f.Has(ShowNodeEvents),
233+
GithubOutput: f.Has(GithubOutput),
229234
}
230235
}
231236

@@ -770,6 +775,18 @@ var _ = Describe("DefaultReporter", func() {
770775
" {{gray}}<< Captured StdOut/StdErr Output{{/}}",
771776
DELIMITER,
772777
""),
778+
Case(Parallel|GithubOutput,
779+
DELIMITER,
780+
spr("{{green}}%s [1.000 seconds]{{/}}", DENOTER),
781+
"{{green}}{{bold}}A{{/}}",
782+
"{{gray}}cl0.go:12{{/}}",
783+
"",
784+
" ::group::Captured StdOut/StdErr Output",
785+
" hello there",
786+
" this is my output",
787+
" ::endgroup::",
788+
DELIMITER,
789+
""),
773790
),
774791
Entry("a passing test with a full timeline that is only visible in verbose/very-verbose mode",
775792
S(types.NodeTypeIt, "A", cl0, GW("some GinkgoWriter\noutput is interspersed\nhere and there\n"),

0 commit comments

Comments
 (0)