Skip to content

Commit 25cf4ca

Browse files
committed
tests
1 parent dea0240 commit 25cf4ca

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/smartcontractkit/chainlink-common
22

3-
go 1.23.3
3+
go 1.23.4
44

55
require (
66
github.com/XSAM/otelsql v0.29.0

pkg/workflows/wasm/host/wasm_test.go

+28-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func Test_Compute_Logs(t *testing.T) {
191191
Fetch: func(ctx context.Context, req *wasmpb.FetchRequest) (*wasmpb.FetchResponse, error) {
192192
return nil, nil
193193
},
194-
}, "", NewSingleBinaryWasmBinaryStore(binary))
194+
}, "wf1", NewSingleBinaryWasmBinaryStore(binary))
195195
require.NoError(t, err)
196196

197197
m.Start()
@@ -213,8 +213,21 @@ func Test_Compute_Logs(t *testing.T) {
213213
_, err = m.Run(ctx, req)
214214
assert.Nil(t, err)
215215

216-
require.Len(t, logs.AllUntimed(), 2)
216+
require.Len(t, logs.AllUntimed(), 4)
217217
expectedEntries := []Entry{
218+
{
219+
Log: zapcore.Entry{Level: zapcore.InfoLevel, Message: "loading module from binary"},
220+
Fields: []zapcore.Field{
221+
zap.String("workflowID", "wf1"),
222+
},
223+
},
224+
{
225+
Log: zapcore.Entry{Level: zapcore.InfoLevel, Message: "finished loading module from binary"},
226+
Fields: []zapcore.Field{
227+
zap.String("workflowID", "wf1"),
228+
},
229+
},
230+
218231
{
219232
Log: zapcore.Entry{Level: zapcore.InfoLevel, Message: "building workflow..."},
220233
Fields: []zapcore.Field{
@@ -550,9 +563,21 @@ func Test_Compute_Fetch(t *testing.T) {
550563
_, err = m.Run(ctx, req)
551564
assert.NotNil(t, err)
552565
assert.ErrorContains(t, err, assert.AnError.Error())
553-
require.Len(t, logs.AllUntimed(), 1)
566+
require.Len(t, logs.AllUntimed(), 3)
554567

555568
expectedEntries := []Entry{
569+
{
570+
Log: zapcore.Entry{Level: zapcore.InfoLevel, Message: "loading module from binary"},
571+
Fields: []zapcore.Field{
572+
zap.String("workflowID", "wf1"),
573+
},
574+
},
575+
{
576+
Log: zapcore.Entry{Level: zapcore.InfoLevel, Message: "finished loading module from binary"},
577+
Fields: []zapcore.Field{
578+
zap.String("workflowID", "wf1"),
579+
},
580+
},
556581
{
557582
Log: zapcore.Entry{Level: zapcore.ErrorLevel, Message: fmt.Sprintf("error calling fetch: %s", assert.AnError)},
558583
},

0 commit comments

Comments
 (0)