Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions .github/workflows/loadtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Start load test server
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
fingerprint: ${{ secrets.VPS_SSH_FINGERPRINT }}
# Increase timeout — migrations run on startup
command_timeout: 120s
script: |
cd ~/fairqueue-loadtest

# Write env file from secret
echo "${{ secrets.LOADTEST_ENV_FILE }}" > .env

# Pull latest image and start stack
docker compose -f docker-compose.loadtest.yml pull
docker compose -f docker-compose.loadtest.yml up -d

# Wait for server to be healthy — up to 90 seconds
echo "Waiting for load test server to be ready..."
for i in $(seq 1 45); do
STATUS=$(curl -sf -o /dev/null -w "%{http_code}" \
Expand All @@ -57,7 +51,6 @@ jobs:
sleep 2
done

# Seed organizer — idempotent, safe to call multiple times
SEED_STATUS=$(curl -sf -o /dev/null -w "%{http_code}" \
-X POST http://localhost:8082/loadtest/seed)
if [ "$SEED_STATUS" != "200" ]; then
Expand All @@ -67,14 +60,15 @@ jobs:
echo "Seed complete"

run-loadtest:
needs: deploy-loadtest-server
needs: deploy-loadtest-server # waits for server to be ready
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install k6
uses: grafana/setup-k6-action@v1


- name: Run load test scenario
run: |
case "${{ inputs.scenario }}" in
Expand All @@ -94,14 +88,19 @@ jobs:
-e ORGANIZER_EMAIL=loadtest@admin.com \
-e ORGANIZER_PASSWORD=loadtest-password \
-e EVENT_ID=${{ inputs.event_id }} \
--out experimental-prometheus-rw \
--tag scenario=${{ inputs.scenario }} \
$SCRIPT
env:
K6_PROMETHEUS_RW_SERVER_URL: https://api.tulcanvcm.com/prometheus/api/v1/write
K6_PROMETHEUS_RW_TREND_STATS: p(50),p(90),p(95),p(99),max,min
K6_PROMETHEUS_RW_USERNAME: k6
K6_PROMETHEUS_RW_PASSWORD: ${{ secrets.PROMETHEUS_REMOTE_WRITE_PASSWORD }}
Comment on lines +91 to +98
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

For grafana/setup-k6-action@v1, what is the exact input to pin the k6 version? Also, in the latest k6 docs, is --out experimental-prometheus-rwstill valid, and areK6_PROMETHEUS_RW_SERVER_URL, K6_PROMETHEUS_RW_USERNAME, K6_PROMETHEUS_RW_PASSWORD, and K6_PROMETHEUS_RW_TREND_STATS the correct env vars for remote write auth and trend stats?

💡 Result:

For grafana/setup-k6-action@v1, the exact input to pin the k6 version is k6-version with a string value like '0.49.0'. In the latest k6 docs, --out experimental-prometheus-rw is still valid (experimental but actively maintained as of 2026). The env vars K6_PROMETHEUS_RW_SERVER_URL, K6_PROMETHEUS_RW_USERNAME, K6_PROMETHEUS_RW_PASSWORD, and K6_PROMETHEUS_RW_TREND_STATS are correct for remote write auth and trend stats.

Citations:


Pin k6 version in the setup-k6-action step.
The workflow relies on --out experimental-prometheus-rw, but the setup action currently installs the latest available k6 version. This can cause unexpected breakage if k6 changes the output format or environment variable behavior. Use the k6-version input (e.g., k6-version: '0.49.0') in the setup-k6-action step to ensure consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/loadtest.yml around lines 91 - 98, The workflow uses the
experimental Prometheus RW output (--out experimental-prometheus-rw) but does
not pin the k6 version; update the setup-k6-action step (the action that
installs k6) to include the k6-version input (for example k6-version: '0.49.0')
so the installed k6 is deterministic and won’t break changes to outputs or env
handling; locate the setup-k6-action block in the workflow and add the
k6-version field to the action inputs.


teardown-loadtest-server:
# Depends on deploy, not run-loadtest, so it always runs
# even if the load test itself fails or is skipped
needs: deploy-loadtest-server
needs: run-loadtest # waits for load test to finish
runs-on: ubuntu-latest
if: always()
if: always() # runs even if run-loadtest fails or is cancelled
steps:
- name: Stop and clean up load test server
uses: appleboy/ssh-action@v1
Expand Down
Loading