K6 Performance Cloud Test #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: K6 Performance Cloud Test | |
on: | |
schedule: | |
- cron: '0 0 * * 6' # 00:00 every Saturday | |
workflow_dispatch: | |
inputs: | |
target: | |
description: 'Target environment' | |
type: choice | |
required: true | |
options: | |
- 'dev-mainnet' | |
- 'dev-preprod' | |
wallet-count: | |
description: 'Number of wallets to simulate' | |
type: number | |
required: true | |
default: 1000 | |
hd-addr-per-wallet: | |
description: 'Number of addresses per wallet. Used when running in RestoreHD mode.' | |
type: number | |
required: true | |
default: 10 | |
hd-tx-history-size-per-wallet: | |
description: 'Maximum number of transactions per wallet. Filter wallet addresses to have a tx history size smaller than this value. Used when running in RestoreHD mode.' | |
type: number | |
required: true | |
default: 100 | |
rampup-duration: | |
description: 'Ramp up duration in minutes. Up to 100 wallets should use 1m. 500 wallets and above should use 5m or 10m. 1000 wallets should use 10m' | |
type: choice | |
required: true | |
options: | |
- '10m' | |
- '5m' | |
- '1m' | |
sustain-duration: | |
description: 'Sustain duration in minutes. Up to 100 wallets should use 2m. 500 wallets and above should use 2m or 5m. 1000 wallets should use 5m' | |
type: choice | |
required: true | |
options: | |
- '5m' | |
- '2m' | |
env: | |
TARGET_ENV: ${{ inputs.target || 'dev-mainnet' }} | |
PROVIDER_SERVER_URL: $PROVIDER_SERVER_URL | |
RUN_MODE: 'RestoreHD' | |
MAX_VU: ${{ inputs.wallet-count || 1000 }} | |
RAMP_UP_DURATION: ${{ inputs.rampup-duration || '10m' }} | |
STEADY_STATE_DURATION: ${{ inputs.sustain-duration || '5m' }} | |
HD_ACTIVE_ADDR_COUNT: ${{ inputs.hd-addr-per-wallet || 10 }} | |
HD_MAX_TX_HISTORY: ${{ inputs.hd-tx-history-size-per-wallet || 100 }} | |
jobs: | |
wallet-restoration: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set target env url based on input | |
run: | | |
if [ "$TARGET_ENV" = "dev-preprod" ]; then | |
echo "PROVIDER_SERVER_URL=https://dev-preprod.lw.iog.io" >> $GITHUB_ENV | |
elif [ "$TARGET_ENV" = "dev-mainnet" ]; then | |
echo "PROVIDER_SERVER_URL=https://dev-mainnet.lw.iog.io" >> $GITHUB_ENV | |
fi | |
- name: Run k6 cloud test | |
uses: grafana/k6-action@v0.3.1 | |
env: | |
K6_CLOUD_PROJECT_ID: ${{ secrets.K6_CLOUD_PROJECT_ID }} | |
with: | |
filename: ./packages/e2e/test/k6/scenarios/wallets.test.js | |
cloud: true | |
token: ${{ secrets.K6_CLOUD_API_TOKEN }} | |
flags: > | |
-e TARGET_ENV=$TARGET_ENV | |
-e PROVIDER_SERVER_URL=$PROVIDER_SERVER_URL | |
-e RUN_MODE=$RUN_MODE | |
-e MAX_VU=$MAX_VU | |
-e RAMP_UP_DURATION=$RAMP_UP_DURATION | |
-e STEADY_STATE_DURATION=$STEADY_STATE_DURATION | |
-e HD_ACTIVE_ADDR_COUNT=$HD_ACTIVE_ADDR_COUNT | |
-e HD_MAX_TX_HISTORY=$HD_MAX_TX_HISTORY |