diff --git a/controller/driver_factory_test.go b/controller/driver_factory_test.go index a9abdc8a6..cf0b8ce6b 100644 --- a/controller/driver_factory_test.go +++ b/controller/driver_factory_test.go @@ -356,7 +356,7 @@ func TestNewDriverTask(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - tc.conf.Finalize() + _ = tc.conf.Finalize() var providerConfigs []driver.TerraformProviderBlock if tc.conf != nil && tc.conf.TerraformProviders != nil { @@ -368,7 +368,16 @@ func TestNewDriverTask(t *testing.T) { tasks, err := newTestDriverTasks(tc.conf, providerConfigs) assert.NoError(t, err) - assert.Equal(t, tc.tasks, tasks) + + assert.Equal(t, len(tc.tasks), len(tasks)) + for i := 0; i < len(tc.tasks); i++ { + expected := tc.tasks[i] + actual := tasks[i] + + expected.SetLogger(nil) + actual.SetLogger(nil) + assert.Equal(t, expected, actual) + } }) } } diff --git a/driver/task.go b/driver/task.go index 55f7c3e84..6be5cf252 100644 --- a/driver/task.go +++ b/driver/task.go @@ -225,7 +225,7 @@ func (t *Task) Env() map[string]string { return env } -// ProviderNames returns the list of providers that the task has configured +// Providers returns the list of providers that the task has configured func (t *Task) Providers() TerraformProviderBlocks { t.mu.RLock() defer t.mu.RUnlock() @@ -335,6 +335,10 @@ func (s Service) copy() Service { return cp } +func (t *Task) SetLogger(logger logging.Logger) { + t.logger = logger +} + // configureRootModuleInput sets task values for the module input. func (t *Task) configureRootModuleInput(input *tftmpl.RootModuleInputData) error { t.mu.RLock()