From 0cb74080c01cef88fd6dd6a0beebec7421fc495e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 23:13:07 +0000 Subject: [PATCH 1/4] Initial plan From dc920d6f2cf6e7647f8cfa14dc9d2601459d421c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 23:19:11 +0000 Subject: [PATCH 2/4] Fix MockApplication missing IsVerboseConfig and SetVerboseConfig methods Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --- modules/reverseproxy/mock_test.go | 11 +++++++++++ modules/reverseproxy/tenant_backend_test.go | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/modules/reverseproxy/mock_test.go b/modules/reverseproxy/mock_test.go index be84a720..4f1556c6 100644 --- a/modules/reverseproxy/mock_test.go +++ b/modules/reverseproxy/mock_test.go @@ -12,6 +12,7 @@ type MockApplication struct { configSections map[string]modular.ConfigProvider services map[string]interface{} logger modular.Logger + verboseConfig bool } // NewMockApplication creates a new mock application for testing @@ -120,6 +121,16 @@ func (m *MockApplication) SetLogger(logger modular.Logger) { m.logger = logger } +// IsVerboseConfig returns whether verbose configuration debugging is enabled for the mock +func (m *MockApplication) IsVerboseConfig() bool { + return m.verboseConfig +} + +// SetVerboseConfig enables or disables verbose configuration debugging for the mock +func (m *MockApplication) SetVerboseConfig(enabled bool) { + m.verboseConfig = enabled +} + // NewStdConfigProvider is a simple mock implementation of modular.ConfigProvider func NewStdConfigProvider(config interface{}) modular.ConfigProvider { return &mockConfigProvider{config: config} diff --git a/modules/reverseproxy/tenant_backend_test.go b/modules/reverseproxy/tenant_backend_test.go index 67b58b0f..4f6f6ed9 100644 --- a/modules/reverseproxy/tenant_backend_test.go +++ b/modules/reverseproxy/tenant_backend_test.go @@ -446,6 +446,15 @@ func (m *mockTenantApplication) WithTenant(tid modular.TenantID) (*modular.Tenan return args.Get(0).(*modular.TenantContext), args.Error(1) } +func (m *mockTenantApplication) IsVerboseConfig() bool { + args := m.Called() + return args.Bool(0) +} + +func (m *mockTenantApplication) SetVerboseConfig(enabled bool) { + m.Called(enabled) +} + type mockLogger struct{} func (m *mockLogger) Debug(msg string, args ...interface{}) {} From bab1d322685ff079df6936163942adbc348dbab9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 10 Jul 2025 23:23:54 +0000 Subject: [PATCH 3/4] Fix MockApplication missing methods across all modules Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --- modules/auth/module_test.go | 11 +++++++++++ modules/chimux/mock_test.go | 11 +++++++++++ modules/httpclient/module_test.go | 9 +++++++++ modules/httpserver/module_test.go | 9 +++++++++ 4 files changed, 40 insertions(+) diff --git a/modules/auth/module_test.go b/modules/auth/module_test.go index a0785b64..e4265f35 100644 --- a/modules/auth/module_test.go +++ b/modules/auth/module_test.go @@ -15,6 +15,7 @@ type MockApplication struct { configSections map[string]modular.ConfigProvider services map[string]interface{} logger modular.Logger + verboseConfig bool } // NewMockApplication creates a new mock application @@ -110,6 +111,16 @@ func (m *MockApplication) Run() error { return nil } +// IsVerboseConfig returns whether verbose configuration debugging is enabled for the mock +func (m *MockApplication) IsVerboseConfig() bool { + return m.verboseConfig +} + +// SetVerboseConfig enables or disables verbose configuration debugging for the mock +func (m *MockApplication) SetVerboseConfig(enabled bool) { + m.verboseConfig = enabled +} + // MockLogger implements a minimal logger for testing type MockLogger struct{} diff --git a/modules/chimux/mock_test.go b/modules/chimux/mock_test.go index cdab4e6d..fb59632e 100644 --- a/modules/chimux/mock_test.go +++ b/modules/chimux/mock_test.go @@ -22,6 +22,7 @@ type MockApplication struct { services map[string]interface{} logger modular.Logger tenantService *MockTenantService + verboseConfig bool } // NewMockApplication creates a new mock application for testing @@ -141,6 +142,16 @@ func (m *MockApplication) SetLogger(logger modular.Logger) { m.logger = logger } +// IsVerboseConfig returns whether verbose configuration debugging is enabled for the mock +func (m *MockApplication) IsVerboseConfig() bool { + return m.verboseConfig +} + +// SetVerboseConfig enables or disables verbose configuration debugging for the mock +func (m *MockApplication) SetVerboseConfig(enabled bool) { + m.verboseConfig = enabled +} + // TenantApplication interface methods // GetTenantService returns the application's tenant service func (m *MockApplication) GetTenantService() (modular.TenantService, error) { diff --git a/modules/httpclient/module_test.go b/modules/httpclient/module_test.go index bed53570..a07e3f62 100644 --- a/modules/httpclient/module_test.go +++ b/modules/httpclient/module_test.go @@ -75,6 +75,15 @@ func (m *MockApplication) Init() error { func (m *MockApplication) Start() error { return nil } func (m *MockApplication) Stop() error { return nil } +func (m *MockApplication) IsVerboseConfig() bool { + args := m.Called() + return args.Bool(0) +} + +func (m *MockApplication) SetVerboseConfig(enabled bool) { + m.Called(enabled) +} + // MockLogger implements modular.Logger interface for testing type MockLogger struct { mock.Mock diff --git a/modules/httpserver/module_test.go b/modules/httpserver/module_test.go index ed8ea23c..3540026d 100644 --- a/modules/httpserver/module_test.go +++ b/modules/httpserver/module_test.go @@ -99,6 +99,15 @@ func (m *MockApplication) Run() error { return args.Error(0) } +func (m *MockApplication) IsVerboseConfig() bool { + args := m.Called() + return args.Bool(0) +} + +func (m *MockApplication) SetVerboseConfig(enabled bool) { + m.Called(enabled) +} + // MockLogger is a mock implementation of the modular.Logger interface type MockLogger struct { mock.Mock From 3e6b93e7f91baa02e987fba19205530d8abcb36f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Jul 2025 14:34:03 +0000 Subject: [PATCH 4/4] Fix SimpleMockApplication missing IsVerboseConfig and SetVerboseConfig methods in httpserver module Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --- modules/httpserver/certificate_service_test.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/httpserver/certificate_service_test.go b/modules/httpserver/certificate_service_test.go index 2bb3069d..0e624077 100644 --- a/modules/httpserver/certificate_service_test.go +++ b/modules/httpserver/certificate_service_test.go @@ -42,9 +42,10 @@ func (m *MockCertificateService) AddCertificate(domain string, cert *tls.Certifi // SimpleMockApplication is a minimal implementation for the certificate service tests type SimpleMockApplication struct { - config map[string]modular.ConfigProvider - logger modular.Logger - defaultCfg modular.ConfigProvider + config map[string]modular.ConfigProvider + logger modular.Logger + defaultCfg modular.ConfigProvider + verboseConfig bool } func NewSimpleMockApplication() *SimpleMockApplication { @@ -118,6 +119,16 @@ func (m *SimpleMockApplication) Run() error { return nil // No-op for these tests } +// IsVerboseConfig returns whether verbose configuration debugging is enabled +func (m *SimpleMockApplication) IsVerboseConfig() bool { + return m.verboseConfig +} + +// SetVerboseConfig enables or disables verbose configuration debugging +func (m *SimpleMockApplication) SetVerboseConfig(enabled bool) { + m.verboseConfig = enabled +} + // SimpleMockLogger implements modular.Logger for certificate service tests type SimpleMockLogger struct{}