@@ -52,7 +52,7 @@ type Coordinator struct {
5252 testDescriptorIndex uint64
5353
5454 testRunMap map [uint64 ]types.Test
55- testQueue []types.Test
55+ testQueue []types.TestRunner
5656 testHistory []types.Test
5757 testRegistryMutex sync.RWMutex
5858 testNotificationChan chan bool
@@ -75,7 +75,7 @@ func NewCoordinator(config *Config, log logrus.FieldLogger, metricsPort int) *Co
7575
7676 testDescriptors : map [string ]testDescriptorEntry {},
7777 testRunMap : map [uint64 ]types.Test {},
78- testQueue : []types.Test {},
78+ testQueue : []types.TestRunner {},
7979 testHistory : []types.Test {},
8080 testNotificationChan : make (chan bool , 1 ),
8181 }
@@ -328,7 +328,9 @@ func (c *Coordinator) GetTestQueue() []types.Test {
328328 defer c .testRegistryMutex .RUnlock ()
329329
330330 tests := make ([]types.Test , len (c .testQueue ))
331- copy (tests , c .testQueue )
331+ for idx , test := range c .testQueue {
332+ tests [idx ] = test
333+ }
332334
333335 return tests
334336}
@@ -355,7 +357,7 @@ func (c *Coordinator) startMetrics() error {
355357 return err
356358}
357359
358- func (c * Coordinator ) ScheduleTest (descriptor types.TestDescriptor , configOverrides map [string ]any , allowDuplicate bool ) (types.Test , error ) {
360+ func (c * Coordinator ) ScheduleTest (descriptor types.TestDescriptor , configOverrides map [string ]any , allowDuplicate bool ) (types.TestRunner , error ) {
359361 if descriptor .Err () != nil {
360362 return nil , fmt .Errorf ("cannot create test from failed test descriptor: %w" , descriptor .Err ())
361363 }
@@ -373,7 +375,7 @@ func (c *Coordinator) ScheduleTest(descriptor types.TestDescriptor, configOverri
373375 return testRef , nil
374376}
375377
376- func (c * Coordinator ) createTestRun (descriptor types.TestDescriptor , configOverrides map [string ]any , allowDuplicate bool ) (types.Test , error ) {
378+ func (c * Coordinator ) createTestRun (descriptor types.TestDescriptor , configOverrides map [string ]any , allowDuplicate bool ) (types.TestRunner , error ) {
377379 c .testSchedulerMutex .Lock ()
378380 defer c .testSchedulerMutex .Unlock ()
379381
@@ -417,7 +419,7 @@ func (c *Coordinator) runTestExecutionLoop(ctx context.Context) {
417419 semaphore := make (chan bool , concurrencyLimit )
418420
419421 for {
420- var nextTest types.Test
422+ var nextTest types.TestRunner
421423
422424 c .testRegistryMutex .Lock ()
423425 if len (c .testQueue ) > 0 {
@@ -429,7 +431,7 @@ func (c *Coordinator) runTestExecutionLoop(ctx context.Context) {
429431
430432 if nextTest != nil {
431433 // run next test
432- testFunc := func (nextTest types.Test ) {
434+ testFunc := func (nextTest types.TestRunner ) {
433435 defer func () { <- semaphore }()
434436 c .runTest (ctx , nextTest )
435437 }
@@ -448,7 +450,7 @@ func (c *Coordinator) runTestExecutionLoop(ctx context.Context) {
448450 }
449451}
450452
451- func (c * Coordinator ) runTest (ctx context.Context , testRef types.Test ) {
453+ func (c * Coordinator ) runTest (ctx context.Context , testRef types.TestRunner ) {
452454 c .lastExecutedRunID = testRef .RunID ()
453455
454456 if err := testRef .Validate (); err != nil {
0 commit comments