@@ -332,16 +332,16 @@ func getConfigConsolidationTestCases() []configConsolidationTestCase {
332
332
333
333
// Test system tags
334
334
{opts {}, exp {}, func (t * testing.T , c Config ) {
335
- assert .Equal (t , & metrics .DefaultSystemTagSet , c .Options . SystemTags )
335
+ assert .Equal (t , & metrics .DefaultSystemTagSet , c .SystemTags )
336
336
}},
337
337
{opts {cli : []string {"--system-tags" , `""` }}, exp {}, func (t * testing.T , c Config ) {
338
- assert .Equal (t , metrics .SystemTagSet (0 ), * c .Options . SystemTags )
338
+ assert .Equal (t , metrics .SystemTagSet (0 ), * c .SystemTags )
339
339
}},
340
340
{opts {env : []string {`K6_SYSTEM_TAGS=""` }}, exp {}, func (t * testing.T , c Config ) {
341
- assert .Equal (t , metrics .SystemTagSet (0 ), * c .Options . SystemTags )
341
+ assert .Equal (t , metrics .SystemTagSet (0 ), * c .SystemTags )
342
342
}},
343
343
{opts {env : []string {`K6_SYSTEM_TAGS=proto,method` }}, exp {}, func (t * testing.T , c Config ) {
344
- assert .Equal (t , metrics .SystemTagSet (metrics .TagProto | metrics .TagMethod ), * c .Options . SystemTags )
344
+ assert .Equal (t , metrics .SystemTagSet (metrics .TagProto | metrics .TagMethod ), * c .SystemTags )
345
345
}},
346
346
{
347
347
opts {
@@ -354,7 +354,7 @@ func getConfigConsolidationTestCases() []configConsolidationTestCase {
354
354
assert .Equal (
355
355
t ,
356
356
* metrics .NewSystemTagSet (metrics .TagSubproto , metrics .TagURL ),
357
- * c .Options . SystemTags ,
357
+ * c .SystemTags ,
358
358
)
359
359
},
360
360
},
@@ -374,61 +374,61 @@ func getConfigConsolidationTestCases() []configConsolidationTestCase {
374
374
375
375
// Test summary trend stats
376
376
{opts {}, exp {}, func (t * testing.T , c Config ) {
377
- assert .Equal (t , lib .DefaultSummaryTrendStats , c .Options . SummaryTrendStats )
377
+ assert .Equal (t , lib .DefaultSummaryTrendStats , c .SummaryTrendStats )
378
378
}},
379
379
{opts {cli : []string {"--summary-trend-stats" , "" }}, exp {}, func (t * testing.T , c Config ) {
380
- assert .Equal (t , []string {}, c .Options . SummaryTrendStats )
380
+ assert .Equal (t , []string {}, c .SummaryTrendStats )
381
381
}},
382
382
{opts {cli : []string {"--summary-trend-stats" , "coun" }}, exp {consolidationError : true }, nil },
383
383
{opts {cli : []string {"--summary-trend-stats" , "med,avg,p(" }}, exp {consolidationError : true }, nil },
384
384
{opts {cli : []string {"--summary-trend-stats" , "med,avg,p(-1)" }}, exp {consolidationError : true }, nil },
385
385
{opts {cli : []string {"--summary-trend-stats" , "med,avg,p(101)" }}, exp {consolidationError : true }, nil },
386
386
{opts {cli : []string {"--summary-trend-stats" , "med,avg,p(99.999)" }}, exp {}, func (t * testing.T , c Config ) {
387
- assert .Equal (t , []string {"med" , "avg" , "p(99.999)" }, c .Options . SummaryTrendStats )
387
+ assert .Equal (t , []string {"med" , "avg" , "p(99.999)" }, c .SummaryTrendStats )
388
388
}},
389
389
{
390
390
opts {runner : & lib.Options {SummaryTrendStats : []string {"avg" , "p(90)" , "count" }}},
391
391
exp {},
392
392
func (t * testing.T , c Config ) {
393
- assert .Equal (t , []string {"avg" , "p(90)" , "count" }, c .Options . SummaryTrendStats )
393
+ assert .Equal (t , []string {"avg" , "p(90)" , "count" }, c .SummaryTrendStats )
394
394
},
395
395
},
396
396
{opts {cli : []string {}}, exp {}, func (t * testing.T , c Config ) {
397
397
assert .Equal (t , types.DNSConfig {
398
398
TTL : null .NewString ("5m" , false ),
399
399
Select : types.NullDNSSelect {DNSSelect : types .DNSrandom , Valid : false },
400
400
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSpreferIPv4 , Valid : false },
401
- }, c .Options . DNS )
401
+ }, c .DNS )
402
402
}},
403
403
{opts {env : []string {"K6_DNS=ttl=5,select=roundRobin" }}, exp {}, func (t * testing.T , c Config ) {
404
404
assert .Equal (t , types.DNSConfig {
405
405
TTL : null .StringFrom ("5" ),
406
406
Select : types.NullDNSSelect {DNSSelect : types .DNSroundRobin , Valid : true },
407
407
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSpreferIPv4 , Valid : false },
408
- }, c .Options . DNS )
408
+ }, c .DNS )
409
409
}},
410
410
{opts {env : []string {"K6_DNS=ttl=inf,select=random,policy=preferIPv6" }}, exp {}, func (t * testing.T , c Config ) {
411
411
assert .Equal (t , types.DNSConfig {
412
412
TTL : null .StringFrom ("inf" ),
413
413
Select : types.NullDNSSelect {DNSSelect : types .DNSrandom , Valid : true },
414
414
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSpreferIPv6 , Valid : true },
415
- }, c .Options . DNS )
415
+ }, c .DNS )
416
416
}},
417
417
// This is functionally invalid, but will error out in validation done in js.parseTTL().
418
418
{opts {cli : []string {"--dns" , "ttl=-1" }}, exp {}, func (t * testing.T , c Config ) {
419
419
assert .Equal (t , types.DNSConfig {
420
420
TTL : null .StringFrom ("-1" ),
421
421
Select : types.NullDNSSelect {DNSSelect : types .DNSrandom , Valid : false },
422
422
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSpreferIPv4 , Valid : false },
423
- }, c .Options . DNS )
423
+ }, c .DNS )
424
424
}},
425
425
{opts {cli : []string {"--dns" , "ttl=0,blah=nope" }}, exp {cliReadError : true }, nil },
426
426
{opts {cli : []string {"--dns" , "ttl=0" }}, exp {}, func (t * testing.T , c Config ) {
427
427
assert .Equal (t , types.DNSConfig {
428
428
TTL : null .StringFrom ("0" ),
429
429
Select : types.NullDNSSelect {DNSSelect : types .DNSrandom , Valid : false },
430
430
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSpreferIPv4 , Valid : false },
431
- }, c .Options . DNS )
431
+ }, c .DNS )
432
432
}},
433
433
{opts {cli : []string {"--dns" , "ttl=5s,select=" }}, exp {cliReadError : true }, nil },
434
434
{
@@ -439,7 +439,7 @@ func getConfigConsolidationTestCases() []configConsolidationTestCase {
439
439
TTL : null .StringFrom ("0" ),
440
440
Select : types.NullDNSSelect {DNSSelect : types .DNSroundRobin , Valid : true },
441
441
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSonlyIPv4 , Valid : true },
442
- }, c .Options . DNS )
442
+ }, c .DNS )
443
443
},
444
444
},
445
445
{
@@ -453,7 +453,7 @@ func getConfigConsolidationTestCases() []configConsolidationTestCase {
453
453
TTL : null .StringFrom ("30" ),
454
454
Select : types.NullDNSSelect {DNSSelect : types .DNSrandom , Valid : false },
455
455
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSany , Valid : true },
456
- }, c .Options . DNS )
456
+ }, c .DNS )
457
457
},
458
458
},
459
459
{
@@ -469,15 +469,15 @@ func getConfigConsolidationTestCases() []configConsolidationTestCase {
469
469
TTL : null .StringFrom ("5" ),
470
470
Select : types.NullDNSSelect {DNSSelect : types .DNSrandom , Valid : true },
471
471
Policy : types.NullDNSPolicy {DNSPolicy : types .DNSany , Valid : true },
472
- }, c .Options . DNS )
472
+ }, c .DNS )
473
473
},
474
474
},
475
475
{
476
476
opts {env : []string {"K6_NO_SETUP=true" , "K6_NO_TEARDOWN=false" }},
477
477
exp {},
478
478
func (t * testing.T , c Config ) {
479
- assert .Equal (t , null .BoolFrom (true ), c .Options . NoSetup )
480
- assert .Equal (t , null .BoolFrom (false ), c .Options . NoTeardown )
479
+ assert .Equal (t , null .BoolFrom (true ), c .NoSetup )
480
+ assert .Equal (t , null .BoolFrom (false ), c .NoTeardown )
481
481
},
482
482
},
483
483
{
@@ -509,7 +509,7 @@ func runTestCase(t *testing.T, testCase configConsolidationTestCase, subCmd stri
509
509
ts .CmdArgs = append ([]string {"k6" , subCmd }, testCase .options .cli ... )
510
510
ts .Env = state .BuildEnvMap (testCase .options .env )
511
511
if testCase .options .fs != nil {
512
- ts .GlobalState . FS = testCase .options .fs
512
+ ts .FS = testCase .options .fs
513
513
}
514
514
515
515
rootCmd := newRootCommand (ts .GlobalState )
0 commit comments