Skip to content

Commit

Permalink
fix broken unit test due to changed loadtest inputs (#1432)
Browse files Browse the repository at this point in the history
* revert loadtest argument variables

* fix: rpc_url.txt file name

* --burn-contract

* keep manual flow in for the time being

* final test on manual flow

* block out manual flow

* Update .github/workflows/manual.deploy.nightly.devnet.yml

Co-authored-by: Victor Castell <victor@polygon.technology>

---------

Co-authored-by: Victor Castell <victor@polygon.technology>
  • Loading branch information
gatsbyz and vcastellm committed Apr 27, 2023
1 parent a47eed6 commit c6c8973
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
{% for address in premine_address %} --premine {{ address }}:1000000000000000000000000000 {% endfor %}
--premine 0x1AB8C3df809b85012a009c0264eb92dB04eD6EFa:1000000000000000000000000000 \
--premine 0x0000000000000000000000000000000000000000 \
--burn-contract 0:0x0000000000000000000000000000000000000000 \
--block-gas-limit {{ block_gas_limit }} \
--block-time {{ block_time }}s \
--chain-id {{ chain_id }} \
Expand Down Expand Up @@ -179,19 +180,19 @@ jobs:
- name: Set rpc url value
id: url
run: |
terraform output -raw aws_lb_ext_domain
terraform output -raw aws_lb_ext_domain | grep -o -E '^ext[^:]*' > rpc.txt
terraform output -raw aws_lb_ext_domain | grep -o -E '^ext[^:]*' > rpc_url.txt
- uses: actions/upload-artifact@v3
with:
name: rpc-url
path: rpc.txt
name: rpc_url
path: rpc_url.txt

loadtest1:
needs: build
uses: ./.github/workflows/loadtest.yml
name: Load Test Nightly Build - multiple_EOA
secrets:
SLACK_PERFORMANCE_WEBHOOK_URL: ${{ secrets.SLACK_PERFORMANCE_WEBHOOK_URL }}
LOADTEST_RPC_URL: "" # this is a workaround because of actions bug in passing output to another job
DD_API_KEY: ${{ secrets.DD_API_KEY }}
LOADTEST_MNEMONIC: ${{ secrets.LOADTEST_MNEMONIC }}
with:
Expand All @@ -204,6 +205,7 @@ jobs:
name: Load Test Nightly Build - multiple_ERC20
secrets:
SLACK_PERFORMANCE_WEBHOOK_URL: ${{ secrets.SLACK_PERFORMANCE_WEBHOOK_URL }}
LOADTEST_RPC_URL: "" # this is a workaround because of actions bug in passing output to another job
DD_API_KEY: ${{ secrets.DD_API_KEY }}
LOADTEST_MNEMONIC: ${{ secrets.LOADTEST_MNEMONIC }}
with:
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/loadtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ on: # yamllint disable-line rule:truthy
required: true
DD_API_KEY:
required: true
LOADTEST_RPC_URL:
required: true
LOADTEST_MNEMONIC:
required: true

Expand Down Expand Up @@ -78,10 +80,21 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Download artifact to get rpc url
env:
url: ${{ secrets.LOADTEST_RPC_URL }}
if: ${{ env.url == '' }}
uses: actions/download-artifact@v3
with:
name: rpc-url
- run: echo "RPC_URL=http://$(cat rpc.txt)" >> $GITHUB_ENV
name: rpc_url

- name: Set rpc_url
id: set_rpc_url
run: |
if [[ -z "${{ secrets.LOADTEST_RPC_URL }}" ]]; then
echo "rpc_url=http://$(cat rpc_url.txt)" >> $GITHUB_OUTPUT
else
echo "rpc_url=${{ secrets.LOADTEST_RPC_URL }}" >> $GITHUB_OUTPUT
fi
- id: k6
name: Run scenario
Expand All @@ -96,6 +109,7 @@ jobs:
echo "gas_max=$(cat summary.json | jq -r '.metrics.ethereum_gas_used.values.max')" >> $GITHUB_OUTPUT
env:
K6_STATSD_ENABLE_TAGS: true
RPC_URL: ${{ steps.set_rpc_url.outputs.rpc_url }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PERFORMANCE_WEBHOOK_URL }}
LOADTEST_MNEMONIC: ${{ secrets.LOADTEST_MNEMONIC }}
LOADTEST_DURATION: ${{ inputs.duration }}
Expand Down Expand Up @@ -140,7 +154,7 @@ jobs:
},
{
"type": "mrkdwn",
"text": "JSON-RPC Endpoint: ${{ env.RPC_URL }}"
"text": "JSON-RPC Endpoint: ${{ steps.set_rpc_url.outputs.rpc_url }}"
},
{
"type": "mrkdwn",
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/manual.deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
### This manually triggers the edge nightly build loadtest when pushed to jesse/nightly-loadtest-workflow

name: Nightly DevNet Workflow (Manual)
on: # yamllint disable-line rule:truthy
# push:
# branches:
# - jesse/fix-unit-test
workflow_call: {}
workflow_dispatch: {}

permissions:
id-token: write
contents: read
security-events: write

jobs:
devnet:
name: Build Devnet
uses: ./.github/workflows/deploy.nightly.devnet.yml
secrets:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ROLE_ARN: ${{ secrets.AWS_ROLE_ARN }}
TF_VAR_DEPLOYMENT_NAME: ${{ secrets.TF_VAR_DEPLOYMENT_NAME }}
TF_VAR_OWNER: ${{ secrets.TF_VAR_OWNER }}
SLACK_PERFORMANCE_WEBHOOK_URL: ${{ secrets.SLACK_PERFORMANCE_WEBHOOK_URL }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
LOADTEST_MNEMONIC: ${{ secrets.LOADTEST_MNEMONIC }}
VAULT_PASSWORD_FILE: ${{ secrets.VAULT_PASSWORD_FILE }}
with:
environment: devnet

0 comments on commit c6c8973

Please sign in to comment.