E2E testing infrastructure that tests the full message flow against a real Letta Cloud agent. Changes: - Add MockChannelAdapter for simulating inbound/outbound messages - Add e2e/bot.e2e.test.ts with 4 e2e tests: - Simple message/response - /status command - /help command - Conversation context retention - Add 'mock' to ChannelId type - Update CI workflow with separate e2e job (uses secrets) - Add npm run test:e2e script E2E tests require: - LETTA_API_KEY (already in repo secrets) - LETTA_E2E_AGENT_ID (needs to be added) E2E tests are skipped locally without these env vars. Written by Cameron ◯ Letta Code "Trust, but verify." - Ronald Reagan (on e2e testing)
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
unit:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Run unit tests
|
|
run: npm run test:run
|
|
|
|
e2e:
|
|
name: E2E Tests
|
|
runs-on: ubuntu-latest
|
|
# Only run e2e on main branch (has secrets)
|
|
if: github.ref == 'refs/heads/main' || github.event_name == 'push'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Run e2e tests
|
|
run: npm run test:e2e
|
|
env:
|
|
LETTA_API_KEY: ${{ secrets.LETTA_API_KEY }}
|
|
LETTA_E2E_AGENT_ID: ${{ secrets.LETTA_E2E_AGENT_ID }}
|