Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: e2e test dependencies #488

Merged
merged 4 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 8 additions & 38 deletions integration-tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/guregu/null.v4"

common_cfg "github.com/smartcontractkit/chainlink-common/pkg/config"
"github.com/smartcontractkit/chainlink-common/pkg/types"
ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/environment"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink"
mock_adapter "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mock-adapter"
"github.com/smartcontractkit/chainlink-testing-framework/utils/ptr"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"
"github.com/smartcontractkit/chainlink/integration-tests/types/config/node"
cl "github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
"github.com/smartcontractkit/chainlink/v2/core/services/job"

chainconfig "github.com/smartcontractkit/chainlink-starknet/integration-tests/config"
"github.com/smartcontractkit/chainlink-starknet/integration-tests/testconfig"
"github.com/smartcontractkit/chainlink-starknet/ops/devnet"
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/chainlink/config"
"github.com/smartcontractkit/chainlink-starknet/relayer/pkg/starknet"
)

Expand Down Expand Up @@ -96,6 +90,11 @@ func New(testConfig *testconfig.TestConfig) *Common {
RPCL2InternalAPIKey: chainDetails.L2RPCInternalAPIKey,
},
}
// provide getters for TestConfig (pointers to chain + rpc details)
c.TestConfig.GetChainID = func() string { return c.ChainDetails.ChainID }
c.TestConfig.GetFeederURL = func() string { return c.ChainDetails.FeederURL }
c.TestConfig.GetRPCL2Internal = func() string { return c.RPCDetails.RPCL2Internal }
c.TestConfig.GetRPCL2InternalAPIKey = func() string { return c.RPCDetails.RPCL2InternalAPIKey }

return c
}
Expand All @@ -108,8 +107,7 @@ func (c *Common) Default(t *testing.T, namespacePrefix string) (*Common, error)
}

if *c.TestConfig.Common.InsideK8s {
toml := c.DefaultNodeConfig()
tomlString, err := toml.TOMLString()
tomlString, err := c.TestConfig.GetNodeConfigTOML()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -147,34 +145,6 @@ func (c *Common) Default(t *testing.T, namespacePrefix string) (*Common, error)
return c, nil
}

func (c *Common) DefaultNodeConfig() *cl.Config {
starkConfig := config.TOMLConfig{
Enabled: ptr.Ptr(true),
ChainID: ptr.Ptr(c.ChainDetails.ChainID),
FeederURL: common_cfg.MustParseURL(c.ChainDetails.FeederURL),
Nodes: []*config.Node{
{
Name: ptr.Ptr("primary"),
URL: common_cfg.MustParseURL(c.RPCDetails.RPCL2Internal),
APIKey: ptr.Ptr(c.RPCDetails.RPCL2InternalAPIKey),
},
},
}
baseConfig := node.NewBaseConfig()
baseConfig.Starknet = config.TOMLConfigs{
&starkConfig,
}
baseConfig.OCR2.Enabled = ptr.Ptr(true)
baseConfig.P2P.V2.Enabled = ptr.Ptr(true)
fiveSecondDuration := common_cfg.MustNewDuration(5 * time.Second)

baseConfig.P2P.V2.DeltaDial = fiveSecondDuration
baseConfig.P2P.V2.DeltaReconcile = fiveSecondDuration
baseConfig.P2P.V2.ListenAddresses = &[]string{"0.0.0.0:6690"}

return baseConfig
}

