From 14165e09f2707a9f1a915c39ae2b4d0dc4bb2a4f Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:08:25 +0400 Subject: [PATCH 1/7] fix automation load test - pyroscope config --- .../automationv2_1/automationv2_1_test.go | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/integration-tests/load/automationv2_1/automationv2_1_test.go b/integration-tests/load/automationv2_1/automationv2_1_test.go index 49758477767..9b2aa05388a 100644 --- a/integration-tests/load/automationv2_1/automationv2_1_test.go +++ b/integration-tests/load/automationv2_1/automationv2_1_test.go @@ -5,6 +5,7 @@ import ( "fmt" "math" "math/big" + "os" "strconv" "strings" "testing" @@ -30,7 +31,7 @@ import ( "github.com/smartcontractkit/chainlink-testing-framework/logging" "github.com/smartcontractkit/chainlink-testing-framework/networks" - ctf_config "github.com/smartcontractkit/chainlink-testing-framework/config" + ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config" "github.com/smartcontractkit/chainlink/integration-tests/actions" "github.com/smartcontractkit/chainlink/integration-tests/actions/automationv2" @@ -38,7 +39,7 @@ import ( "github.com/smartcontractkit/chainlink/integration-tests/contracts" contractseth "github.com/smartcontractkit/chainlink/integration-tests/contracts/ethereum" tc "github.com/smartcontractkit/chainlink/integration-tests/testconfig" - a_config "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation" + aconfig "github.com/smartcontractkit/chainlink/integration-tests/testconfig/automation" "github.com/smartcontractkit/chainlink/integration-tests/testreporters" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/log_emitter" @@ -142,15 +143,15 @@ func TestLogTrigger(t *testing.T) { Msg("Test Config") testConfigFormat := `Number of Nodes: %d - Duration: %d - Block Time: %d - Spec Type: %s - Log Level: %s - Image: %s - Tag: %s +Duration: %d +Block Time: %d +Spec Type: %s +Log Level: %s +Image: %s +Tag: %s - Load Config: - %s` +Load Config: +%s` prettyLoadConfig, err := toml.Marshal(loadedTestConfig.Automation.Load) require.NoError(t, err, "Error marshalling load config") @@ -230,7 +231,11 @@ func TestLogTrigger(t *testing.T) { } if *loadedTestConfig.Pyroscope.Enabled { + serverUrl := os.Getenv("PYROSCOPE_SERVER") + serverKey := os.Getenv("PYROSCOPE_KEY") loadedTestConfig.Pyroscope.Environment = &testEnvironment.Cfg.Namespace + loadedTestConfig.Pyroscope.ServerUrl = &serverUrl + loadedTestConfig.Pyroscope.Key = &serverKey } numberOfUpkeeps := *loadedTestConfig.Automation.General.NumberOfNodes @@ -245,8 +250,8 @@ func TestLogTrigger(t *testing.T) { nodeTOML = networks.AddNetworksConfig(nodeTOML, loadedTestConfig.Pyroscope, testNetwork) var overrideFn = func(_ interface{}, target interface{}) { - ctf_config.MustConfigOverrideChainlinkVersion(loadedTestConfig.ChainlinkImage, target) - ctf_config.MightConfigOverridePyroscopeKey(loadedTestConfig.Pyroscope, target) + ctfconfig.MustConfigOverrideChainlinkVersion(loadedTestConfig.ChainlinkImage, target) + ctfconfig.MightConfigOverridePyroscopeKey(loadedTestConfig.Pyroscope, target) } cd := chainlink.NewWithOverride(i, map[string]any{ @@ -336,7 +341,7 @@ func TestLogTrigger(t *testing.T) { } upkeepConfigs := make([]automationv2.UpkeepConfig, 0) - loadConfigs := make([]a_config.Load, 0) + loadConfigs := make([]aconfig.Load, 0) cEVMClient, err := blockchain.ConcurrentEVMClient(testNetwork, testEnvironment, chainClient, l) require.NoError(t, err, "Error building concurrent chain client") @@ -351,7 +356,7 @@ func TestLogTrigger(t *testing.T) { Int("Out Of", *u.NumberOfUpkeeps). Msg("Deployed Automation Log Trigger Consumer Contract") - loadCfg := a_config.Load{ + loadCfg := aconfig.Load{ NumberOfEvents: u.NumberOfEvents, NumberOfSpamMatchingEvents: u.NumberOfSpamMatchingEvents, NumberOfSpamNonMatchingEvents: u.NumberOfSpamNonMatchingEvents, From a314ffe2910d70556e46d5c5bee5e2c162a270d9 Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 25 Jan 2024 13:15:19 +0400 Subject: [PATCH 2/7] TTL of test based on load duration --- integration-tests/load/automationv2_1/automationv2_1_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/load/automationv2_1/automationv2_1_test.go b/integration-tests/load/automationv2_1/automationv2_1_test.go index 9b2aa05388a..16223044f3e 100644 --- a/integration-tests/load/automationv2_1/automationv2_1_test.go +++ b/integration-tests/load/automationv2_1/automationv2_1_test.go @@ -182,7 +182,7 @@ Load Config: } testEnvironment := environment.New(&environment.Config{ - TTL: time.Hour * 24, // 1 day, + TTL: loadDuration + time.Hour*6, NamespacePrefix: fmt.Sprintf( "automation-%s-%s", testType, From a72d6598dfb3a1e36a591815b421469d986abd07 Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:14:42 +0400 Subject: [PATCH 3/7] fix automation load test - pyroscope config --- .github/workflows/automation-load-tests.yml | 28 +++++++++++++++++++ .../automationv2_1/automationv2_1_test.go | 5 ---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/automation-load-tests.yml b/.github/workflows/automation-load-tests.yml index 583314f438e..223f1f5947c 100644 --- a/.github/workflows/automation-load-tests.yml +++ b/.github/workflows/automation-load-tests.yml @@ -41,6 +41,34 @@ jobs: BASE64_CONFIG_OVERRIDE=$(jq -r '.inputs.base64Config' $GITHUB_EVENT_PATH) echo ::add-mask::$BASE64_CONFIG_OVERRIDE echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV + - name: Merge Pyrsoscope config + env: + PYROSCOPE_SERVER: ${{ secrets.QA_PYROSCOPE_INSTANCE }} + PYROSCOPE_ENVIRONMENT: "automation-load-test" + PYROSCOPE_KEY: ${{ secrets.QA_PYROSCOPE_KEY }} + run: | + decoded_toml=$(echo $BASE64_CONFIG_OVERRIDE | base64 -d) + + if [ -n "$PYROSCOPE_SERVER" ]; then + pyroscope_enabled=true + else + pyroscope_enabled=false + fi + + # use Pyroscope config from GH secrets and merge it with base64 input + cat << EOF > config.toml + [Pyroscope] + enabled=$pyroscope_enabled + server_url="$PYROSCOPE_SERVER" + environment="$PYROSCOPE_ENVIRONMENT" + key="$PYROSCOPE_KEY" + EOF + + echo "$decoded_toml" >> final_config.toml + cat config.toml >> final_config.toml + BASE64_CONFIG_OVERRIDE=$(cat final_config.toml | base64 -w 0) + echo ::add-mask::$BASE64_CONFIG_OVERRIDE + echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV - name: Parse base64 config uses: ./.github/actions/setup-parse-base64-config with: diff --git a/integration-tests/load/automationv2_1/automationv2_1_test.go b/integration-tests/load/automationv2_1/automationv2_1_test.go index 16223044f3e..ffce754c9de 100644 --- a/integration-tests/load/automationv2_1/automationv2_1_test.go +++ b/integration-tests/load/automationv2_1/automationv2_1_test.go @@ -5,7 +5,6 @@ import ( "fmt" "math" "math/big" - "os" "strconv" "strings" "testing" @@ -231,11 +230,7 @@ Load Config: } if *loadedTestConfig.Pyroscope.Enabled { - serverUrl := os.Getenv("PYROSCOPE_SERVER") - serverKey := os.Getenv("PYROSCOPE_KEY") loadedTestConfig.Pyroscope.Environment = &testEnvironment.Cfg.Namespace - loadedTestConfig.Pyroscope.ServerUrl = &serverUrl - loadedTestConfig.Pyroscope.Key = &serverKey } numberOfUpkeeps := *loadedTestConfig.Automation.General.NumberOfNodes From 6ef31f3e695bd7c55ce3a9725166fdeb6abd9edf Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:40:36 +0400 Subject: [PATCH 4/7] remove duplicate config --- .github/workflows/automation-load-tests.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/automation-load-tests.yml b/.github/workflows/automation-load-tests.yml index 223f1f5947c..8045b589edc 100644 --- a/.github/workflows/automation-load-tests.yml +++ b/.github/workflows/automation-load-tests.yml @@ -49,16 +49,8 @@ jobs: run: | decoded_toml=$(echo $BASE64_CONFIG_OVERRIDE | base64 -d) - if [ -n "$PYROSCOPE_SERVER" ]; then - pyroscope_enabled=true - else - pyroscope_enabled=false - fi - # use Pyroscope config from GH secrets and merge it with base64 input cat << EOF > config.toml - [Pyroscope] - enabled=$pyroscope_enabled server_url="$PYROSCOPE_SERVER" environment="$PYROSCOPE_ENVIRONMENT" key="$PYROSCOPE_KEY" From f2f6cae248c1cc1976021bd9a70a26bd4e336a33 Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 25 Jan 2024 15:54:21 +0400 Subject: [PATCH 5/7] remove whitespace --- .../action.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/actions/{setup-create-base64-upgrade-config => setup-create-base64-upgrade-config}/action.yml (100%) diff --git a/.github/actions/setup-create-base64-upgrade-config /action.yml b/.github/actions/setup-create-base64-upgrade-config/action.yml similarity index 100% rename from .github/actions/setup-create-base64-upgrade-config /action.yml rename to .github/actions/setup-create-base64-upgrade-config/action.yml From 83b2945d7a0b37b3395e128dda9a23212d17b880 Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:03:32 +0400 Subject: [PATCH 6/7] fix nightly test action --- .github/workflows/automation-nightly-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automation-nightly-tests.yml b/.github/workflows/automation-nightly-tests.yml index 9d45ec99e74..81e6af7608f 100644 --- a/.github/workflows/automation-nightly-tests.yml +++ b/.github/workflows/automation-nightly-tests.yml @@ -77,8 +77,8 @@ jobs: selectedNetworks: ${{ env.SELECTED_NETWORKS }} chainlinkImage: "public.ecr.aws/chainlink/chainlink" chainlinkVersion: "latest" - upgradeImage: ${{ env.UPGRADE_IMAGE }} - upgradeVersion: ${{ env.UPGRADE_VERSION }} + upgradeImage: ${{ env.CHAINLINK_IMAGE }} + upgradeVersion: ${{ github.sha }} - name: Run Tests uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@e865e376b8c2d594028c8d645dd6c47169b72974 # v2.2.16 env: From 9d38cf22200bb49865950b1d4646a88d07b19723 Mon Sep 17 00:00:00 2001 From: anirudhwarrier <12178754+anirudhwarrier@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:11:02 +0400 Subject: [PATCH 7/7] fix nightly test action --- .github/workflows/automation-nightly-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/automation-nightly-tests.yml b/.github/workflows/automation-nightly-tests.yml index 81e6af7608f..9f4e4353e2d 100644 --- a/.github/workflows/automation-nightly-tests.yml +++ b/.github/workflows/automation-nightly-tests.yml @@ -54,6 +54,7 @@ jobs: CHAINLINK_COMMIT_SHA: ${{ github.sha }} CHAINLINK_ENV_USER: ${{ github.actor }} TEST_LOG_LEVEL: debug + SELECTED_NETWORKS: "SIMULATED" strategy: fail-fast: false matrix: