From 7179712091ab265b48c13bf1dc39acc8085111a5 Mon Sep 17 00:00:00 2001 From: patrickhuie19 Date: Wed, 24 Apr 2024 12:17:26 -0400 Subject: [PATCH] Fixing rebase errors. Tested TestIntegration_MercuryV3 still runs locally --- .../ocr2/plugins/mercury/integration_test.go | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index 75b8eb67dfd..bf1e649dbe2 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -143,6 +143,8 @@ func TestIntegration_MercuryV1(t *testing.T) { } func integration_MercuryV1(t *testing.T) { + ctx := testutils.Context(t) + var logObservers []*observer.ObservedLogs t.Cleanup(func() { detectPanicLogs(t, logObservers) @@ -224,7 +226,7 @@ func integration_MercuryV1(t *testing.T) { addBootstrapJob(t, bootstrapNode, chainID, verifierAddress, feed.name, feed.id) } - createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { + createBridge := func(ctx context.Context, name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { b, err := io.ReadAll(req.Body) require.NoError(t, err) @@ -247,7 +249,7 @@ func integration_MercuryV1(t *testing.T) { t.Cleanup(bridge.Close) u, _ := url.Parse(bridge.URL) bridgeName = fmt.Sprintf("bridge-%s-%d", name, i) - require.NoError(t, borm.CreateBridgeType(&bridges.BridgeType{ + require.NoError(t, borm.CreateBridgeType(ctx, &bridges.BridgeType{ Name: bridges.BridgeName(bridgeName), URL: models.WebURL(*u), })) @@ -258,9 +260,9 @@ func integration_MercuryV1(t *testing.T) { // Add OCR jobs - one per feed on each node for i, node := range nodes { for j, feed := range feeds { - bmBridge := createBridge(fmt.Sprintf("benchmarkprice-%d", j), i, feed.baseBenchmarkPrice, node.App.BridgeORM()) - askBridge := createBridge(fmt.Sprintf("ask-%d", j), i, feed.baseAsk, node.App.BridgeORM()) - bidBridge := createBridge(fmt.Sprintf("bid-%d", j), i, feed.baseBid, node.App.BridgeORM()) + bmBridge := createBridge(ctx, fmt.Sprintf("benchmarkprice-%d", j), i, feed.baseBenchmarkPrice, node.App.BridgeORM()) + askBridge := createBridge(ctx, fmt.Sprintf("ask-%d", j), i, feed.baseAsk, node.App.BridgeORM()) + bidBridge := createBridge(ctx, fmt.Sprintf("bid-%d", j), i, feed.baseBid, node.App.BridgeORM()) addV1MercuryJob( t, @@ -485,6 +487,8 @@ func TestIntegration_MercuryV2(t *testing.T) { } func integration_MercuryV2(t *testing.T) { + ctx := testutils.Context(t) + var logObservers []*observer.ObservedLogs t.Cleanup(func() { detectPanicLogs(t, logObservers) @@ -578,7 +582,7 @@ func integration_MercuryV2(t *testing.T) { addBootstrapJob(t, bootstrapNode, chainID, verifierAddress, feed.name, feed.id) } - createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { + createBridge := func(ctx context.Context, name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { b, err := io.ReadAll(req.Body) require.NoError(t, err) @@ -601,7 +605,7 @@ func integration_MercuryV2(t *testing.T) { t.Cleanup(bridge.Close) u, _ := url.Parse(bridge.URL) bridgeName = fmt.Sprintf("bridge-%s-%d", name, i) - require.NoError(t, borm.CreateBridgeType(&bridges.BridgeType{ + require.NoError(t, borm.CreateBridgeType(ctx, &bridges.BridgeType{ Name: bridges.BridgeName(bridgeName), URL: models.WebURL(*u), })) @@ -612,7 +616,7 @@ func integration_MercuryV2(t *testing.T) { // Add OCR jobs - one per feed on each node for i, node := range nodes { for j, feed := range feeds { - bmBridge := createBridge(fmt.Sprintf("benchmarkprice-%d", j), i, feed.baseBenchmarkPrice, node.App.BridgeORM()) + bmBridge := createBridge(ctx, fmt.Sprintf("benchmarkprice-%d", j), i, feed.baseBenchmarkPrice, node.App.BridgeORM()) addV2MercuryJob( t, @@ -894,7 +898,7 @@ func integration_MercuryV3(t *testing.T, tlsCertFile *string, tlsKeyFile *string addBootstrapJob(t, bootstrapNode, chainID, verifierAddress, feed.name, feed.id) } - createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { + createBridge := func(ctx context.Context, name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { b, err := io.ReadAll(req.Body) require.NoError(t, err) @@ -928,9 +932,9 @@ func integration_MercuryV3(t *testing.T, tlsCertFile *string, tlsKeyFile *string // Add OCR jobs - one per feed on each node for i, node := range nodes { for j, feed := range feeds { - bmBridge := createBridge(fmt.Sprintf("benchmarkprice-%d", j), i, feed.baseBenchmarkPrice, node.App.BridgeORM()) - bidBridge := createBridge(fmt.Sprintf("bid-%d", j), i, feed.baseBid, node.App.BridgeORM()) - askBridge := createBridge(fmt.Sprintf("ask-%d", j), i, feed.baseAsk, node.App.BridgeORM()) + bmBridge := createBridge(ctx, fmt.Sprintf("benchmarkprice-%d", j), i, feed.baseBenchmarkPrice, node.App.BridgeORM()) + bidBridge := createBridge(ctx, fmt.Sprintf("bid-%d", j), i, feed.baseBid, node.App.BridgeORM()) + askBridge := createBridge(ctx, fmt.Sprintf("ask-%d", j), i, feed.baseAsk, node.App.BridgeORM()) addV3MercuryJob( t,