DPC Load Test #51
Workflow file for this run
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: DPC Load Test | |
on: | |
workflow_dispatch: | |
jobs: | |
run-load-test: | |
name: "Run DPC API Load Test" | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: ./dpc-app | |
- name: Start StatsD Integration | |
run: | | |
docker run -d \ | |
--name newrelic-statsd \ | |
-e NR_ACCOUNT_ID=${{ secrets.NEW_RELIC_ACCOUNT_ID }} \ | |
-e NR_API_KEY=${{ secrets.LOAD_TEST_NEW_RELIC_API_KEY }} \ | |
-p 8125:8125/udp \ | |
newrelic/nri-statsd:latest | |
# StatsD integration is deprecated in current K6 version; need to build custom K6 build, | |
# see https://grafana.com/docs/k6/latest/results-output/real-time/statsd/ | |
- name: Build K6 with xk6-output-statsd | |
run: | | |
docker run --rm -i -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build \ | |
--with github.com/LeonAdato/xk6-output-statsd | |
- name: Run K6 with StatsD output | |
env: | |
LOAD_TEST_CLIENT_TOKEN: ${{ secrets.LOAD_TEST_CLIENT_TOKEN }} | |
LOAD_TEST_PRIVATE_KEY: ${{ secrets.LOAD_TEST_PRIVATE_KEY }} | |
LOAD_TEST_PUBLIC_KEY_ID: ${{ secrets.LOAD_TEST_PUBLIC_KEY_ID }} | |
run: | | |
./k6 run \ | |
--out statsd=localhost:8125,enableTags=true \ | |
./dpc-app/dpc-load-testing/script.js | |
- name: Cleanup StatsD Container | |
if: always() | |
run: | | |
if [ $(docker ps -aq -f name=newrelic-statsd) ]; then | |
echo "Stopping and removing StatsD container" | |
docker stop newrelic-statsd | |
docker rm newrelic-statsd | |
fi |