Skip to content

Commit

Permalink
Fix merge issues in separate commit to highlight them
Browse files Browse the repository at this point in the history
  • Loading branch information
ogaca-dd committed Dec 8, 2023
1 parent 97bcc2b commit d4ae5cb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
16 changes: 10 additions & 6 deletions comp/core/log/logimpl/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,22 @@ import (
)

// Module defines the fx options for this component.
var Module fx.Option = fxutil.Component(
fx.Provide(newAgentLogger),
)
func Module() fxutil.Module {
return fxutil.Component(
fx.Provide(newAgentLogger),
)
}

// TraceModule defines the fx options for this component in its Trace variant.
//
// TODO(components): move this comp/trace; that component shall implement the
//
// log.Component interface.
var TraceModule fx.Option = fxutil.Component(
fx.Provide(newTraceLogger),
)
func TraceModule() fxutil.Module {
return fxutil.Component(
fx.Provide(newTraceLogger),
)
}

// logger implements the component
type logger struct {
Expand Down
16 changes: 10 additions & 6 deletions comp/core/log/logimpl/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@ import (
)

// MockModule defines the fx options for the mock component.
var MockModule fx.Option = fxutil.Component(
fx.Provide(newMockLogger),
)
func MockModule() fxutil.Module {
return fxutil.Component(
fx.Provide(newMockLogger),
)
}

// TraceMockModule defines the fx options for the mock component in its Trace variant.
var TraceMockModule fx.Option = fxutil.Component(
fx.Provide(newTraceMockLogger),
)
func TraceMockModule() fxutil.Module {
return fxutil.Component(
fx.Provide(newTraceMockLogger),
)
}

// tbWriter is an implementation of io.Writer that sends lines to
// testing.TB#Log.
Expand Down
2 changes: 1 addition & 1 deletion pkg/collector/corechecks/snmp/snmp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type deps struct {
}

func createDeps(t *testing.T) deps {
return fxutil.Test[deps](t, demultiplexer.MockModule(), defaultforwarder.MockModule, config.MockModule(), logimpl.MockModule)
return fxutil.Test[deps](t, demultiplexer.MockModule(), defaultforwarder.MockModule(), config.MockModule(), logimpl.MockModule())
}

func Test_Run_simpleCase(t *testing.T) {
Expand Down

0 comments on commit d4ae5cb

Please sign in to comment.