Skip to content

Commit

Permalink
[AUTO-9079] fix automation nightly and on-demand tests (#12136)
Browse files Browse the repository at this point in the history
* fix automation nightly tests

* fix automation on-demand tests

* fix automation on-demand tests

* fix automation nightly upgrade tests

* fix automation nightly upgrade tests

* fix automation nightly upgrade tests

* fix chaos, reorg tests

* fix ondemand action

* fix nightly action

* fix nightly action
  • Loading branch information
anirudhwarrier authored Feb 22, 2024
1 parent 2b99f07 commit 0b0d40f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 16 deletions.
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

0 comments on commit 0b0d40f

Please sign in to comment.