Skip to content

Commit

Permalink
added output of load test to the nightly build notification
Browse files Browse the repository at this point in the history
  • Loading branch information
gatsbyz committed Apr 21, 2023
1 parent 3175ae1 commit 10a9cfa
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ on: # yamllint disable-line rule:truthy
description: The environment to run against
type: string
required: true
outputs:
workflow_output_loadtest1:
description: "Loadtest output"
value: ${{ jobs.loadtest1.outputs.loadtest_output_failure }}
workflow_output_loadtest2:
description: "Loadtest output"
value: ${{ jobs.loadtest2.outputs.loadtest_output_failure }}
secrets:
AWS_ROLE_ARN:
required: true
Expand Down Expand Up @@ -71,10 +78,10 @@ jobs:
- name: Terraform Validate
id: validate
run: terraform validate -no-color
continue-on-error: true
- name: Terraform Plan
id: plan
run: terraform plan -out=tfplan -no-color
continue-on-error: true
env:
TF_VAR_explorer_rds_master_password: ${{ secrets.TF_VAR_EXPLORER_RDS_MASTER_PASSWORD }}
TF_VAR_deployment_name: ${{ secrets.TF_VAR_DEPLOYMENT_NAME }}
Expand All @@ -99,7 +106,7 @@ jobs:
- name: Install ansible / botocore / boto3
run: |
python3 -m pip install --user ansible
pip install boto3 botocore
python3 -m pip install boto3 botocore
- name: Run Ansible
working-directory: ansible
run: |
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/loadtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
run_k6:
environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
outputs:
loadtest_output_failure: ${{ steps.run_k6_failure.outputs.test_output }}
steps:
- name: Install Go
uses: actions/setup-go@v3
Expand Down Expand Up @@ -97,6 +99,11 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_PERFORMANCE_WEBHOOK_URL }}
LOADTEST_MNEMONIC: ${{ secrets.LOADTEST_MNEMONIC }}
LOADTEST_DURATION: ${{ inputs.duration }}

- name: Run tests failed
if: failure()
id: run_k6_failure
run: echo "test_output=false" >> $GITHUB_OUTPUT

- name: Notify Slack
uses: slackapi/slack-github-action@v1.23.0
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/manual.deploy.nightly.devnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
### 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/nightly-loadtest-workflow
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_AWS_PROFILE: ${{ secrets.TF_VAR_AWS_PROFILE }}
TF_VAR_COMPANY_NAME: ${{ secrets.TF_VAR_COMPANY_NAME }}
TF_VAR_CREATE_SSH_KEY: ${{ secrets.TF_VAR_CREATE_SSH_KEY }}
TF_VAR_DEPLOYMENT_NAME: ${{ secrets.TF_VAR_DEPLOYMENT_NAME }}
TF_VAR_DEVNET_KEY_VALUE: ${{ secrets.TF_VAR_DEVNET_KEY_VALUE }}
TF_VAR_EXPLORER_RDS_MASTER_PASSWORD: ${{ secrets.TF_VAR_EXPLORER_RDS_MASTER_PASSWORD }}
TF_VAR_JUMPBOX_SSH_ACCESS: ${{ secrets.TF_VAR_JUMPBOX_SSH_ACCESS }}
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 }}
ANSIBLE_PRIVATE_SSH: ${{ secrets.ANSIBLE_PRIVATE_SSH }}
with:
environment: devnet
7 changes: 7 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ jobs:
"text": "Fuzz tests ${{ needs.fuzz.outputs.workflow_output == '' && ':white_check_mark:' || ':x: `failed`' }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Load tests ${{ needs.loadtest.outputs.workflow_output == '' && ':white_check_mark:' || ':x: `failed`' }}"
}
},
{
"type": "divider"
},
Expand Down

0 comments on commit 10a9cfa

Please sign in to comment.