Skip to content

Commit

Permalink
resolve more conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
b-gopalswami committed Oct 23, 2024
1 parent 7713254 commit 91c1335
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 281 deletions.
26 changes: 0 additions & 26 deletions integration-tests/ccip-tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,17 @@
## To Override the default config:
<<<<<<< HEAD
# example usage: make set_config override_toml=../config/config.toml
=======
# example usage: make set_config override_toml=../config/config.toml network_config_toml=../config/network.toml
>>>>>>> v2.17.0
.PHONY: set_config
set_config:
if [ -s "$(override_toml)" ]; then \
echo "Overriding config with $(override_toml)"; \
<<<<<<< HEAD
echo "export BASE64_CCIP_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" > ./testconfig/override/.env; \
echo "export TEST_BASE64_CCIP_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" >> ./testconfig/override/.env; \
echo "BASE64_CCIP_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" > ./testconfig/override/debug.env; \
echo "TEST_BASE64_CCIP_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" >> ./testconfig/override/debug.env; \
=======
echo "export BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" > ./testconfig/override/.env; \
echo "export TEST_BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" >> ./testconfig/override/.env; \
echo "BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" > ./testconfig/override/debug.env; \
echo "TEST_BASE64_CONFIG_OVERRIDE=$$(base64 -i $(override_toml))" >> ./testconfig/override/debug.env; \
>>>>>>> v2.17.0
else \
echo "No override config found, using default config"; \
echo > ./testconfig/override/.env; \
fi
<<<<<<< HEAD
=======
if [ -s "$(network_config_toml)" ]; then \
echo "Overriding network config with $(network_config_toml)"; \
echo "export BASE64_NETWORK_CONFIG=$$(base64 -i $(network_config_toml))" >> ./testconfig/override/.env; \
fi
>>>>>>> v2.17.0

@echo "Checking for test secrets file in ~/.testsecrets...";
@if [ ! -f ~/.testsecrets ]; then \
Expand Down Expand Up @@ -70,13 +52,8 @@ test_smoke_ccip: set_config
test_smoke_ccip_default: set_config
source ./testconfig/override/.env && \
DATABASE_URL=postgresql://postgres:node@localhost:5432/chainlink_test?sslmode=disable \
<<<<<<< HEAD
BASE64_CCIP_CONFIG_OVERRIDE="" \
TEST_BASE64_CCIP_CONFIG_OVERRIDE="" \
=======
BASE64_CONFIG_OVERRIDE="" \
TEST_BASE64_CONFIG_OVERRIDE="" \
>>>>>>> v2.17.0
ENV_JOB_IMAGE="" \
TEST_SUITE=smoke \
TEST_ARGS="-test.timeout 900h" \
Expand All @@ -90,13 +67,10 @@ test_smoke_ccip_default: set_config
.PHONY: build_ccip_image
build_ccip_image:
docker build -f ../../core/chainlink.Dockerfile --build-arg COMMIT_SHA=$(git rev-parse HEAD) --build-arg CHAINLINK_USER=chainlink -t $(image):$(tag) ../../
<<<<<<< HEAD

# image: the name for the chainlink image being built, example: image=chainlink
# tag: the tag for the chainlink image being built, example: tag=latest
# example usage: make build_ccip_image image=chainlink-ccip tag=latest
.PHONY: build_ccip_debug_image
build_ccip_debug_image:
docker build -f ../../core/chainlink.debug.Dockerfile --build-arg COMMIT_SHA=$(git rev-parse HEAD) --build-arg CHAINLINK_USER=chainlink -t $(image):$(tag) ../../
=======
>>>>>>> v2.17.0
12 changes: 0 additions & 12 deletions integration-tests/ccip-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ CCIP tests are designed to be highly configurable. Instead of writing many tests

