Skip to content

Commit

Permalink
rebase develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Jul 17, 2024
2 parents afc9175 + 8e1cfa7 commit 113cdf0
Show file tree
Hide file tree
Showing 79 changed files with 2,389 additions and 1,027 deletions.
7 changes: 6 additions & 1 deletion .github/actions/performance-tests/art.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config:
target: "-=http_request_protocol=-://-=endpoint_to_test=-"
target: "http://localhost:9545"
phases:
- duration: 300
arrivalRate: 400
Expand All @@ -14,6 +14,11 @@ config:
ensure:
- type: "failure"
threshold: 1
publish-metrics:
- type: prometheus
pushgateway: 'https://pushgateway.dev-zetachain-internal.com'
tags:
- 'type:loadtest'
summary: true
reports:
- type: "html"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- develop
- release/*
merge_group:
pull_request:
branches:
Expand All @@ -12,7 +13,6 @@ on:
- synchronize
- opened
- reopened
- ready_for_review

concurrency:
group: pr-testing-${{ github.head_ref || github.run_id }}
Expand Down
132 changes: 105 additions & 27 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,49 @@ on:
push:
branches:
- develop
- release/*
pull_request:
branches:
- "*"
merge_group:
workflow_dispatch:
schedule:
# run at 6AM UTC Daily
# 6AM UTC -> 11PM PT
- cron: "0 6 * * *"
workflow_dispatch:
inputs:
default-test:
type: boolean
required: false
default: false
upgrade-light-test:
type: boolean
required: false
default: false
upgrade-test:
type: boolean
required: false
default: false
admin-test:
type: boolean
required: false
default: false
upgrade-import-mainnet-test:
type: boolean
required: false
default: false
performance-test:
type: boolean
required: false
default: false
stateful-data-test:
type: boolean
required: false
default: false
tss-migration-test:
type: boolean
required: false
default: false

concurrency:
group: e2e-${{ github.head_ref || github.sha }}
Expand All @@ -27,34 +61,64 @@ jobs:
DEFAULT_TESTS: ${{ steps.matrix-conditionals.outputs.DEFAULT_TESTS }}
UPGRADE_TESTS: ${{ steps.matrix-conditionals.outputs.UPGRADE_TESTS }}
UPGRADE_LIGHT_TESTS: ${{ steps.matrix-conditionals.outputs.UPGRADE_LIGHT_TESTS }}
UPGRADE_IMPORT_MAINNET_TESTS: ${{ steps.matrix-conditionals.outputs.UPGRADE_IMPORT_MAINNET_TESTS }}
ADMIN_TESTS: ${{ steps.matrix-conditionals.outputs.ADMIN_TESTS }}
PERFORMANCE_TESTS: ${{ steps.matrix-conditionals.outputs.PERFORMANCE_TESTS }}
STATEFUL_DATA_TESTS: ${{ steps.matrix-conditionals.outputs.STATEFUL_DATA_TESTS }}
TSS_MIGRATION_TESTS: ${{ steps.matrix-conditionals.outputs.TSS_MIGRATION_TESTS }}

steps:
# use cli rather than event context to avoid race conditions (label added after push)
# use api rather than event context to avoid race conditions (label added after push)
- id: matrix-conditionals
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "DEFAULT_TESTS=true" >> $GITHUB_OUTPUT
labels=$(gh pr view -R ${{github.repository}} ${{github.event.pull_request.number}} --json labels -q '.labels[].name')
if [[ "$labels" == *"UPGRADE_TESTS"* ]]; then
echo "UPGRADE_TESTS=true" >> $GITHUB_OUTPUT
fi
if [[ "$labels" == *"UPGRADE_LIGHT_TESTS"* ]]; then
echo "UPGRADE_LIGHT_TESTS=true" >> $GITHUB_OUTPUT
fi
if [[ "$labels" == *"ADMIN_TESTS"* ]]; then
echo "ADMIN_TESTS=true" >> $GITHUB_OUTPUT
fi
elif [[ ${{ github.event_name }} == 'merge_group' ]]; then
echo "DEFAULT_TESTS=true" >> $GITHUB_OUTPUT
elif [[ ${{ github.event_name }} == 'push' && ${{ github.ref }} == 'refs/heads/develop' ]]; then
echo "DEFAULT_TESTS=true" >> $GITHUB_OUTPUT
elif [[ ${{ github.event_name }} == 'schedule' ]]; then
echo "UPGRADE_TESTS=true" >> $GITHUB_OUTPUT
echo "UPGRADE_LIGHT_TESTS=true" >> $GITHUB_OUTPUT
echo "ADMIN_TESTS=true" >> $GITHUB_OUTPUT
fi
uses: actions/github-script@v7
with:
script: |
if (context.eventName === 'pull_request') {
const { data: pr } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
const labels = pr.labels.map(label => label.name);
console.log("labels:", labels);
core.setOutput('DEFAULT_TESTS', true);
core.setOutput('UPGRADE_TESTS', labels.includes('UPGRADE_TESTS'));
core.setOutput('UPGRADE_LIGHT_TESTS', labels.includes('UPGRADE_LIGHT_TESTS'));
core.setOutput('UPGRADE_IMPORT_MAINNET_TESTS', labels.includes('UPGRADE_IMPORT_MAINNET_TESTS'));
core.setOutput('ADMIN_TESTS', labels.includes('ADMIN_TESTS'));
core.setOutput('PERFORMANCE_TESTS', labels.includes('PERFORMANCE_TESTS'));
core.setOutput('STATEFUL_DATA_TESTS', labels.includes('STATEFUL_DATA_TESTS'));
core.setOutput('TSS_MIGRATION_TESTS', labels.includes('TSS_MIGRATION_TESTS'));
} else if (context.eventName === 'merge_group') {
core.setOutput('DEFAULT_TESTS', true);
} else if (context.eventName === 'push' && context.ref === 'refs/heads/develop') {
core.setOutput('DEFAULT_TESTS', true);
} else if (context.eventName === 'push' && context.ref.startsWith('refs/heads/release/')) {
core.setOutput('DEFAULT_TESTS', true);
core.setOutput('UPGRADE_TESTS', true);
core.setOutput('UPGRADE_LIGHT_TESTS', true);
core.setOutput('UPGRADE_IMPORT_MAINNET_TESTS', true);
core.setOutput('ADMIN_TESTS', true);
core.setOutput('PERFORMANCE_TESTS', true);
core.setOutput('STATEFUL_DATA_TESTS', true);
} else if (context.eventName === 'schedule') {
core.setOutput('DEFAULT_TESTS', true);
core.setOutput('UPGRADE_TESTS', true);
core.setOutput('UPGRADE_LIGHT_TESTS', true);
core.setOutput('UPGRADE_IMPORT_MAINNET_TESTS', true);
core.setOutput('ADMIN_TESTS', true);
core.setOutput('PERFORMANCE_TESTS', true);
core.setOutput('STATEFUL_DATA_TESTS', true);
} else if (context.eventName === 'workflow_dispatch') {
core.setOutput('DEFAULT_TESTS', context.payload.inputs['default-test']);
core.setOutput('UPGRADE_TESTS', context.payload.inputs['upgrade-test']);
core.setOutput('UPGRADE_LIGHT_TESTS', context.payload.inputs['upgrade-light-test']);
core.setOutput('UPGRADE_IMPORT_MAINNET_TESTS', context.payload.inputs['upgrade-import-mainnet-test']);
core.setOutput('ADMIN_TESTS', context.payload.inputs['admin-test']);
core.setOutput('PERFORMANCE_TESTS', context.payload.inputs['performance-test']);
core.setOutput('STATEFUL_DATA_TESTS', context.payload.inputs['stateful-data-test']);
core.setOutput('TSS_MIGRATION_TESTS', context.payload.inputs['tss-migration-test']);
}
e2e:
needs: matrix-conditionals
Expand All @@ -71,9 +135,21 @@ jobs:
- make-target: "start-upgrade-test-light"
runs-on: ubuntu-20.04
run: ${{ needs.matrix-conditionals.outputs.UPGRADE_LIGHT_TESTS == 'true' }}
- make-target: "start-upgrade-import-mainnet-test"
runs-on: buildjet-16vcpu-ubuntu-2204
run: ${{ needs.matrix-conditionals.outputs.UPGRADE_IMPORT_MAINNET_TESTS == 'true' }}
- make-target: "start-e2e-admin-test"
runs-on: ubuntu-20.04
run: ${{ needs.matrix-conditionals.outputs.ADMIN_TESTS == 'true' }}
- make-target: "start-e2e-performance-test"
runs-on: buildjet-4vcpu-ubuntu-2204
run: ${{ needs.matrix-conditionals.outputs.PERFORMANCE_TESTS == 'true' }}
- make-target: "start-e2e-import-mainnet-test"
runs-on: buildjet-16vcpu-ubuntu-2204
run: ${{ needs.matrix-conditionals.outputs.STATEFUL_DATA_TESTS == 'true' }}
- make-target: "start-tss-migration-test"
runs-on: ubuntu-20.04
run: ${{ needs.matrix-conditionals.outputs.TSS_MIGRATION_TESTS == 'true' }}
name: ${{ matrix.make-target }}
uses: ./.github/workflows/reusable-e2e.yml
with:
Expand All @@ -84,7 +160,9 @@ jobs:
# this allows you to set a required status check
e2e-ok:
runs-on: ubuntu-22.04
needs: e2e
needs:
- matrix-conditionals
- e2e
if: always()
steps:
- run: |
Expand Down
119 changes: 0 additions & 119 deletions .github/workflows/execute_advanced_tests.yaml

This file was deleted.

Loading

0 comments on commit 113cdf0

Please sign in to comment.