feat: add e2e tests with Letta Cloud (#149)
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)
This commit is contained in:
30
.github/workflows/test.yml
vendored
30
.github/workflows/test.yml
vendored
@@ -7,7 +7,8 @@ on:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
unit:
|
||||
name: Unit Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -23,5 +24,30 @@ jobs:
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Run tests
|
||||
- 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 }}
|
||||
|
||||
Reference in New Issue
Block a user