1. Default test input - set via TOML - If no specific input is set; the tests will run with default inputs mentioned in [default.toml](./testconfig/tomls/ccip-default.toml).
Please refer to the [testconfig README](../testconfig/README.md) for a more detailed look at how testconfig works.
<<<<<<< HEAD
2. If you want to run your test with a different config, you can override the default inputs. You can either write an [overrides.toml](../testconfig/README.md#configuration-and-overrides) file, or set the env var `BASE64_CCIP_CONFIG_OVERRIDE` containing the base64 encoded TOML file content with updated test input parameters.
=======
2. If you want to run your test with a different config, you can override the default inputs. You can either write an [overrides.toml](../testconfig/README.md#configuration-and-overrides) file, or set the env var `BASE64_CONFIG_OVERRIDE` containing the base64 encoded TOML file content with updated test input parameters.
>>>>>>> v2.17.0
For example, if you want to override the `Network` input in test and want to run your test on `avalanche testnet` and `arbitrum goerli` network, you need to:
1. Create a TOML file with the following content:

Expand All @@ -24,25 +20,17 @@ For example, if you want to override the `Network` input in test and want to run
```

2. Encode it using the `base64` command
<<<<<<< HEAD
3. Set the env var `BASE64_CCIP_CONFIG_OVERRIDE` with the encoded content.

```bash
export BASE64_CCIP_CONFIG_OVERRIDE=$(base64 -i <path-to-override-toml-file>)
=======
3. Set the env var `BASE64_CONFIG_OVERRIDE` with the encoded content.

```bash
export BASE64_CONFIG_OVERRIDE=$(base64 -i <path-to-override-toml-file>)
>>>>>>> v2.17.0
```

[mainnet.toml](./testconfig/override/mainnet.toml), [override.toml](./testconfig/examples/override.toml.example) are some of the sample override TOML files.

For example - In order to run the smoke test (TestSmokeCCIPForBidirectionalLane) on mainnet, run the test with following env var set:

```bash
<<<<<<< HEAD
export BASE64_CCIP_CONFIG_OVERRIDE=$(base64 -i ./testconfig/override/mainnet.toml)
```

Expand Down
34 changes: 0 additions & 34 deletions integration-tests/ccip-tests/load/ccip_loadgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,27 @@ import (
"testing"
"time"

<<<<<<< HEAD
=======
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

>>>>>>> v2.17.0
"github.com/AlekSi/pointer"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/rs/zerolog"
<<<<<<< HEAD
"github.com/stretchr/testify/require"
"go.uber.org/atomic"

chain_selectors "github.com/smartcontractkit/chain-selectors"

"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"
=======
chain_selectors "github.com/smartcontractkit/chain-selectors"
"github.com/stretchr/testify/require"
"go.uber.org/atomic"

>>>>>>> v2.17.0
"github.com/smartcontractkit/chainlink-testing-framework/wasp"

"github.com/smartcontractkit/chainlink-common/pkg/config"

<<<<<<< HEAD
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers"
=======
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig"
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/utils"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ccip/testhelpers"

"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters"
>>>>>>> v2.17.0
)

// CCIPLaneOptimized is a light-weight version of CCIPLane, It only contains elements which are used during load triggering and validation
Expand Down Expand Up @@ -220,10 +197,7 @@ func (c *CCIPE2ELoad) CCIPMsg() (router.ClientEVM2AnyMessage, *testreporters.Req
extraArgs []byte
err error
)
<<<<<<< HEAD
// v1.5.0 and later starts using V2 extra args
=======
>>>>>>> v2.17.0
matchErr := contracts.MatchContractVersionsOrAbove(map[contracts.Name]contracts.Version{
contracts.OnRampContract: contracts.V1_5_0,
})
Expand Down Expand Up @@ -251,27 +225,19 @@ func (c *CCIPE2ELoad) Call(_ *wasp.Generator) *wasp.Response {
res := &wasp.Response{}
sourceCCIP := c.Lane.Source
var recentRequestFoundAt *time.Time
<<<<<<< HEAD
var latestEvent *types.Log
=======
>>>>>>> v2.17.0
var err error
// Use IsPastRequestTriggeredWithinTimeframe to check for any historical CCIP send request events
// within the specified timeframe for the first message. Subsequently, use the watcher method to monitor
// and detect any new events as they occur.
if c.CurrentMsgSerialNo.Load() == int64(1) {
<<<<<<< HEAD
latestEvent, err = sourceCCIP.IsPastRequestTriggeredWithinTimeframe(testcontext.Get(c.t), c.SkipRequestIfAnotherRequestTriggeredWithin)
require.NoError(c.t, err, "error while filtering past requests")
if latestEvent != nil {
hdr, err := sourceCCIP.Common.ChainClient.HeaderByNumber(context.Background(), big.NewInt(int64(latestEvent.BlockNumber)))
require.NoError(c.t, err, "error while getting header by block number")
recentRequestFoundAt = pointer.ToTime(hdr.Timestamp)
}
=======
recentRequestFoundAt, err = sourceCCIP.IsPastRequestTriggeredWithinTimeframe(testcontext.Get(c.t), c.SkipRequestIfAnotherRequestTriggeredWithin)
require.NoError(c.t, err, "error while filtering past requests")
>>>>>>> v2.17.0
} else {
recentRequestFoundAt = sourceCCIP.IsRequestTriggeredWithinTimeframe(c.SkipRequestIfAnotherRequestTriggeredWithin)
}
Expand Down
4 changes: 0 additions & 4 deletions integration-tests/ccip-tests/load/ccip_multicall_loadgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ func NewMultiCallLoadGenerator(testCfg *testsetups.CCIPTestConfig, lanes []*acti
testCfg.Test, lane, testCfg.TestGroupInput.PhaseTimeout.Duration(),
100000,
testCfg.TestGroupInput.LoadProfile.MsgProfile, 0,
<<<<<<< HEAD
testCfg.TestGroupInput.SkipRequestIfAnotherRequestTriggeredWithin,
=======
testCfg.TestGroupInput.LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin,
>>>>>>> v2.17.0
)
ccipLoad.BeforeAllCall()
m.E2ELoads[fmt.Sprintf("%s-%s", lane.SourceNetworkName, lane.DestNetworkName)] = ccipLoad
Expand Down
13 changes: 0 additions & 13 deletions integration-tests/ccip-tests/load/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ func (l *LoadArgs) scheduleForDest(destNetworkName string) []*wasp.Segment {
// if found, use that frequency for the destination network
// otherwise, use the default frequency
if l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination != nil {
<<<<<<< HEAD
l.lggr.Debug().
Interface("FrequencyByDestination", l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination).
Msg("LoadProfile provided")
Expand All @@ -122,10 +121,6 @@ func (l *LoadArgs) scheduleForDest(destNetworkName string) []*wasp.Segment {
l.lggr.Info().Str("Destination", destNetworkName).
Ints64("RequestPerUnitTime", freq.RequestPerUnitTime).
Msg("Using frequency for destination")
=======
for networkName, freq := range l.TestCfg.TestGroupInput.LoadProfile.FrequencyByDestination {
if strings.Contains(destNetworkName, networkName) {
>>>>>>> v2.17.0
return WaspSchedule(
freq.RequestPerUnitTime,
l.TestCfg.TestGroupInput.LoadProfile.TestDuration,
Expand Down Expand Up @@ -281,11 +276,7 @@ func (l *LoadArgs) TriggerLoadByLane() {
ccipLoad := NewCCIPLoad(
l.TestCfg.Test, lane, l.TestCfg.TestGroupInput.PhaseTimeout.Duration(),
100000, l.TestCfg.TestGroupInput.LoadProfile.MsgProfile, sendMaxData,
<<<<<<< HEAD
l.TestCfg.TestGroupInput.SkipRequestIfAnotherRequestTriggeredWithin,
=======
l.TestCfg.TestGroupInput.LoadProfile.SkipRequestIfAnotherRequestTriggeredWithin,
>>>>>>> v2.17.0
)
ccipLoad.BeforeAllCall()
// if it's not multicall set the tokens to nil to free up some space,
Expand Down Expand Up @@ -321,11 +312,7 @@ func (l *LoadArgs) TriggerLoadByLane() {
}
waspCfg.LokiConfig.Timeout = time.Minute
loadRunner, err := wasp.NewGenerator(waspCfg)
<<<<<<< HEAD
require.NoError(l.TestCfg.Test, err, "initiating loadgen for lane %s --> %s",
=======
require.NoError(l.TestCfg.Test, err, "error while initiating loadgen for lane %s --> %s",
>>>>>>> v2.17.0
lane.SourceNetworkName, lane.DestNetworkName)
loadRunner.Run(false)
l.AddToRunnerGroup(loadRunner)
Expand Down
44 changes: 2 additions & 42 deletions integration-tests/ccip-tests/smoke/ccip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package smoke
import (
"fmt"
"math/big"
<<<<<<< HEAD
"strings"
"testing"
"time"
Expand All @@ -17,39 +16,18 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/osutil"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

=======
"testing"
"time"

"github.com/rs/zerolog"
"github.com/stretchr/testify/assert"

"github.com/AlekSi/pointer"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-testing-framework/lib/logging"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/ptr"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool"

"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/actions"
>>>>>>> v2.17.0
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/contracts"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testconfig"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testreporters"
"github.com/smartcontractkit/chainlink/integration-tests/ccip-tests/testsetups"
<<<<<<< HEAD

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/evm_2_evm_onramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/lock_release_token_pool"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/token_pool"
=======
>>>>>>> v2.17.0
)

type testDefinition struct {
Expand All @@ -61,10 +39,7 @@ func TestSmokeCCIPForBidirectionalLane(t *testing.T) {
t.Parallel()
log := logging.GetTestLogger(t)
TestCfg := testsetups.NewCCIPTestConfig(t, log, testconfig.Smoke)
<<<<<<< HEAD
=======
require.NotNil(t, TestCfg.TestGroupInput.MsgDetails.DestGasLimit)
>>>>>>> v2.17.0
gasLimit := big.NewInt(*TestCfg.TestGroupInput.MsgDetails.DestGasLimit)
setUpOutput := testsetups.CCIPDefaultTestSetUp(t, &log, "smoke-ccip", nil, TestCfg)
if len(setUpOutput.Lanes) == 0 {
Expand Down Expand Up @@ -273,14 +248,10 @@ func TestSmokeCCIPRateLimit(t *testing.T) {
tc.lane.Source.Common.ChainClient.GetDefaultWallet(), src.Common.Router.Address(), src.TransferAmount[0]),
)
require.NoError(t, tc.lane.Source.Common.ChainClient.WaitForEvents())
<<<<<<< HEAD
failedTx, _, _, err := tc.lane.Source.SendRequest(
tc.lane.Dest.ReceiverDapp.EthAddress,
big.NewInt(actions.DefaultDestinationGasLimit),
)
=======
failedTx, _, _, err := tc.lane.Source.SendRequest(tc.lane.Dest.ReceiverDapp.EthAddress, big.NewInt(actions.DefaultDestinationGasLimit))
>>>>>>> v2.17.0
require.NoError(t, err)
require.Error(t, tc.lane.Source.Common.ChainClient.WaitForEvents())
errReason, v, err := tc.lane.Source.Common.ChainClient.RevertReasonFromTx(failedTx, evm_2_evm_onramp.EVM2EVMOnRampABI)
Expand Down Expand Up @@ -941,7 +912,6 @@ func TestSmokeCCIPReorgAboveFinalityAtSource(t *testing.T) {
})
}

<<<<<<< HEAD
// TestSmokeCCIPForGivenNetworkPairs is designed specifically for scheduled mainnet testing. This test checks for recent
// transaction and skip the lanes accordingly. This test also has capability to take override input on network pairs and phase timeout.
func TestSmokeCCIPForGivenNetworkPairs(t *testing.T) {
Expand Down Expand Up @@ -1059,8 +1029,6 @@ func TestSmokeCCIPForGivenNetworkPairs(t *testing.T) {
}
}

=======
>>>>>>> v2.17.0
// performAboveFinalityReorgAndValidate is to perform the above finality reorg test
func performAboveFinalityReorgAndValidate(t *testing.T, network string) {
t.Helper()
Expand Down Expand Up @@ -1103,21 +1071,13 @@ func performAboveFinalityReorgAndValidate(t *testing.T, network string) {
require.NoError(t, err)
for _, d := range resp.Data {
if d.Attributes.Name == logPollerName && d.Attributes.Output == "finality violated" && d.Attributes.Status == "failing" {
<<<<<<< HEAD
log.Debug().Str("Node", node.ChainlinkClient.URL()).Msg("Finality violated is detected by node")
=======
log.Debug().Msg("Finality violated is detected by node")
>>>>>>> v2.17.0
nodesDetectedViolation[node.ChainlinkClient.URL()] = true
}
}
}
return len(nodesDetectedViolation) == len(clNodes)
<<<<<<< HEAD
}, 5*time.Minute, 5*time.Second, "Reorg above finality depth is not detected by every node")
=======
}, 3*time.Minute, 20*time.Second, "Reorg above finality depth is not detected by every node")
>>>>>>> v2.17.0
log.Debug().Interface("Nodes", nodesDetectedViolation).Msg("Violation detection details")
// send another request and verify it fails
err = lane.SendRequests(1, gasLimit)
Expand Down
Loading

0 comments on commit 91c1335

Please sign in to comment.