Skip to content

Commit aa0e82f

Browse files
committed
Switch to ChipTestSink
1 parent 0882d95 commit aa0e82f

File tree

4 files changed

+24
-33
lines changed

4 files changed

+24
-33
lines changed

core/scripts/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ require (
5656
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9
5757
github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0
5858
github.com/smartcontractkit/chainlink-testing-framework/framework v0.13.14-0.20260202230832-eb33f42188d1
59-
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.18
59+
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.19
6060
github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.5
6161
github.com/smartcontractkit/chainlink-testing-framework/seth v1.51.2
6262
github.com/smartcontractkit/chainlink/core/scripts/cre/environment/examples/workflows/v1/proof-of-reserve/cron-based v0.0.0-20251020210257-0a6ec41648b4

core/scripts/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,8 +1691,8 @@ github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260124000807-bff5e
16911691
github.com/smartcontractkit/chainlink-sui/deployment v0.0.0-20260124000807-bff5e296dfb7/go.mod h1:FbqbTFP9aBvE/2GDmfcFr/03HEWkzjP7OMmxdib26aY=
16921692
github.com/smartcontractkit/chainlink-testing-framework/framework v0.13.14-0.20260202230832-eb33f42188d1 h1:JijOMT/94w/mt2q69vBQodliDlVfe+jqeaSTQJP3uxo=
16931693
github.com/smartcontractkit/chainlink-testing-framework/framework v0.13.14-0.20260202230832-eb33f42188d1/go.mod h1:IQC7fXKDsFjD1vb0Jh83WWY4BCFhN1fkcn+z3oSuFIA=
1694-
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.18 h1:1ng+p/+85zcVLHB050PiWUAjOcxyd4KjwkUlJy34rgE=
1695-
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.18/go.mod h1:2+OrSz56pdgtY0Oc20nCS9LH/bEksFDBQjoR82De5PI=
1694+
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.19 h1:LFZkB/pc8SE+U13vsuCapnYqf1LPzeBsiWPUIQYiUkg=
1695+
github.com/smartcontractkit/chainlink-testing-framework/framework/components/dockercompose v0.1.19/go.mod h1:98jNYBOPuKWJw9a8x0LgQuudp5enrHhQQP5Hq0YwRB8=
16961696
github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake v0.10.0 h1:PWAMYu0WaAMBfbpxCpFJGRIDHmcgmYin6a+UQC0OdtY=
16971697
github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake v0.10.0/go.mod h1:YEQbZRHFojvlQKeuckG/70t0WkAqOBmArSbkacgHSbc=
16981698
github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.5 h1:jARz/SWbmWoGJJGVcAnWwGMb8JuHRTQQsM3m6ZwrAGk=

system-tests/tests/smoke/cre/v2_evm_capability_test.go

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,16 @@ func ExecuteEVMReadTest(t *testing.T, testEnv *ttypes.TestEnvironment) {
3939
const workflowFileLocation = "./evm/evmread/main.go"
4040
enabledChains := t_helpers.GetEVMEnabledChains(t, testEnv)
4141

42-
listenerCtx, messageChan, _ := t_helpers.StartBeholder(t, lggr, testEnv)
43-
go t_helpers.LogBeholderMessages(listenerCtx, lggr, messageChan)
42+
userLogsCh := makeSinkCh[*workflowevents.UserLogs]()
43+
baseMessageCh := makeSinkCh[*commonevents.BaseMessage]()
44+
45+
// `./logs` folder inside `smoke/cre` is uploaded as artifact in GH
46+
server := t_helpers.StartChipTestSink(t, t_helpers.GetLoggingPublishFn(lggr, userLogsCh, baseMessageCh, "./logs/evm_read_workflow_test.log"))
47+
t.Cleanup(func() {
48+
server.Shutdown(t.Context())
49+
close(userLogsCh)
50+
close(baseMessageCh)
51+
})
4452

4553
chainLock := sync.Mutex{}
4654
for _, bcOutput := range testEnv.CreEnvironment.Blockchains {
@@ -73,6 +81,17 @@ func ExecuteEVMReadTest(t *testing.T, testEnv *ttypes.TestEnvironment) {
7381
}
7482
}
7583

84+
func makeSinkCh[T any]() chan T {
85+
c := make(chan T, 1)
86+
go func() {
87+
for range c {
88+
89+
}
90+
}()
91+
92+
return c
93+
}
94+
7695
func configureEVMReadWorkflow(t *testing.T, lggr zerolog.Logger, chain *evm.Blockchain, testCase evm_config.TestCase, workflowName string) evm_config.Config {
7796
t.Helper()
7897

system-tests/tests/test-helpers/t_helpers.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -242,34 +242,6 @@ func AssertBeholderMessage(ctx context.Context, t *testing.T, expectedLog string
242242
return nil
243243
}
244244

245-
func LogBeholderMessages(ctx context.Context, testLogger zerolog.Logger, messageChan <-chan proto.Message) {
246-
for {
247-
select {
248-
case <-ctx.Done():
249-
return
250-
case msg := <-messageChan:
251-
// Process received messages
252-
switch typedMsg := msg.(type) {
253-
case *commonevents.BaseMessage:
254-
l := testLogger.Info()
255-
for labelKey, labelValue := range typedMsg.Labels {
256-
l = l.Str(labelKey, labelValue)
257-
}
258-
l.Msg("➡️ Beholder Msg: " + typedMsg.Msg)
259-
case *workflowevents.UserLogs:
260-
l := testLogger.Info().
261-
Str("execution_id", typedMsg.M.WorkflowExecutionID).
262-
Str("workflow_name", typedMsg.M.WorkflowName)
263-
for _, logLine := range typedMsg.LogLines {
264-
l.Msg("➡️ Beholder user msg: " + logLine.Message)
265-
}
266-
default:
267-
// ignore other message types
268-
}
269-
}
270-
}
271-
}
272-
273245
//////////////////////////////
274246
// CRYPTO HELPERS //
275247
//////////////////////////////

0 commit comments

Comments
 (0)