Skip to content

Commit

Permalink
Fixing rebase errors. Tested TestIntegration_MercuryV3 still runs loc…
Browse files Browse the repository at this point in the history
…ally
  • Loading branch information
patrickhuie19 committed Apr 24, 2024
1 parent 694eb3b commit 7179712
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions core/services/ocr2/plugins/mercury/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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),
}))
Expand All @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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),
}))
Expand All @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7179712

Please sign in to comment.