Scale test api (via cloudfront) #249
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: "Scale test api (via cloudfront)" | |
on: | |
schedule: | |
- cron: "0 0 * * Sun" | |
jobs: | |
locust-build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
pip install -r tests/scale/requirements-scale.txt | |
- name: Staging Scale Test | |
run: | | |
locust -f tests/scale/scale_test_portal_apis.py --headless -u 30 -r 10 --host https://api.cellxgene.staging.single-cell.czi.technology/ --run-time 5m 2>&1 | tee locust_staging_stats.txt | |
- name: Slack success webhook | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
run: | | |
STAGING_STATS=$(tail -n 13 locust_staging_stats.txt) | |
STAGING_MSG="\`\`\`STAGING SCALE TEST RESULTS: ${STAGING_STATS}\`\`\`" | |
curl -X POST -H 'Content-type: application/json' --data "{'text':'${STAGING_MSG}'}" $SLACK_WEBHOOK |