func (c *Common) SetLocalEnvironment(t *testing.T) {
// Run scripts to set up local test environment
log.Info().Msg("Starting starknet-devnet container...")
Expand Down Expand Up @@ -274,7 +244,7 @@ func (c *Common) CreateJobsForContract(cc *ChainlinkClient, observationSource st

oracleSpec := job.OCR2OracleSpec{
ContractID: ocrControllerAddress,
Relay: types.NetworkStarkNet,
Relay: c.ChainDetails.ChainName,
RelayConfig: bootstrapRelayConfig,
ContractConfigConfirmations: 1, // don't wait for confirmation on devnet
}
Expand Down Expand Up @@ -317,7 +287,7 @@ func (c *Common) CreateJobsForContract(cc *ChainlinkClient, observationSource st

oracleSpec = job.OCR2OracleSpec{
ContractID: ocrControllerAddress,
Relay: types.NetworkStarkNet,
Relay: c.ChainDetails.ChainName,
RelayConfig: relayConfig,
PluginType: "median",
OCRKeyBundleID: null.StringFrom(cc.NKeys[nIdx].OCR2Key.Data.ID),
Expand Down
1 change: 0 additions & 1 deletion integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ func (m *OCRv2TestState) DeployCluster() {
WithTestInstance(m.TestConfig.T).
WithTestConfig(m.TestConfig.TestConfig).
WithMockAdapter().
WithCLNodeConfig(m.Common.DefaultNodeConfig()).
WithCLNodes(*m.Common.TestConfig.OCR2.NodeCount).
WithCLNodeOptions(m.Common.TestEnvDetails.NodeOpts...).
WithStandardCleanup().
Expand Down
96 changes: 46 additions & 50 deletions integration-tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ require (
github.com/NethermindEth/juno v0.3.1
github.com/NethermindEth/starknet.go v0.7.1-0.20240401080518-34a506f3cfdb
github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df
github.com/go-resty/resty/v2 v2.7.0
github.com/go-resty/resty/v2 v2.11.0
github.com/google/uuid v1.6.0
github.com/lib/pq v1.10.9
github.com/pelletier/go-toml/v2 v2.1.1
github.com/rs/zerolog v1.30.0
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240625074419-c278d083facf
github.com/pelletier/go-toml/v2 v2.2.2
github.com/rs/zerolog v1.31.0
github.com/smartcontractkit/chainlink-common v0.1.7-0.20240703234618-dc1fbe45acc0
github.com/smartcontractkit/chainlink-starknet/ops v0.0.0-20231205180940-ea2e3e916725
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240524210559-72df72854128
github.com/smartcontractkit/chainlink-testing-framework v1.28.8
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240506164029-09f8c7fcd63b
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240524220010-00d58a812b46
github.com/smartcontractkit/seth v0.1.6-0.20240429143720-cacb8160ecec
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20240625074951-06ab5e670dba
github.com/smartcontractkit/chainlink-testing-framework v1.31.7
github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20240708135824-bf9122a8cee6
github.com/smartcontractkit/chainlink/v2 v2.10.0-beta0.0.20240708135824-bf9122a8cee6
github.com/smartcontractkit/seth v1.0.12
github.com/stretchr/testify v1.9.0
github.com/testcontainers/testcontainers-go v0.28.0
go.uber.org/zap v1.26.0
golang.org/x/text v0.14.0
golang.org/x/text v0.16.0
gopkg.in/guregu/null.v4 v4.0.0
)

Expand All @@ -33,7 +33,7 @@ require (
cosmossdk.io/errors v1.0.0 // indirect
cosmossdk.io/math v1.1.2 // indirect
dario.cat/mergo v1.0.0 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 // indirect
Expand All @@ -46,8 +46,6 @@ require (
github.com/CosmWasm/wasmd v0.40.1 // indirect
github.com/CosmWasm/wasmvm v1.2.4 // indirect
github.com/DataDog/zstd v1.5.2 // indirect
github.com/K-Phoen/grabana v0.22.1 // indirect
github.com/K-Phoen/sdk v0.12.4 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
Expand Down Expand Up @@ -77,7 +75,7 @@ require (
github.com/c9s/goprocinfo v0.0.0-20210130143923-c95fcf8c64a8 // indirect
github.com/cdk8s-team/cdk8s-core-go/cdk8s/v2 v2.7.5 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chai2010/gettext-go v1.0.2 // indirect
Expand Down Expand Up @@ -186,7 +184,7 @@ require (
github.com/gogo/protobuf v1.3.3 // indirect
github.com/gogo/status v1.1.1 // indirect
github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
Expand All @@ -204,21 +202,20 @@ require (
github.com/gorilla/securecookie v1.1.2 // indirect
github.com/gorilla/sessions v1.2.2 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/gosimple/slug v1.13.1 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
github.com/grafana/dskit v0.0.0-20231120170505-765e343eda4f // indirect
github.com/grafana/gomemcache v0.0.0-20231023152154-6947259a0586 // indirect
github.com/grafana/grafana-foundation-sdk/go v0.0.0-20240326122733-6f96a993222b // indirect
github.com/grafana/loki v1.6.2-0.20231215164305-b51b7d7b5503 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20231201111602-11ef833ed3e4 // indirect
github.com/grafana/pyroscope-go v1.1.1 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
Expand Down Expand Up @@ -260,7 +257,7 @@ require (
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/jmoiron/sqlx v1.3.5 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/jonboulle/clockwork v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
Expand Down Expand Up @@ -340,7 +337,7 @@ require (
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
Expand All @@ -355,16 +352,16 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/slack-go/slack v0.12.2 // indirect
github.com/smartcontractkit/chain-selectors v1.0.10 // indirect
github.com/smartcontractkit/chainlink-automation v1.0.3 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240524214833-c362c2ebbd2d // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240220203239-09be0ea34540 // indirect
github.com/smartcontractkit/chainlink-automation v1.0.4 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20240621143432-85370a54b141 // indirect
github.com/smartcontractkit/chainlink-data-streams v0.0.0-20240702144807-761f63e7b527 // indirect
github.com/smartcontractkit/chainlink-feeds v0.0.0-20240522213638-159fb2d99917 // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240524201401-88d0b3763b20 // indirect
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868 // indirect
github.com/smartcontractkit/libocr v0.0.0-20240419185742-fd3cab206b2c // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20240708130426-294b81e4afe7 // indirect
github.com/smartcontractkit/chainlink-testing-framework/grafana v0.0.0-20240405215812-5a72bc9af239 // indirect
github.com/smartcontractkit/libocr v0.0.0-20240702141926-063ceef8c42e // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20230906073235-9e478e5e19f1 // indirect
github.com/smartcontractkit/wasp v0.4.5 // indirect
github.com/smartcontractkit/wasp v0.4.7 // indirect
github.com/smartcontractkit/wsrpc v0.8.1 // indirect
github.com/soheilhy/cmux v0.1.5 // indirect
github.com/sony/gobreaker v0.5.0 // indirect
Expand Down Expand Up @@ -414,40 +411,39 @@ require (
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector/pdata v1.0.0-rcv0016 // indirect
go.opentelemetry.io/collector/semconv v0.87.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.52.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.opentelemetry.io/otel v1.27.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.27.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
go.opentelemetry.io/otel/metric v1.27.0 // indirect
go.opentelemetry.io/otel/sdk v1.27.0 // indirect
go.opentelemetry.io/otel/trace v1.27.0 // indirect
go.opentelemetry.io/proto/otlp v1.2.0 // indirect
go.starlark.net v0.0.0-20220817180228-f738f5508c12 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/goleak v1.3.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/ratelimit v0.3.0 // indirect
go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.20.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/term v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.18.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
gonum.org/v1/gonum v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240520151616-dc85e6b867a5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240520151616-dc85e6b867a5 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
Expand Down
Loading
Loading