@@ -15,11 +15,13 @@ import (
1515)
1616
1717func Test_NotFoundError (t * testing.T ) {
18+ t .Parallel ()
1819 nfe := NewNotFoundError ("test" )
1920 assert .Equal (t , "could not find \" test\" in map" , nfe .Error ())
2021}
2122
2223func Test_popValue (t * testing.T ) {
24+ t .Parallel ()
2325 m , err := values .NewMap (
2426 map [string ]any {
2527 "test" : "value" ,
@@ -28,20 +30,20 @@ func Test_popValue(t *testing.T) {
2830 )
2931 require .NoError (t , err )
3032
31- t .Run ("success" , func (t * testing.T ) {
33+ t .Run ("success" , func (t * testing.T ) { //nolint:paralleltest // subtests share and mutate map
3234 var gotValue string
3335 gotValue , err = popValue [string ](m , "test" )
3436 require .NoError (t , err )
3537 assert .Equal (t , "value" , gotValue )
3638 })
3739
38- t .Run ("not found" , func (t * testing.T ) {
40+ t .Run ("not found" , func (t * testing.T ) { //nolint:paralleltest // subtests share and mutate map
3941 _ , err = popValue [string ](m , "foo" )
4042 var nfe * NotFoundError
4143 require .ErrorAs (t , err , & nfe )
4244 })
4345
44- t .Run ("type mismatch" , func (t * testing.T ) {
46+ t .Run ("type mismatch" , func (t * testing.T ) { //nolint:paralleltest // subtests share and mutate map
4547 _ , err = popValue [string ](m , "mismatch" )
4648 require .Error (t , err )
4749 require .ErrorContains (t , err , "could not unwrap value" )
@@ -51,28 +53,29 @@ func Test_popValue(t *testing.T) {
5153}
5254
5355func Test_popOptionalValue (t * testing.T ) {
56+ t .Parallel ()
5457 m , err := values .NewMap (
5558 map [string ]any {
5659 "test" : "value" ,
5760 "buzz" : "fizz" ,
5861 },
5962 )
6063 require .NoError (t , err )
61- t .Run ("found value" , func (t * testing.T ) {
64+ t .Run ("found value" , func (t * testing.T ) { //nolint:paralleltest // subtests share and mutate map
6265 var gotValue string
6366 gotValue , err = popOptionalValue [string ](m , "test" )
6467 require .NoError (t , err )
6568 assert .Equal (t , "value" , gotValue )
6669 })
6770
68- t .Run ("not found returns nil error" , func (t * testing.T ) {
71+ t .Run ("not found returns nil error" , func (t * testing.T ) { //nolint:paralleltest // subtests share and mutate map
6972 var gotValue string
7073 gotValue , err = popOptionalValue [string ](m , "foo" )
7174 require .NoError (t , err )
7275 assert .Empty (t , gotValue )
7376 })
7477
75- t .Run ("some other error fails" , func (t * testing.T ) {
78+ t .Run ("some other error fails" , func (t * testing.T ) { //nolint:paralleltest // subtests share and mutate map
7679 var gotValue int
7780 gotValue , err = popOptionalValue [int ](m , "buzz" )
7881 require .Error (t , err )
@@ -83,11 +86,13 @@ func Test_popOptionalValue(t *testing.T) {
8386}
8487
8588func Test_transformer (t * testing.T ) {
89+ t .Parallel ()
8690 var (
8791 lgger = logger .Test (t )
8892 emitter = custmsg .NewLabeler ()
8993 )
9094 t .Run ("success" , func (t * testing.T ) {
95+ t .Parallel ()
9196 giveMap , err := values .NewMap (map [string ]any {
9297 "maxMemoryMBs" : 1024 ,
9398 "timeout" : "4s" ,
@@ -126,6 +131,7 @@ func Test_transformer(t *testing.T) {
126131 })
127132
128133 t .Run ("success missing optional fields" , func (t * testing.T ) {
134+ t .Parallel ()
129135 giveMap , err := values .NewMap (map [string ]any {
130136 "binary" : []byte {0x01 , 0x02 , 0x03 },
131137 "config" : []byte {0x04 , 0x05 , 0x06 },
@@ -158,6 +164,7 @@ func Test_transformer(t *testing.T) {
158164 })
159165
160166 t .Run ("fails parsing timeout" , func (t * testing.T ) {
167+ t .Parallel ()
161168 giveMap , err := values .NewMap (map [string ]any {
162169 "timeout" : "not a duration" ,
163170 "binary" : []byte {0x01 , 0x02 , 0x03 },
@@ -178,6 +185,7 @@ func Test_transformer(t *testing.T) {
178185 })
179186
180187 t .Run ("fails parsing tick interval" , func (t * testing.T ) {
188+ t .Parallel ()
181189 giveMap , err := values .NewMap (map [string ]any {
182190 "tickInterval" : "not a duration" ,
183191 "binary" : []byte {0x01 , 0x02 , 0x03 },
@@ -198,6 +206,7 @@ func Test_transformer(t *testing.T) {
198206 })
199207
200208 t .Run ("invalid tickInterval, applies default" , func (t * testing.T ) {
209+ t .Parallel ()
201210 giveMap , err := values .NewMap (map [string ]any {
202211 "tickInterval" : "-50ms" ,
203212 "binary" : []byte {0x01 , 0x02 , 0x03 },
@@ -218,6 +227,7 @@ func Test_transformer(t *testing.T) {
218227 })
219228
220229 t .Run ("invalid timeout, applies default" , func (t * testing.T ) {
230+ t .Parallel ()
221231 giveMap , err := values .NewMap (map [string ]any {
222232 "timeout" : "-50ms" ,
223233 "binary" : []byte {0x01 , 0x02 , 0x03 },
@@ -238,6 +248,7 @@ func Test_transformer(t *testing.T) {
238248 })
239249
240250 t .Run ("timeout too high, applies default" , func (t * testing.T ) {
251+ t .Parallel ()
241252 giveMap , err := values .NewMap (map [string ]any {
242253 "timeout" : "1h" ,
243254 "binary" : []byte {0x01 , 0x02 , 0x03 },
@@ -258,6 +269,7 @@ func Test_transformer(t *testing.T) {
258269 })
259270
260271 t .Run ("tickInterval too high, applies default" , func (t * testing.T ) {
272+ t .Parallel ()
261273 giveMap , err := values .NewMap (map [string ]any {
262274 "tickInterval" : "1h" ,
263275 "binary" : []byte {0x01 , 0x02 , 0x03 },
@@ -278,6 +290,7 @@ func Test_transformer(t *testing.T) {
278290 })
279291
280292 t .Run ("applies default tick interval if missing" , func (t * testing.T ) {
293+ t .Parallel ()
281294 giveMap , err := values .NewMap (map [string ]any {
282295 "binary" : []byte {0x01 , 0x02 , 0x03 },
283296 "config" : []byte {0x04 , 0x05 , 0x06 },
0 commit comments