Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contract_verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (w *wellBehavedReloadable) Reload(ctx context.Context, _ []ConfigChange) er
}
return nil
}
func (w *wellBehavedReloadable) CanReload() bool { return true }
func (w *wellBehavedReloadable) CanReload() bool { return true }
func (w *wellBehavedReloadable) ReloadTimeout() time.Duration { return 5 * time.Second }

// zeroTimeoutReloadable returns a zero timeout.
Expand Down
28 changes: 14 additions & 14 deletions health_contract_bdd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import (

// Static errors for health contract BDD tests.
var (
errExpectedOverallHealthy = errors.New("expected overall status to be healthy")
errExpectedOverallUnhealthy = errors.New("expected overall status to be unhealthy")
errExpectedReadinessHealthy = errors.New("expected readiness to be healthy")
errExpectedReadinessUnhealthy = errors.New("expected readiness to be unhealthy")
errExpectedPanicUnhealthy = errors.New("expected panicking provider to report unhealthy")
errExpectedOverallHealthy = errors.New("expected overall status to be healthy")
errExpectedOverallUnhealthy = errors.New("expected overall status to be unhealthy")
errExpectedReadinessHealthy = errors.New("expected readiness to be healthy")
errExpectedReadinessUnhealthy = errors.New("expected readiness to be unhealthy")
errExpectedPanicUnhealthy = errors.New("expected panicking provider to report unhealthy")
errExpectedOtherProvidersChecked = errors.New("expected other providers to still be checked")
errExpectedDegradedStatus = errors.New("expected provider status to be degraded")
errExpectedSingleCall = errors.New("expected provider to be called only once")
errExpectedRefreshCall = errors.New("expected provider to be called again on refresh")
errExpectedStatusChangedEvent = errors.New("expected health status changed event")
errExpectedDegradedStatus = errors.New("expected provider status to be degraded")
errExpectedSingleCall = errors.New("expected provider to be called only once")
errExpectedRefreshCall = errors.New("expected provider to be called again on refresh")
errExpectedStatusChangedEvent = errors.New("expected health status changed event")
)

// healthBDDProvider is a configurable mock HealthProvider for BDD tests.
Expand Down Expand Up @@ -102,11 +102,11 @@ func (s *healthBDDSubject) reset() {

// HealthBDDContext holds state for health contract BDD scenarios.
type HealthBDDContext struct {
service *AggregateHealthService
subject *healthBDDSubject
providers map[string]*healthBDDProvider
result *AggregatedHealth
checkErr error
service *AggregateHealthService
subject *healthBDDSubject
providers map[string]*healthBDDProvider
result *AggregatedHealth
checkErr error
}

func (hc *HealthBDDContext) reset() {
Expand Down
6 changes: 3 additions & 3 deletions health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ type testSubject struct {
events []cloudevents.Event
}

func (s *testSubject) RegisterObserver(_ Observer, _ ...string) error { return nil }
func (s *testSubject) UnregisterObserver(_ Observer) error { return nil }
func (s *testSubject) GetObservers() []ObserverInfo { return nil }
func (s *testSubject) RegisterObserver(_ Observer, _ ...string) error { return nil }
func (s *testSubject) UnregisterObserver(_ Observer) error { return nil }
func (s *testSubject) GetObservers() []ObserverInfo { return nil }
func (s *testSubject) NotifyObservers(_ context.Context, event cloudevents.Event) error {
s.mu.Lock()
s.events = append(s.events, event)
Expand Down
10 changes: 5 additions & 5 deletions logger_decorator_base_bdd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (

// Static errors for logger decorator BDD tests
var (
errLoggerNotSet = errors.New("logger not set")
errBaseLoggerNotSet = errors.New("base logger not set")
errPrimaryLoggerNotSet = errors.New("primary logger not set")
errSecondaryLoggerNotSet = errors.New("secondary logger not set")
errDecoratedLoggerNotSet = errors.New("decorated logger not set")
errLoggerNotSet = errors.New("logger not set")
errBaseLoggerNotSet = errors.New("base logger not set")
errPrimaryLoggerNotSet = errors.New("primary logger not set")
errSecondaryLoggerNotSet = errors.New("secondary logger not set")
errDecoratedLoggerNotSet = errors.New("decorated logger not set")
errNoMessagesLogged = errors.New("no messages logged")
errServiceLoggerMismatch = errors.New("service logger mismatch")
)
Expand Down
4 changes: 2 additions & 2 deletions metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type metricsTestModule struct {
name string
}

func (m *metricsTestModule) Name() string { return m.name }
func (m *metricsTestModule) Name() string { return m.name }
func (m *metricsTestModule) Init(app Application) error { return nil }
func (m *metricsTestModule) CollectMetrics(ctx context.Context) ModuleMetrics {
return ModuleMetrics{
Expand All @@ -22,7 +22,7 @@ type nonMetricsModule struct {
name string
}

func (m *nonMetricsModule) Name() string { return m.name }
func (m *nonMetricsModule) Name() string { return m.name }
func (m *nonMetricsModule) Init(app Application) error { return nil }

func TestCollectAllMetrics(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion observer_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package modular

import (
"slices"
"context"
"errors"
"slices"
"testing"
"time"

Expand Down
6 changes: 3 additions & 3 deletions plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ type testPlugin struct {
hookRan bool
}

func (p *testPlugin) Name() string { return "test-plugin" }
func (p *testPlugin) Modules() []Module { return p.modules }
func (p *testPlugin) Services() []ServiceDefinition { return p.services }
func (p *testPlugin) Name() string { return "test-plugin" }
func (p *testPlugin) Modules() []Module { return p.modules }
func (p *testPlugin) Services() []ServiceDefinition { return p.services }
func (p *testPlugin) InitHooks() []func(Application) error {
return []func(Application) error{
func(app Application) error {
Expand Down
4 changes: 2 additions & 2 deletions reload_contract_bdd_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package modular

import (
"slices"
"context"
"errors"
"fmt"
"slices"
"strings"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -49,7 +49,7 @@ func (m *reloadBDDMockReloadable) Reload(_ context.Context, changes []ConfigChan
return m.reloadErr
}

func (m *reloadBDDMockReloadable) CanReload() bool { return m.canReload }
func (m *reloadBDDMockReloadable) CanReload() bool { return m.canReload }
func (m *reloadBDDMockReloadable) ReloadTimeout() time.Duration { return m.timeout }

// reloadBDDSubject captures events for BDD reload contract tests.
Expand Down
6 changes: 3 additions & 3 deletions reload_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ type reloadableTestModule struct {
reloadCount atomic.Int32
}

func (m *reloadableTestModule) Name() string { return m.name }
func (m *reloadableTestModule) Init(app Application) error { return nil }
func (m *reloadableTestModule) CanReload() bool { return true }
func (m *reloadableTestModule) Name() string { return m.name }
func (m *reloadableTestModule) Init(app Application) error { return nil }
func (m *reloadableTestModule) CanReload() bool { return true }
func (m *reloadableTestModule) ReloadTimeout() time.Duration { return 5 * time.Second }
func (m *reloadableTestModule) Reload(ctx context.Context, changes []ConfigChange) error {
m.reloadCount.Add(1)
Expand Down
2 changes: 1 addition & 1 deletion reload_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package modular

import (
"slices"
"context"
"errors"
"fmt"
"slices"
"strings"
"sync"
"sync/atomic"
Expand Down
2 changes: 1 addition & 1 deletion tenant_config_loader_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package modular

import (
"maps"
"log/slog"
"maps"
"os"
"path/filepath"
"regexp"
Expand Down
Loading