Skip to content

Commit

Permalink
Fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
george-dorin committed Nov 15, 2023
1 parent 392ca44 commit d52b172
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion integration-tests/actions/ocr2_helpers_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func DeleteBridges(nodes []*client.ChainlinkClient) error {
return fmt.Errorf("found a nil chainlink node in the list of chainlink nodes while tearing down: %v", nodes)
}

bridges, _, err := node.GetBridges()
bridges, _, err := node.ReadBridges()
if err != nil {
return err
}
Expand Down
6 changes: 2 additions & 4 deletions integration-tests/client/chainlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ func (c *ChainlinkClient) ReadBridge(name string) (*BridgeType, *http.Response,
}

// ReadBridges reads bridges from the Chainlink node
func (c *ChainlinkClient) ReadBridges() (*ResponseSlice, *resty.Response, error) {
result := &ResponseSlice{}
func (c *ChainlinkClient) ReadBridges() (*Bridges, *resty.Response, error) {
result := &Bridges{}
c.l.Info().Str(NodeURL, c.Config.URL).Msg("Getting all bridges")
resp, err := c.APIClient.R().
SetResult(&result).
Expand Down Expand Up @@ -1247,8 +1247,6 @@ func (c *ChainlinkClient) GetForwarders() (*Forwarders, *http.Response, error) {
return response, resp.RawResponse, err
}



// Replays log poller from block number
func (c *ChainlinkClient) ReplayLogPollerFromBlock(fromBlock, evmChainID int64) (*ReplayResponse, *http.Response, error) {
specObj := &ReplayResponse{}
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/smoke/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ func TestKeeperJobReplacement(t *testing.T) {
gom.Eventually(func(g gomega.Gomega) error {
// Check if the upkeeps are performing multiple times by analyzing their counters and checking they are greater than 10
for i := 0; i < len(upkeepIDs); i++ {
counter, err := consumers[i].Counter(context.Background())
counter, err := consumers[i].Counter(utils.TestContext(t))
g.Expect(err).ShouldNot(gomega.HaveOccurred(), "Failed to retrieve consumer counter for upkeep at index %d", i)
g.Expect(counter.Int64()).Should(gomega.BeNumerically(">", int64(10)),
"Expected consumer counter to be greater than 10, but got %d", counter.Int64())
Expand Down Expand Up @@ -1183,7 +1183,7 @@ func TestKeeperJobReplacement(t *testing.T) {
gom.Eventually(func(g gomega.Gomega) error {
// Check if the upkeeps are performing multiple times by analyzing their counters and checking they are greater than 10
for i := 0; i < len(upkeepIDs); i++ {
counter, err := consumers[i].Counter(context.Background())
counter, err := consumers[i].Counter(utils.TestContext(t))
g.Expect(err).ShouldNot(gomega.HaveOccurred(), "Failed to retrieve consumer counter for upkeep at index %d", i)
g.Expect(counter.Int64()).Should(gomega.BeNumerically(">", int64(10)),
"Expected consumer counter to be greater than 10, but got %d", counter.Int64())
Expand Down
23 changes: 17 additions & 6 deletions integration-tests/smoke/ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ import (
"fmt"
"math/big"
"net/http"
"strings"
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-testing-framework/blockchain"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/environment"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/ethereum"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mockserver"
mockservercfg "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mockserver-cfg"
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/networks"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/config"

"github.com/smartcontractkit/chainlink/integration-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/contracts"
Expand Down Expand Up @@ -110,6 +120,7 @@ func TestOCRv2JobReplacement(t *testing.T) {
WithStandardCleanup().
Build()
require.NoError(t, err)

env.ParallelTransactions(true)

nodeClients := env.ClCluster.NodeAPIs()
Expand Down Expand Up @@ -144,9 +155,9 @@ func TestOCRv2JobReplacement(t *testing.T) {
err = actions.ConfigureOCRv2AggregatorContracts(env.EVMClient, ocrv2Config, aggregatorContracts)
require.NoError(t, err, "Error configuring OCRv2 aggregator contracts")

err = actions.StartNewOCR2Round(1, aggregatorContracts, env.EVMClient, time.Minute*3, l)
err = actions.StartNewOCR2Round(1, aggregatorContracts, env.EVMClient, time.Minute*5, l)
require.NoError(t, err, "Error starting new OCR2 round")
roundData, err := aggregatorContracts[0].GetRound(context.Background(), big.NewInt(1))
roundData, err := aggregatorContracts[0].GetRound(utils.TestContext(t), big.NewInt(1))
require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail")
require.Equal(t, int64(5), roundData.Answer.Int64(),
"Expected latest answer from OCR contract to be 5 but got %d",
Expand All @@ -155,10 +166,10 @@ func TestOCRv2JobReplacement(t *testing.T) {

err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 10)
require.NoError(t, err)
err = actions.StartNewOCR2Round(2, aggregatorContracts, env.EVMClient, time.Minute*3, l)
err = actions.StartNewOCR2Round(2, aggregatorContracts, env.EVMClient, time.Minute*5, l)
require.NoError(t, err)

roundData, err = aggregatorContracts[0].GetRound(context.Background(), big.NewInt(2))
roundData, err = aggregatorContracts[0].GetRound(utils.TestContext(t), big.NewInt(2))
require.NoError(t, err, "Error getting latest OCR answer")
require.Equal(t, int64(10), roundData.Answer.Int64(),
"Expected latest answer from OCR contract to be 10 but got %d",
Expand All @@ -176,9 +187,9 @@ func TestOCRv2JobReplacement(t *testing.T) {

err = actions.StartNewOCR2Round(3, aggregatorContracts, env.EVMClient, time.Minute*3, l)
require.NoError(t, err, "Error starting new OCR2 round")
roundData, err = aggregatorContracts[0].GetRound(context.Background(), big.NewInt(1))
roundData, err = aggregatorContracts[0].GetRound(utils.TestContext(t), big.NewInt(3))
require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail")
require.Equal(t, int64(5), roundData.Answer.Int64(),
require.Equal(t, int64(15), roundData.Answer.Int64(),
"Expected latest answer from OCR contract to be 15 but got %d",
roundData.Answer.Int64(),
)
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/smoke/ocr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestOCRJobReplacement(t *testing.T) {
err = actions.StartNewRound(1, ocrInstances, env.EVMClient, l)
require.NoError(t, err)

answer, err := ocrInstances[0].GetLatestAnswer(context.Background())
answer, err := ocrInstances[0].GetLatestAnswer(utils.TestContext(t))
require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail")
require.Equal(t, int64(5), answer.Int64(), "Expected latest answer from OCR contract to be 5 but got %d", answer.Int64())

Expand All @@ -101,7 +101,7 @@ func TestOCRJobReplacement(t *testing.T) {
err = actions.StartNewRound(2, ocrInstances, env.EVMClient, l)
require.NoError(t, err)

answer, err = ocrInstances[0].GetLatestAnswer(context.Background())
answer, err = ocrInstances[0].GetLatestAnswer(utils.TestContext(t))
require.NoError(t, err, "Error getting latest OCR answer")
require.Equal(t, int64(10), answer.Int64(), "Expected latest answer from OCR contract to be 10 but got %d", answer.Int64())

Expand All @@ -118,7 +118,7 @@ func TestOCRJobReplacement(t *testing.T) {
err = actions.StartNewRound(1, ocrInstances, env.EVMClient, l)
require.NoError(t, err)

answer, err = ocrInstances[0].GetLatestAnswer(context.Background())
answer, err = ocrInstances[0].GetLatestAnswer(utils.TestContext(t))
require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail")
require.Equal(t, int64(10), answer.Int64(), "Expected latest answer from OCR contract to be 10 but got %d", answer.Int64())

Expand Down
6 changes: 3 additions & 3 deletions integration-tests/smoke/vrf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestVRFJobReplacement(t *testing.T) {
encodedProvingKeys := make([][2]*big.Int, 0)
encodedProvingKeys = append(encodedProvingKeys, provingKey)

requestHash, err := contracts.Coordinator.HashOfKey(context.Background(), encodedProvingKeys[0])
requestHash, err := contracts.Coordinator.HashOfKey(utils.TestContext(t), encodedProvingKeys[0])
require.NoError(t, err, "Getting Hash of encoded proving keys shouldn't fail")
err = contracts.Consumer.RequestRandomness(requestHash, big.NewInt(1))
require.NoError(t, err, "Requesting randomness shouldn't fail")
Expand All @@ -181,7 +181,7 @@ func TestVRFJobReplacement(t *testing.T) {
jobRuns, err := env.ClCluster.Nodes[0].API.MustReadRunsByJob(job.Data.ID)
g.Expect(err).ShouldNot(gomega.HaveOccurred(), "Job execution shouldn't fail")

out, err := contracts.Consumer.RandomnessOutput(context.Background())
out, err := contracts.Consumer.RandomnessOutput(utils.TestContext(t))
g.Expect(err).ShouldNot(gomega.HaveOccurred(), "Getting the randomness output of the consumer shouldn't fail")
// Checks that the job has actually run
g.Expect(len(jobRuns.Data)).Should(gomega.BeNumerically(">=", 1),
Expand All @@ -208,7 +208,7 @@ func TestVRFJobReplacement(t *testing.T) {
jobRuns, err := env.ClCluster.Nodes[0].API.MustReadRunsByJob(job.Data.ID)
g.Expect(err).ShouldNot(gomega.HaveOccurred(), "Job execution shouldn't fail")

out, err := contracts.Consumer.RandomnessOutput(context.Background())
out, err := contracts.Consumer.RandomnessOutput(utils.TestContext(t))
g.Expect(err).ShouldNot(gomega.HaveOccurred(), "Getting the randomness output of the consumer shouldn't fail")
// Checks that the job has actually run
g.Expect(len(jobRuns.Data)).Should(gomega.BeNumerically(">=", 1),
Expand Down

0 comments on commit d52b172

Please sign in to comment.