From 8cdf30a8c3253a58637e2c4fddeb51e3338218d0 Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 1 Dec 2024 15:33:24 +1030 Subject: [PATCH] ci: Fail e2e on any error --- .github/workflows/e2e.yml | 4 ++++ load-tests/script.js | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 7539af94..ead153d5 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,3 +1,5 @@ +name: E2E heartbeat + on: schedule: - cron: "0 * * * *" @@ -26,4 +28,6 @@ jobs: - uses: grafana/run-k6-action@v1 with: path: ./load-tests/script.js + fail-fast: true + flags: --throw - run: curl -X POST https://uptime.betterstack.com/api/v1/heartbeat/hYrsEwXdwJDDqsNmCEjX2umS diff --git a/load-tests/script.js b/load-tests/script.js index 0ff3f330..a38aa6a5 100644 --- a/load-tests/script.js +++ b/load-tests/script.js @@ -1,11 +1,15 @@ import http from 'k6/http'; import { sleep, check } from 'k6'; -// K6 defaults -// export const options = { -// vus: 1, -// iterations: 1, -// }; +export const options = { + // K6 defaults + // vus: 1, + // iterations: 1, + thresholds: { + // expect all checks to pass + checks: ['rate>=1'], + }, +}; const API_SECRET = __ENV.INFERABLE_TEST_API_SECRET const CLUSTER_ID = __ENV.INFERABLE_TEST_CLUSTER_ID