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

[AUTO-9079] fix automation nightly and on-demand tests #12136

Merged
merged 10 commits into from
Feb 22, 2024
22 changes: 17 additions & 5 deletions .github/workflows/automation-nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,30 @@ jobs:
env:
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
TEST_LOG_LEVEL: info
SELECTED_NETWORKS: "SIMULATED"
strategy:
fail-fast: false
matrix:
tests:
- name: Upgrade
- name: Upgrade 2.0
suite: smoke
nodes: 6
nodes: 1
os: ubuntu20.04-8cores-32GB
network: SIMULATED
command: -run ^TestAutomationNodeUpgrade$ ./smoke
command: -run ^TestAutomationNodeUpgrade/registry_2_0 ./smoke
- name: Upgrade 2.1
suite: smoke
nodes: 5
os: ubuntu20.04-8cores-32GB
network: SIMULATED
command: -run ^TestAutomationNodeUpgrade/registry_2_1 ./smoke
- name: Upgrade 2.2
suite: smoke
nodes: 5
os: ubuntu20.04-8cores-32GB
network: SIMULATED
command: -run ^TestAutomationNodeUpgrade/registry_2_2 ./smoke
runs-on: ${{ matrix.tests.os }}
name: Automation ${{ matrix.tests.name }} Test
steps:
Expand Down Expand Up @@ -184,7 +196,7 @@ jobs:
strategy:
fail-fast: false
matrix:
name: [ Upgrade ]
name: [ Upgrade 2.0, Upgrade 2.1, Upgrade 2.2 ]
steps:
- name: Get Results
id: test-results
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/automation-ondemand-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,32 +121,46 @@ jobs:
env:
CHAINLINK_COMMIT_SHA: ${{ github.sha }}
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
TEST_LOG_LEVEL: info
strategy:
fail-fast: false
matrix:
tests:
- name: chaos
suite: chaos
nodes: 5
nodes: 15
os: ubuntu-latest
pyroscope_env: ci-automation-on-demand-chaos
network: SIMULATED
command: -run ^TestAutomationChaos$ ./chaos
- name: reorg
suite: reorg
nodes: 1
nodes: 5
os: ubuntu-latest
pyroscope_env: ci-automation-on-demand-reorg
network: SIMULATED_NONDEV
command: -run ^TestAutomationReorg$ ./reorg
- name: upgrade
- name: upgrade 2.0
suite: smoke
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-automation-on-demand-upgrade
network: SIMULATED
command: -run ^TestAutomationNodeUpgrade/registry_2_0 ./smoke
- name: upgrade 2.1
suite: smoke
nodes: 6
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-automation-on-demand-upgrade
network: SIMULATED
command: -run ^TestAutomationNodeUpgrade/registry_2_1 ./smoke
- name: upgrade 2.2
suite: smoke
nodes: 1
os: ubuntu20.04-8cores-32GB
pyroscope_env: ci-automation-on-demand-upgrade
network: SIMULATED
command: -run ^TestAutomationNodeUpgrade$ ./smoke
command: -run ^TestAutomationNodeUpgrade/registry_2_2 ./smoke
runs-on: ${{ matrix.tests.os }}
name: Automation On Demand ${{ matrix.tests.name }} Test
steps:
Expand Down
14 changes: 10 additions & 4 deletions integration-tests/chaos/automation_chaos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,17 +277,23 @@ func TestAutomationChaos(t *testing.T) {

actions.CreateOCRKeeperJobs(t, chainlinkNodes, registry.Address(), network.ChainID, 0, registryVersion)
nodesWithoutBootstrap := chainlinkNodes[1:]
defaultOCRRegistryConfig.RegistryVersion = registryVersion
ocrConfig, err := actions.BuildAutoOCR2ConfigVars(t, nodesWithoutBootstrap, defaultOCRRegistryConfig, registrar.Address(), 30*time.Second, registry.ChainModuleAddress(), registry.ReorgProtectionEnabled())
require.NoError(t, err, "Error building OCR config vars")
err = registry.SetConfig(defaultOCRRegistryConfig, ocrConfig)
require.NoError(t, err, "Registry config should be be set successfully")
require.NoError(t, chainClient.WaitForEvents(), "Waiting for config to be set")

consumers_conditional, upkeepIDs_conditional := actions.DeployConsumers(t, registry, registrar, linkToken, contractDeployer, chainClient, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, false, false)
consumers_logtrigger, upkeepIDs_logtrigger := actions.DeployConsumers(t, registry, registrar, linkToken, contractDeployer, chainClient, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, true, false)
consumersConditional, upkeepidsConditional := actions.DeployConsumers(t, registry, registrar, linkToken, contractDeployer, chainClient, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, false, false)
consumersLogtrigger, upkeepidsLogtrigger := actions.DeployConsumers(t, registry, registrar, linkToken, contractDeployer, chainClient, numberOfUpkeeps, big.NewInt(defaultLinkFunds), defaultUpkeepGasLimit, true, false)

consumers := append(consumers_conditional, consumers_logtrigger...)
upkeepIDs := append(upkeepIDs_conditional, upkeepIDs_logtrigger...)
consumers := append(consumersConditional, consumersLogtrigger...)
upkeepIDs := append(upkeepidsConditional, upkeepidsLogtrigger...)

for _, c := range consumersLogtrigger {
err = c.Start()
require.NoError(t, err, "Error starting consumer")
}

l.Info().Msg("Waiting for all upkeeps to be performed")

Expand Down
1 change: 1 addition & 0 deletions integration-tests/reorg/automation_reorg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ func TestAutomationReorg(t *testing.T) {

actions.CreateOCRKeeperJobs(t, chainlinkNodes, registry.Address(), network.ChainID, 0, registryVersion)
nodesWithoutBootstrap := chainlinkNodes[1:]
defaultOCRRegistryConfig.RegistryVersion = registryVersion
ocrConfig, err := actions.BuildAutoOCR2ConfigVars(t, nodesWithoutBootstrap, defaultOCRRegistryConfig, registrar.Address(), 5*time.Second, registry.ChainModuleAddress(), registry.ReorgProtectionEnabled())
require.NoError(t, err, "OCR2 config should be built successfully")
err = registry.SetConfig(defaultOCRRegistryConfig, ocrConfig)
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/smoke/automation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func SetupAutomationBasic(t *testing.T, nodeUpgrade bool, automationTestConfig t
expect := 5
// Upgrade the nodes one at a time and check that the upkeeps are still being performed
for i := 0; i < 5; i++ {
err = actions.UpgradeChainlinkNodeVersionsLocal(*cfg.GetChainlinkImageConfig().Image, *cfg.GetChainlinkImageConfig().Version, a.DockerEnv.ClCluster.Nodes[i])
err = actions.UpgradeChainlinkNodeVersionsLocal(*cfg.GetChainlinkUpgradeImageConfig().Image, *cfg.GetChainlinkUpgradeImageConfig().Version, a.DockerEnv.ClCluster.Nodes[i])
require.NoError(t, err, "Error when upgrading node %d", i)
time.Sleep(time.Second * 10)
expect = expect + 5
Expand Down
Loading