@@ -19,6 +19,8 @@ import (
1919)
2020
2121func TestInterleaved (t * testing.T ) {
22+ t .Parallel ()
23+
2224 var b bytes.Buffer
2325 var o output.Output = output.Interleaved {}
2426 w , _ , _ := o .WrapWriter (& b , io .Discard , "" , nil )
@@ -30,6 +32,8 @@ func TestInterleaved(t *testing.T) {
3032}
3133
3234func TestGroup (t * testing.T ) {
35+ t .Parallel ()
36+
3337 var b bytes.Buffer
3438 var o output.Output = output.Group {}
3539 stdOut , stdErr , cleanup := o .WrapWriter (& b , io .Discard , "" , nil )
@@ -48,6 +52,8 @@ func TestGroup(t *testing.T) {
4852}
4953
5054func TestGroupWithBeginEnd (t * testing.T ) {
55+ t .Parallel ()
56+
5157 tmpl := templater.Cache {
5258 Vars : & ast.Vars {
5359 OrderedMap : omap .FromMap (map [string ]ast.Var {
@@ -61,6 +67,8 @@ func TestGroupWithBeginEnd(t *testing.T) {
6167 End : "::endgroup::" ,
6268 }
6369 t .Run ("simple" , func (t * testing.T ) {
70+ t .Parallel ()
71+
6472 var b bytes.Buffer
6573 w , _ , cleanup := o .WrapWriter (& b , io .Discard , "" , & tmpl )
6674
@@ -72,6 +80,8 @@ func TestGroupWithBeginEnd(t *testing.T) {
7280 assert .Equal (t , "::group::example-value\n foo\n bar\n baz\n ::endgroup::\n " , b .String ())
7381 })
7482 t .Run ("no output" , func (t * testing.T ) {
83+ t .Parallel ()
84+
7585 var b bytes.Buffer
7686 _ , _ , cleanup := o .WrapWriter (& b , io .Discard , "" , & tmpl )
7787 require .NoError (t , cleanup (nil ))
@@ -80,6 +90,8 @@ func TestGroupWithBeginEnd(t *testing.T) {
8090}
8191
8292func TestGroupErrorOnlySwallowsOutputOnNoError (t * testing.T ) {
93+ t .Parallel ()
94+
8395 var b bytes.Buffer
8496 var o output.Output = output.Group {
8597 ErrorOnly : true ,
@@ -94,6 +106,8 @@ func TestGroupErrorOnlySwallowsOutputOnNoError(t *testing.T) {
94106}
95107
96108func TestGroupErrorOnlyShowsOutputOnError (t * testing.T ) {
109+ t .Parallel ()
110+
97111 var b bytes.Buffer
98112 var o output.Output = output.Group {
99113 ErrorOnly : true ,
@@ -107,7 +121,7 @@ func TestGroupErrorOnlyShowsOutputOnError(t *testing.T) {
107121 assert .Equal (t , "std-out\n std-err\n " , b .String ())
108122}
109123
110- func TestPrefixed (t * testing.T ) {
124+ func TestPrefixed (t * testing.T ) { //nolint:paralleltest // cannot run in parallel
111125 var b bytes.Buffer
112126 l := & logger.Logger {
113127 Color : false ,
@@ -116,7 +130,7 @@ func TestPrefixed(t *testing.T) {
116130 var o output.Output = output .NewPrefixed (l )
117131 w , _ , cleanup := o .WrapWriter (& b , io .Discard , "prefix" , nil )
118132
119- t .Run ("simple use cases" , func (t * testing.T ) {
133+ t .Run ("simple use cases" , func (t * testing.T ) { //nolint:paralleltest // cannot run in parallel
120134 b .Reset ()
121135
122136 fmt .Fprintln (w , "foo\n bar" )
@@ -126,7 +140,7 @@ func TestPrefixed(t *testing.T) {
126140 require .NoError (t , cleanup (nil ))
127141 })
128142
129- t .Run ("multiple writes for a single line" , func (t * testing.T ) {
143+ t .Run ("multiple writes for a single line" , func (t * testing.T ) { //nolint:paralleltest // cannot run in parallel
130144 b .Reset ()
131145
132146 for _ , char := range []string {"T" , "e" , "s" , "t" , "!" } {
@@ -140,6 +154,8 @@ func TestPrefixed(t *testing.T) {
140154}
141155
142156func TestPrefixedWithColor (t * testing.T ) {
157+ t .Parallel ()
158+
143159 color .NoColor = false
144160
145161 var b bytes.Buffer
@@ -155,6 +171,8 @@ func TestPrefixedWithColor(t *testing.T) {
155171 }
156172
157173 t .Run ("colors should loop" , func (t * testing.T ) {
174+ t .Parallel ()
175+
158176 for i , w := range writers {
159177 b .Reset ()
160178
@@ -164,7 +182,11 @@ func TestPrefixedWithColor(t *testing.T) {
164182 l .FOutf (& prefix , color , fmt .Sprintf ("prefix-%d" , i ))
165183
166184 fmt .Fprintln (w , "foo\n bar" )
167- assert .Equal (t , fmt .Sprintf ("[%s] foo\n [%s] bar\n " , prefix .String (), prefix .String ()), b .String ())
185+ assert .Equal (
186+ t ,
187+ fmt .Sprintf ("[%s] foo\n [%s] bar\n " , prefix .String (), prefix .String ()),
188+ b .String (),
189+ )
168190 }
169191 })
170192}
0 commit comments