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 automation tests #11815

Merged
merged 7 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
7 changes: 7 additions & 0 deletions .github/workflows/automation-benchmark-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Automation Benchmark Test
on:
workflow_dispatch:
inputs:
testType:
description: Type of test to run (benchmark, soak)
required: true
default: benchmark
type: string
base64Config:
description: base64-ed config
required: true
Expand Down Expand Up @@ -68,6 +73,8 @@ jobs:
TEST_ARGS: -test.timeout 720h
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-tests:${{ github.sha }}
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
TEST_TYPE: ${{ github.event.inputs.testType }}
TEST_TEST_TYPE: ${{ github.event.inputs.testType }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better to add forwarding of TEST_TYPE variable to CTF?

with:
test_command_to_run: cd integration-tests && go test -timeout 30m -v -run ^TestAutomationBenchmark$ ./benchmark -count=1
test_download_vendor_packages_command: make gomod
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/benchmark/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestAutomationBenchmark(t *testing.T) {
}
networkName := strings.ReplaceAll(benchmarkNetwork.Name, " ", "")
testName := fmt.Sprintf("%s%s", networkName, *config.Keeper.Common.RegistryToTest)
l.Info().Str("Test Name", testName).Strs("Test Inputs", config.Keeper.Common.TestInputs).Msg("Running Benchmark Test")
l.Info().Str("Test Name", testName).Msg("Running Benchmark Test")
benchmarkTestNetwork := getNetworkConfig(networkName, &config)

l.Info().Str("Namespace", testEnvironment.Cfg.Namespace).Msg("Connected to Keepers Benchmark Environment")
Expand Down Expand Up @@ -314,7 +314,7 @@ func SetupAutomationBenchmarkEnv(t *testing.T, keeperTestConfig types.KeeperBenc
TTL: time.Hour * 720, // 30 days,
NamespacePrefix: fmt.Sprintf(
"automation-%s-%s-%s",
keeperTestConfig.GetConfigurationName(),
strings.ToLower(keeperTestConfig.GetConfigurationName()),
strings.ReplaceAll(strings.ToLower(testNetwork.Name), " ", "-"),
strings.ReplaceAll(strings.ToLower(*keeperTestConfig.GetKeeperConfig().Common.RegistryToTest), "_", "-"),
),
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ ARG BASE_IMAGE
ARG IMAGE_VERSION=latest
FROM ${BASE_IMAGE}:${IMAGE_VERSION}

ARG SUITES=chaos migration performance reorg smoke soak benchmark
ARG SUITES=chaos migration reorg smoke soak benchmark

COPY . testdir/
WORKDIR /go/testdir
RUN /go/testdir/integration-tests/scripts/buildTests "${SUITES}"
RUN touch .root_dir
ENTRYPOINT ["/go/testdir/integration-tests/scripts/entrypoint"]
2 changes: 0 additions & 2 deletions integration-tests/testconfig/automation/automation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ chainlink_node_funding = 0.5
number_of_nodes=6
duration=100
block_time=1
number_of_events=1
spec_type="minimum"
chainlink_node_log_level="info"
use_prometheus=false
Expand All @@ -22,7 +21,6 @@ chainlink_node_funding = 100
number_of_nodes=6
duration=900
block_time=1
number_of_events=1
spec_type="minimum"
chainlink_node_log_level="info"
use_prometheus=false
Expand Down
72 changes: 27 additions & 45 deletions integration-tests/testconfig/keeper/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package keeper

import (
"errors"

"github.com/smartcontractkit/chainlink-testing-framework/utils/net"
)

type Config struct {
Expand All @@ -18,24 +16,23 @@ func (c *Config) Validate() error {
}

type Common struct {
RegistryToTest *string `toml:"registry_to_test"`
NumberOfRegistries *int `toml:"number_of_registries"`
NumberOfNodes *int `toml:"number_of_nodes"`
NumberOfUpkeeps *int `toml:"number_of_upkeeps"`
UpkeepGasLimit *int64 `toml:"upkeep_gas_limit"`
CheckGasToBurn *int64 `toml:"check_gas_to_burn"`
PerformGasToBurn *int64 `toml:"perform_gas_to_burn"`
MaxPerformGas *int64 `toml:"max_perform_gas"`
BlockRange *int64 `toml:"block_range"`
BlockInterval *int64 `toml:"block_interval"`
ForceSingleTxKey *bool `toml:"forces_single_tx_key"`
DeleteJobsOnEnd *bool `toml:"delete_jobs_on_end"`
RegistryAddress *string `toml:"registry_address"`
RegistrarAddress *string `toml:"registrar_address"`
LinkTokenAddress *string `toml:"link_token_address"`
EthFeedAddress *string `toml:"eth_feed_address"`
GasFeedAddress *string `toml:"gas_feed_address"`
TestInputs []string `toml:"test_inputs"`
RegistryToTest *string `toml:"registry_to_test"`
NumberOfRegistries *int `toml:"number_of_registries"`
NumberOfNodes *int `toml:"number_of_nodes"`
NumberOfUpkeeps *int `toml:"number_of_upkeeps"`
UpkeepGasLimit *int64 `toml:"upkeep_gas_limit"`
CheckGasToBurn *int64 `toml:"check_gas_to_burn"`
PerformGasToBurn *int64 `toml:"perform_gas_to_burn"`
MaxPerformGas *int64 `toml:"max_perform_gas"`
BlockRange *int64 `toml:"block_range"`
BlockInterval *int64 `toml:"block_interval"`
ForceSingleTxKey *bool `toml:"forces_single_tx_key"`
DeleteJobsOnEnd *bool `toml:"delete_jobs_on_end"`
RegistryAddress *string `toml:"registry_address"`
RegistrarAddress *string `toml:"registrar_address"`
LinkTokenAddress *string `toml:"link_token_address"`
EthFeedAddress *string `toml:"eth_feed_address"`
GasFeedAddress *string `toml:"gas_feed_address"`
}

func (c *Common) Validate() error {
Expand Down Expand Up @@ -69,35 +66,20 @@ func (c *Common) Validate() error {
if c.BlockInterval == nil || *c.BlockInterval <= 0 {
return errors.New("block_interval must be a positive integer")
}
if c.RegistryAddress == nil || *c.RegistryAddress == "" {
return errors.New("registry_address must be set")
}
if !net.IsValidURL(*c.RegistryAddress) {
return errors.New("registry_address must be a valid address")
}
if c.RegistrarAddress == nil || *c.RegistrarAddress == "" {
return errors.New("registrar_address must be set")
}
if !net.IsValidURL(*c.RegistrarAddress) {
return errors.New("registrar_address must be a valid address")
}
if c.LinkTokenAddress == nil || *c.LinkTokenAddress == "" {
return errors.New("link_token_address must be set")
}
if !net.IsValidURL(*c.LinkTokenAddress) {
return errors.New("link_token_address must be a valid address")
if c.RegistryAddress == nil {
c.RegistryAddress = new(string)
}
if c.EthFeedAddress == nil || *c.EthFeedAddress == "" {
return errors.New("eth_feed_address must be set")
if c.RegistrarAddress == nil {
c.RegistrarAddress = new(string)
}
if !net.IsValidURL(*c.EthFeedAddress) {
return errors.New("eth_feed_address must be a valid address")
if c.LinkTokenAddress == nil {
c.LinkTokenAddress = new(string)
}
if c.GasFeedAddress == nil || *c.GasFeedAddress == "" {
return errors.New("gas_feed_address must be set")
if c.EthFeedAddress == nil {
c.EthFeedAddress = new(string)
}
if !net.IsValidURL(*c.GasFeedAddress) {
return errors.New("gas_feed_address must be a valid address")
if c.GasFeedAddress == nil {
c.GasFeedAddress = new(string)
}
return nil
}
2 changes: 1 addition & 1 deletion integration-tests/testconfig/keeper/keeper.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ registry_to_test = "2_1"
number_of_registries = 1
number_of_nodes = 6
number_of_upkeeps = 500
upkeep_gas_limit = 150000
upkeep_gas_limit = 1500000
check_gas_to_burn = 100000
perform_gas_to_burn = 50000
max_perform_gas = 5000000
Expand Down
Loading