Skip to content

Commit

Permalink
Fix network config read and few more reporting updates (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG authored Feb 20, 2024
1 parent 067b85b commit ea1bbe5
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 342 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/ccip-live-testnet-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
base64_test_input : # base64 encoded toml for test input
description: 'Base64 encoded toml test input'
required: false
slackMemberID:
description: 'Slack member ID to notify'
required: false
test_type:
description: 'Type of test to run'
required: false
Expand Down Expand Up @@ -111,7 +114,6 @@ jobs:
contents: read
env:
CHAINLINK_ENV_USER: ${{ github.actor }}
SLACK_USER: ${{ inputs.slackMemberID }}
SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }}
SLACK_CHANNEL: ${{ secrets.QA_SLACK_CHANNEL }}
TEST_LOG_LEVEL: info
Expand All @@ -136,14 +138,20 @@ jobs:
- name: Prepare Base64 TOML override
shell: bash
run: |
SLACK_USER=$(jq -r '.inputs.slackMemberID' $GITHUB_EVENT_PATH)
echo ::add-mask::$SLACK_USER
if [[ -z "$SLACK_USER" ]]; then
SLACK_USER="${{ secrets.QA_SLACK_USER }}"
fi
echo "SLACK_USER=$SLACK_USER" >> "$GITHUB_ENV"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
BASE64_CCIP_CONFIG_OVERRIDE=$(jq -r '.inputs.base64_test_input' $GITHUB_EVENT_PATH)
echo ::add-mask::$BASE64_CCIP_CONFIG_OVERRIDE
echo "BASE64_CCIP_CONFIG_OVERRIDE=$BASE64_CCIP_CONFIG_OVERRIDE" >> $GITHUB_ENV
echo "TEST_BASE64_CCIP_CONFIG_OVERRIDE=$BASE64_CCIP_CONFIG_OVERRIDE" >> $GITHUB_ENV
fi
if [[ "${{ github.event_name }}" == "schedule" ]]; then
BASE64_CCIP_CONFIG_OVERRIDE=$(jq -c . ./integration-tests/ccip-tests/testconfig/override/mainnet.toml | base64 -w 0)
BASE64_CCIP_CONFIG_OVERRIDE=$(base64 -w 0 -i ./integration-tests/ccip-tests/testconfig/override/mainnet.toml)
echo ::add-mask::$BASE64_CCIP_CONFIG_OVERRIDE
echo "BASE64_CCIP_CONFIG_OVERRIDE=$BASE64_CCIP_CONFIG_OVERRIDE" >> $GITHUB_ENV
echo "TEST_BASE64_CCIP_CONFIG_OVERRIDE=$BASE64_CCIP_CONFIG_OVERRIDE" >> $GITHUB_ENV
Expand Down Expand Up @@ -176,6 +184,7 @@ jobs:
DATABASE_URL: postgresql://postgres:node@localhost:5432/chainlink_test?sslmode=disable
RR_MEM: 8Gi
RR_CPU: 4
DETACH_RUNNER: true
TEST_TRIGGERED_BY: ccip-load-test-ci
with:
test_command_to_run: cd ./integration-tests/ccip-tests && go test -v -timeout 70m -count=1 -json -run ^TestLoadCCIPStableRPS$ ./load 2>&1 | tee /tmp/gotest.log | gotestfmt
Expand All @@ -192,7 +201,7 @@ jobs:
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
cache_key_id: ccip-load-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
should_cleanup: "true"
should_cleanup: false

