Skip to content

Commit

Permalink
ci: Add e2e heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
johnjcsmith committed Dec 1, 2024
1 parent f5a5d98 commit b09c9b6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -410,27 +410,6 @@ jobs:
- name: Run tests
run: npm test

validate-load-tests:
needs: [check_changes]
runs-on: ubuntu-latest
if: ${{ needs.check_changes.outputs.load_tests == 'true' }}
defaults:
run:
working-directory: load-tests
env:
INFERABLE_TEST_CLUSTER_ID: ${{ secrets.INFERABLE_TEST_CLUSTER_ID }}
INFERABLE_TEST_API_SECRET: ${{ secrets.INFERABLE_TEST_API_SECRET }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
# Run machine:start backgrounded
- run: npm run machine:start &
- uses: grafana/setup-k6-action@v1
- uses: grafana/run-k6-action@v1
with:
path: ./load-tests/script.js

build-load-test-machine-image:
runs-on: ubuntu-latest
needs: check_changes
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
schedule:
- cron: "0 * * * *"
pull_request:
branches:
- main
paths:
- 'load-tests/**'

jobs:
run-e2e:
runs-on: ubuntu-latest
defaults:
run:
working-directory: load-tests
env:
INFERABLE_TEST_CLUSTER_ID: ${{ secrets.INFERABLE_TEST_CLUSTER_ID }}
INFERABLE_TEST_API_SECRET: ${{ secrets.INFERABLE_TEST_API_SECRET }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
# Run machine:start backgrounded
- run: npm run machine:start &
- uses: grafana/setup-k6-action@v1
- uses: grafana/run-k6-action@v1
with:
path: ./load-tests/script.js
- run: curl -X POST https://uptime.betterstack.com/api/v1/heartbeat/hYrsEwXdwJDDqsNmCEjX2umS
2 changes: 1 addition & 1 deletion load-tests/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function () {

// Create a new run
const postRunResponse = http.post(`${BASE_URL}/clusters/${CLUSTER_ID}/runs`, JSON.stringify({
initialPrompt: 'Get the special word from from the `searchHaystack` function',
initialPrompt: 'Get the special word from the `searchHaystack` function',
resultSchema: {
type: 'object',
properties: {
Expand Down

0 comments on commit b09c9b6

Please sign in to comment.