Skip to content

Commit

Permalink
Enabled soak test for mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-momin committed Jan 24, 2025
1 parent 191573c commit 49a7c33
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
7 changes: 7 additions & 0 deletions integration-tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,15 @@ func New(testConfig *tc.TestConfig) *Common {
privateKeyString := fmt.Sprintf("[%s]", formatBuffer([]byte(privateKey)))
publicKey := privateKey.PublicKey().String()

if *testConfig.Common.Network == "mainnet" {
config = chainConfig.MainnetConfig()
}

if *testConfig.Common.Network == "devnet" {
config = chainConfig.DevnetConfig()
}

if *testConfig.Common.Network == "devnet" || *testConfig.Common.Network == "mainnet" {
privateKeyString = *testConfig.Common.PrivateKey

if len(*testConfig.Common.RPCURLs) > 0 {
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (m *OCRv2TestState) DeployCluster(contractsDir string) {
m.Common.ChainDetails.RPCURLExternal = m.Common.Env.URLs["sol"][0]
m.Common.ChainDetails.WSURLExternal = m.Common.Env.URLs["sol"][1]

if *m.Config.TestConfig.Common.Network == "devnet" {
if *m.Config.TestConfig.Common.Network == "devnet" || *m.Config.TestConfig.Common.Network == "mainnet"{
m.Common.ChainDetails.RPCUrls = *m.Config.TestConfig.Common.RPCURLs
m.Common.ChainDetails.RPCURLExternal = (*m.Config.TestConfig.Common.RPCURLs)[0]
m.Common.ChainDetails.WSURLExternal = (*m.Config.TestConfig.Common.WsURLs)[0]
Expand All @@ -137,7 +137,7 @@ func (m *OCRv2TestState) DeployCluster(contractsDir string) {
m.Common.ChainDetails.RPCURLExternal = sol.ExternalHTTPURL
m.Common.ChainDetails.WSURLExternal = sol.ExternalWsURL

if *m.Config.TestConfig.Common.Network == "devnet" {
if *m.Config.TestConfig.Common.Network == "devnet" || *m.Config.TestConfig.Common.Network == "mainnet" {
m.Common.ChainDetails.RPCUrls = *m.Config.TestConfig.Common.RPCURLs
m.Common.ChainDetails.RPCURLExternal = (*m.Config.TestConfig.Common.RPCURLs)[0]
m.Common.ChainDetails.WSURLExternal = (*m.Config.TestConfig.Common.WsURLs)[0]
Expand Down
10 changes: 10 additions & 0 deletions integration-tests/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ type ProgramAddresses struct {
Store string
}

func MainnetConfig() *Config {
return &Config{
ChainName: "solana",
ChainID: "mainnet",
// Will be overridden if set in toml
RPCUrls: []string{"https://api.mainnet-beta.solana.com"},
WSUrls: []string{"wss://api.mainnet-beta.solana.com"},
}
}

func DevnetConfig() *Config {
return &Config{
ChainName: "solana",
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/smoke/ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func startOCR2DataFeedsSmokeTest(t *testing.T, testname string, testenv map[stri
err = sg.InstallDependencies()
require.NoError(t, err, "Error installing gauntlet dependencies")

if *config.Common.Network == "devnet" {
if *config.Common.Network == "devnet" || *config.Common.Network == "mainnet" {
state.Common.ChainDetails.ProgramAddresses.OCR2 = *config.SolanaConfig.OCR2ProgramID
state.Common.ChainDetails.ProgramAddresses.AccessController = *config.SolanaConfig.AccessControllerProgramID
state.Common.ChainDetails.ProgramAddresses.Store = *config.SolanaConfig.StoreProgramID
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/soak/ocr2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestSolanaOCRV2Soak(t *testing.T) {
err = sg.InstallDependencies()
require.NoError(t, err, "Error installing gauntlet dependencies")

if *config.Common.Network == "devnet" {
if *config.Common.Network == "devnet" || *config.Common.Network == "mainnet" {
state.Common.ChainDetails.ProgramAddresses.OCR2 = *config.SolanaConfig.OCR2ProgramID
state.Common.ChainDetails.ProgramAddresses.AccessController = *config.SolanaConfig.AccessControllerProgramID
state.Common.ChainDetails.ProgramAddresses.Store = *config.SolanaConfig.StoreProgramID
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/testconfig/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ func (c *Common) Validate() error {
if c.DevnetImage == nil {
return fmt.Errorf("devnet_image must be set")
}
case "devnet":
case "devnet", "mainnet":
if c.PrivateKey == nil {
return fmt.Errorf("private_key must be set")
}
Expand All @@ -434,7 +434,7 @@ func (c *Common) Validate() error {
}

default:
return fmt.Errorf("network must be either 'localnet' or 'devnet'")
return fmt.Errorf("network must be either 'localnet', 'devnet', or 'mainnet'")
}

if c.InsideK8s == nil {
Expand Down

0 comments on commit 49a7c33

Please sign in to comment.