ccip-smoke-test:
name: CCIP smoke Test
Expand All @@ -209,7 +218,6 @@ jobs:
contents: read
env:
CHAINLINK_ENV_USER: ${{ github.actor }}
SLACK_USER: ${{ inputs.slackMemberID }}
SLACK_API_KEY: ${{ secrets.QA_SLACK_API_KEY }}
SLACK_CHANNEL: ${{ secrets.QA_SLACK_CHANNEL }}
TEST_LOG_LEVEL: info
Expand All @@ -234,6 +242,12 @@ jobs:
- name: Prepare Base64 TOML override
shell: bash
run: |
SLACK_USER=$(jq -r '.inputs.slackMemberID' $GITHUB_EVENT_PATH)
echo ::add-mask::$SLACK_USER
if [[ -z "$SLACK_USER" ]]; then
SLACK_USER="${{ secrets.QA_SLACK_USER }}"
fi
echo "SLACK_USER=$SLACK_USER" >> "$GITHUB_ENV"
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
BASE64_CCIP_CONFIG_OVERRIDE=$(jq -r '.inputs.base64_test_input' $GITHUB_EVENT_PATH)
echo ::add-mask::$BASE64_CCIP_CONFIG_OVERRIDE
Expand Down Expand Up @@ -265,12 +279,13 @@ jobs:
env:
TEST_SUITE: smoke
TEST_ARGS: -test.timeout 900h
DETACH_RUNNER: true
DATABASE_URL: postgresql://postgres:node@localhost:5432/chainlink_test?sslmode=disable
RR_MEM: 8Gi
RR_CPU: 4
TEST_TRIGGERED_BY: ccip-smoke-test-ci
with:
test_command_to_run: cd ./integration-tests/ccip-tests && go test -v -timeout 70m -count=1 -json -run ^TestSmokeCCIPForBidirectionalLane$ ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt
test_command_to_run: cd ./integration-tests/ccip-tests && go test -v -timeout 70m -count=1 -p 30 -json -run ^TestSmokeCCIPForBidirectionalLane$ ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt
test_download_vendor_packages_command: cd ./integration-tests && go mod download
cl_repo: ${{ env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ env.CHAINLINK_VERSION }}
Expand All @@ -284,4 +299,4 @@ jobs:
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
cache_key_id: ccip-smoke-${{ env.MOD_CACHE_VERSION }}
cache_restore_only: "true"
should_cleanup: "true"
should_cleanup: false
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ core/scripts/gateway @bolekk @pinebit
# CI/CD
/.github/** @chainchad @javuto @jkongie @jmank88 @samsondav
/.github/workflows/integration-tests.yml @smartcontractkit/test-tooling-team @jasonmci
/.github/workflows/**-tests.yml @smartcontractkit/test-tooling-team @jasonmci
/.github/workflows/integration-chaos-tests.yml @smartcontractkit/test-tooling-team @jasonmci
/.github/workflows/integration-tests-publish.yml @smartcontractkit/test-tooling-team @jasonmci
/.github/workflows/performance-tests.yml @smartcontractkit/test-tooling-team @jasonmci
Expand Down
6 changes: 6 additions & 0 deletions integration-tests/ccip-tests/testconfig/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ type CCIPTestConfig struct {
TimeoutForPriceUpdate *config.Duration `toml:",omitempty"`
}

func (c *CCIPTestConfig) SetTestRunName(name string) {
if c.TestRunName == "" && name != "" {
c.TestRunName = name
}
}

func (c *CCIPTestConfig) Validate() error {
if c.PhaseTimeout != nil && (c.PhaseTimeout.Duration().Minutes() < 1 || c.PhaseTimeout.Duration().Minutes() > 50) {
return errors.Errorf("phase timeout should be between 1 and 50 minutes")
Expand Down
11 changes: 6 additions & 5 deletions integration-tests/ccip-tests/testconfig/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,19 @@ func (p *Common) Validate() error {
if p.Network == nil {
return errors.New("no networks specified")
}
// read the default network config, if specified
p.Network.UpperCaseNetworkNames()
err := p.Network.Default()
if err != nil {
return fmt.Errorf("error reading default network config %w", err)
}
if err := p.Network.Validate(); err != nil {
return fmt.Errorf("error validating networks config %w", err)
}
return p.Chainlink.Validate()
}

func (p *Common) EVMNetworks() ([]blockchain.EVMNetwork, []string, error) {
p.Network.UpperCaseNetworkNames()
err := p.Network.Default()
if err != nil {
return nil, p.Network.SelectedNetworks, fmt.Errorf("error reading default network config %w", err)
}
evmNetworks := networks.MustSetNetworks(*p.Network)
if len(p.Network.SelectedNetworks) != len(evmNetworks) {
return nil, p.Network.SelectedNetworks, fmt.Errorf("selected networks %v do not match evm networks %v", p.Network.SelectedNetworks, evmNetworks)
Expand Down
Loading

0 comments on commit ea1bbe5

Please sign in to comment.