Skip to content

Commit d591c90

Browse files
committed
Fixed broken test and lints
1 parent 18b3914 commit d591c90

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

capabilities/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ go 1.24.1
55
require (
66
github.com/google/uuid v1.6.0
77
github.com/jpillora/backoff v1.0.0
8-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250513192730-b60cf427d1a8
8+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250514171116-a973d22fbfc5
99
github.com/stretchr/testify v1.10.0
10-
github.com/test-go/testify v1.1.4
1110
go.opentelemetry.io/otel v1.35.0
1211
go.opentelemetry.io/otel/metric v1.35.0
1312
go.opentelemetry.io/otel/trace v1.35.0

capabilities/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 h1:WCcC4vZDS1tYNxjWlwRJZQy28r8CM
8989
github.com/santhosh-tekuri/jsonschema/v5 v5.2.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0=
9090
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
9191
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
92-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250513192730-b60cf427d1a8 h1:G0sYOBW53MyO/dV56uxYHoGNU9ahiRwBW9V8dFysfs8=
93-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250513192730-b60cf427d1a8/go.mod h1:uNF6+noody47ZdmRwymDZAnQ7eKTXLzMKvl41LA63lo=
92+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250514171116-a973d22fbfc5 h1:jEtDzyFZdTUyoSVEee3EC/8Y+jq1aj6E8mIKsH2wt80=
93+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250514171116-a973d22fbfc5/go.mod h1:uNF6+noody47ZdmRwymDZAnQ7eKTXLzMKvl41LA63lo=
9494
github.com/smartcontractkit/freeport v0.1.0 h1:3MZHeti5m+tSTBCq5R8rhawFHxrnQZYBZVL+xgS1sPo=
9595
github.com/smartcontractkit/freeport v0.1.0/go.mod h1:T4zH9R8R8lVWKfU7tUvYz2o2jMv1OpGCdpY2j2QZXzU=
9696
github.com/smartcontractkit/libocr v0.0.0-20250328171017-609ec10a5510 h1:gm8Jli0sdkrZYnrWBngAkPSDzFDkdNCy1/Dj86kVtYk=
@@ -101,8 +101,6 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/
101101
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
102102
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
103103
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
104-
github.com/test-go/testify v1.1.4 h1:Tf9lntrKUMHiXQ07qBScBTSA0dhYQlu83hswqelv1iE=
105-
github.com/test-go/testify v1.1.4/go.mod h1:rH7cfJo/47vWGdi4GPj16x3/t1xGOj2YxzmNQzk2ghU=
106104
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
107105
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
108106
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=

capabilities/writetarget/messages.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//nolint:gosec // disable G115
1+
//nolint:gosec,errcheck // disable G115, errcheck
22
package writetarget
33

44
import (

capabilities/writetarget/write_target.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
var (
30-
_ capabilities.TargetCapability = &writeTarget{}
30+
_ capabilities.ExecutableCapability = &writeTarget{}
3131
)
3232

3333
type TransactionStatus uint8

capabilities/writetarget/write_target_monitor_test.go

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@ package writetarget_test
33
import (
44
"testing"
55

6+
"github.com/stretchr/testify/mock"
7+
"github.com/stretchr/testify/require"
8+
"go.uber.org/zap/zapcore"
9+
610
"github.com/smartcontractkit/chainlink-common/pkg/logger"
11+
"github.com/smartcontractkit/chainlink-common/pkg/utils/tests"
12+
713
"github.com/smartcontractkit/chainlink-framework/capabilities/writetarget"
814
monitor "github.com/smartcontractkit/chainlink-framework/capabilities/writetarget/beholder/monitor"
915
"github.com/smartcontractkit/chainlink-framework/capabilities/writetarget/mocks"
1016
wt "github.com/smartcontractkit/chainlink-framework/capabilities/writetarget/monitoring/pb/platform"
11-
"github.com/test-go/testify/mock"
12-
13-
"github.com/stretchr/testify/require"
1417
)
1518

1619
func TestWriteTargetMonitor(t *testing.T) {
1720
processor := mocks.NewProductSpecificProcessor(t)
21+
lggr, observed := logger.TestObserved(t, zapcore.DebugLevel)
1822

19-
monitor, err := writetarget.NewMonitor(logger.Test(t), []monitor.ProtoProcessor{}, []writetarget.ProductSpecificProcessor{processor}, writetarget.NewMonitorEmitter(logger.Test(t)))
23+
monitor, err := writetarget.NewMonitor(lggr, []monitor.ProtoProcessor{}, []writetarget.ProductSpecificProcessor{processor}, writetarget.NewMonitorEmitter(lggr))
2024
require.NoError(t, err)
2125

2226
encoded := []byte{}
@@ -30,13 +34,16 @@ func TestWriteTargetMonitor(t *testing.T) {
3034
t.Run("Uses processor when name equals config", func(t *testing.T) {
3135
processor.On("Name").Return("test").Once()
3236
processor.On("Process", t.Context(), msg, mock.Anything).Return(nil).Once()
33-
monitor.ProtoEmitter.EmitWithLog(t.Context(), msg)
37+
err := monitor.ProtoEmitter.EmitWithLog(t.Context(), msg)
38+
require.NoError(t, err)
3439
})
3540

36-
t.Run("Errors when config name is not found", func(t *testing.T) {
41+
t.Run("Logs when config name is not found", func(t *testing.T) {
3742
processor.On("Name").Return("other")
3843
err := monitor.ProtoEmitter.EmitWithLog(t.Context(), msg)
39-
require.Error(t, err)
44+
require.NoError(t, err)
45+
46+
tests.RequireLogMessage(t, observed, "no matching processor for MetaCapabilityProcessor=test")
4047
})
4148

4249
t.Run("Does not use processor when none is configured", func(t *testing.T) {
@@ -47,5 +54,7 @@ func TestWriteTargetMonitor(t *testing.T) {
4754

4855
err := monitor.ProtoEmitter.EmitWithLog(t.Context(), msg)
4956
require.NoError(t, err)
57+
58+
tests.RequireLogMessage(t, observed, "No product specific processor specified; skipping.")
5059
})
5160
}

0 commit comments

Comments
 (0)