Skip to content

Commit 258bfd2

Browse files
committed
Merge remote-tracking branch 'origin/develop' into next
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/workflows/cli-tests.yml # .github/workflows/client-cypress-tests.yml # packages/cli/bunfig.toml # packages/cli/src/commands/agent/utils/validation.ts # packages/cli/src/scripts/copy-templates.ts # packages/cli/src/utils/copy-template.ts # packages/cli/src/utils/get-config.ts # packages/cli/tests/commands/update.test.ts # packages/cli/tests/test-timeouts.ts # packages/cli/tests/utils/copy-template.test.ts # packages/client/src/App.tsx # packages/client/src/components/ai-elements/response.tsx # packages/client/src/components/app-sidebar.tsx # packages/client/src/components/connection-error-banner.tsx # packages/client/src/components/connection-status.tsx # packages/client/src/components/group-card.tsx # packages/client/src/components/group-panel.tsx # packages/client/src/context/AuthContext.tsx # packages/client/src/context/ConnectionContext.tsx # packages/client/src/hooks/use-query-hooks.ts # packages/client/src/hooks/use-socket-chat.ts # packages/client/src/index.css # packages/client/src/lib/api-client-config.ts # packages/client/src/lib/socketio-manager.ts # packages/client/src/routes/chat.tsx # packages/client/src/routes/group.tsx # packages/client/src/routes/home.tsx # packages/core/src/runtime.ts # packages/core/src/settings.ts # packages/core/src/types/database.ts # packages/core/src/types/index.ts # packages/plugin-bootstrap/src/evaluators/reflection.ts # packages/plugin-bootstrap/src/index.ts # packages/plugin-bootstrap/src/providers/actionState.ts # packages/plugin-bootstrap/src/providers/actions.ts # packages/plugin-bootstrap/src/providers/anxiety.ts # packages/plugin-bootstrap/src/providers/choice.ts # packages/plugin-bootstrap/src/providers/index.ts # packages/plugin-bootstrap/src/providers/recentMessages.ts # packages/plugin-bootstrap/src/providers/settings.ts # packages/plugin-bootstrap/src/providers/world.ts # packages/server/src/__tests__/unit/middleware/auth-middleware.test.ts # packages/server/src/__tests__/unit/socketio/authentication.test.ts # packages/server/src/api/agents/logs.ts # packages/server/src/api/agents/runs.ts # packages/server/src/api/index.ts # packages/server/src/api/memory/agents.ts # packages/server/src/index.ts # packages/server/src/middleware/index.ts # packages/server/src/middleware/rate-limit.ts # packages/server/src/services/message.ts # packages/server/src/socketio/index.ts # packages/server/src/types/index.ts # packages/test-utils/src/mocks/database.ts # packages/test-utils/src/mocks/runtime.ts # packages/typescript/src/basic-capabilities/providers/attachments.ts # packages/typescript/src/bootstrap/banner.ts # packages/typescript/src/bootstrap/providers/character.ts # packages/typescript/src/bootstrap/providers/entities.ts # packages/typescript/src/bootstrap/providers/evaluators.ts # packages/typescript/src/bootstrap/providers/plugin-info.ts # packages/typescript/src/bootstrap/providers/relationships.ts # packages/typescript/src/bootstrap/providers/roles.ts # packages/typescript/src/bootstrap/providers/shared-cache.ts # packages/typescript/src/database.ts # packages/typescript/src/types/user.ts
2 parents c1ca901 + d731d98 commit 258bfd2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+15614
-2
lines changed

.github/workflows/cli-tests.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Eliza CLI Tests
2+
3+
# Cancel previous runs for the same PR/branch
4+
concurrency:
5+
group: cli-tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
6+
cancel-in-progress: true
7+
8+
env:
9+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
12+
ELIZA_NONINTERACTIVE: true
13+
14+
on:
15+
push:
16+
branches:
17+
- 'main'
18+
- 'develop'
19+
pull_request:
20+
branches:
21+
- 'main'
22+
- 'develop'
23+
24+
jobs:
25+
test:
26+
# Skip duplicate runs: run on push to main/develop, or on pull_request events only
27+
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(fromJson('["main", "develop"]'), github.ref_name))
28+
runs-on: ${{ matrix.os }}
29+
timeout-minutes: 45 # Prevent job timeout from killing processes prematurely
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ubuntu-latest, macos-latest, windows-latest]
34+
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Install PostgreSQL client libraries (Ubuntu only)
40+
if: matrix.os == 'ubuntu-latest'
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y libpq-dev postgresql-client
44+
45+
- name: Set up Bun
46+
uses: oven-sh/setup-bun@v2
47+
with:
48+
bun-version: 1.3.4
49+
50+
- name: Mention Bun version
51+
run: bun --version
52+
53+
- name: Debug Bun Setup
54+
shell: bash
55+
run: |
56+
echo "PATH: $PATH"
57+
echo "which bun: $(which bun 2>/dev/null || echo 'which not found')"
58+
echo "command -v bun: $(command -v bun 2>/dev/null || echo 'command not found')"
59+
if command -v bun &> /dev/null; then
60+
BUN_PATH=$(which bun 2>/dev/null || command -v bun)
61+
echo "Bun found at: $BUN_PATH"
62+
ls -la "$BUN_PATH" 2>/dev/null || echo "Failed to ls bun"
63+
file "$BUN_PATH" 2>/dev/null || echo "Failed to get bun file info"
64+
else
65+
echo "Bun not found in PATH"
66+
fi
67+
68+
- name: Install dependencies
69+
run: bun install
70+
71+
- name: Build all packages
72+
run: bun run build
73+
74+
- name: Link packages globally
75+
run: |
76+
# Link core package first (everything depends on it)
77+
cd packages/core
78+
bun link
79+
cd ../..
80+
echo "Linked @elizaos/core package globally"
81+
82+
# Link server package (CLI depends on it)
83+
cd packages/server
84+
bun link
85+
cd ../..
86+
echo "Linked @elizaos/server package globally"
87+
88+
# Link CLI package
89+
cd packages/cli
90+
bun link
91+
cd ../..
92+
echo "Linked elizaos command globally"
93+
94+
- name: Verify package links
95+
shell: bash
96+
run: |
97+
echo "Verifying @elizaos/server package is available..."
98+
bun pm ls -g | grep "@elizaos/server" || echo "@elizaos/server not found in global links"
99+
100+
echo "Verifying elizaos command is available..."
101+
which elizaos || echo "elizaos not found in PATH"
102+
elizaos --version || echo "Failed to run elizaos --version"
103+
104+
- name: Verify CLI build artifacts
105+
shell: bash
106+
run: |
107+
echo "Checking CLI build artifacts..."
108+
echo "CLI dist contents:"
109+
ls -la packages/cli/dist/ || echo "ERROR: No dist directory"
110+
echo ""
111+
echo "CLI templates in dist:"
112+
ls -la packages/cli/dist/templates/ || echo "ERROR: No templates in dist"
113+
echo ""
114+
echo "CLI executable:"
115+
test -f packages/cli/dist/index.js && echo "✓ CLI index.js exists" || echo "ERROR: CLI index.js missing"
116+
117+
- name: Clean eliza projects cache
118+
shell: bash
119+
run: rm -rf ~/.eliza/projects
120+
121+
- name: Create .env file for tests
122+
shell: bash
123+
run: |
124+
echo "OPENAI_API_KEY=$OPENAI_API_KEY" > .env
125+
echo "LOG_LEVEL=info" >> .env
126+
127+
- name: Install cross-env globally
128+
run: bun install -g cross-env
129+
130+
- name: Install BATS on macOS
131+
if: matrix.os == 'macos-latest'
132+
run: bun install -g bats
133+
134+
- name: Run CLI TypeScript tests
135+
run: cross-env bun test tests/commands/ --timeout 300000
136+
working-directory: packages/cli
137+
env:
138+
ELIZA_TEST_MODE: true
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: Client Cypress Tests
2+
3+
# Cancel previous runs for the same PR/branch
4+
concurrency:
5+
group: client-cypress-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
6+
cancel-in-progress: true
7+
8+
env:
9+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
12+
ELIZA_NONINTERACTIVE: true
13+
# Skip unnecessary downloads during CI
14+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
15+
16+
on:
17+
push:
18+
branches:
19+
- 'main'
20+
- 'develop'
21+
paths:
22+
- 'packages/client/**'
23+
- 'packages/core/**'
24+
- 'packages/server/**'
25+
- '.github/workflows/client-cypress-tests.yml'
26+
pull_request:
27+
branches:
28+
- 'main'
29+
- 'develop'
30+
paths:
31+
- 'packages/client/**'
32+
- 'packages/core/**'
33+
- 'packages/server/**'
34+
- '.github/workflows/client-cypress-tests.yml'
35+
36+
jobs:
37+
# Component tests (no server needed)
38+
cypress-component:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
44+
- name: Install PostgreSQL client libraries
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y libpq-dev postgresql-client
48+
49+
- name: Set up Node.js
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: 23
53+
54+
- name: Set up Bun
55+
uses: oven-sh/setup-bun@v2
56+
with:
57+
bun-version: 1.3.4
58+
59+
- name: Install dependencies
60+
run: bun install
61+
62+
- name: Build packages (Turbo cached)
63+
run: bun run build
64+
65+
- name: Install Cypress binary
66+
working-directory: packages/client
67+
run: bunx cypress install
68+
69+
- name: Run Cypress Component Tests
70+
working-directory: packages/client
71+
run: |
72+
# Update dependencies first to ensure compatibility
73+
bun install
74+
# Run component tests
75+
bun run test:component
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
CI: true
79+
80+
# E2E tests (needs server)
81+
cypress-e2e:
82+
runs-on: ubuntu-latest
83+
strategy:
84+
fail-fast: false
85+
matrix:
86+
# Can add parallelization here: containers: [1, 2, 3]
87+
containers: [1]
88+
steps:
89+
- name: Checkout code
90+
uses: actions/checkout@v4
91+
92+
- name: Install PostgreSQL client libraries
93+
run: |
94+
sudo apt-get update
95+
sudo apt-get install -y libpq-dev postgresql-client
96+
97+
- name: Set up Node.js
98+
uses: actions/setup-node@v4
99+
with:
100+
node-version: 23
101+
102+
- name: Set up Bun
103+
uses: oven-sh/setup-bun@v2
104+
with:
105+
bun-version: 1.3.4
106+
107+
- name: Install dependencies
108+
run: bun install
109+
110+
- name: Build packages (Turbo cached)
111+
run: bun run build
112+
113+
- name: Install Cypress binary
114+
working-directory: packages/client
115+
run: bunx cypress install
116+
117+
- name: Create .env file
118+
run: |
119+
echo "OPENAI_API_KEY=$OPENAI_API_KEY" > .env
120+
echo "LOG_LEVEL=info" >> .env
121+
122+
- name: Run E2E tests with server (no auth)
123+
working-directory: packages/client
124+
run: |
125+
chmod +x scripts/test-e2e-server.sh
126+
./scripts/test-e2e-server.sh
127+
env:
128+
SERVER_PORT: 3000
129+
CLIENT_PORT: 5173
130+
131+
# E2E tests with authentication enabled
132+
cypress-e2e-auth:
133+
runs-on: ubuntu-latest
134+
services:
135+
postgres:
136+
image: pgvector/pgvector:pg16
137+
env:
138+
POSTGRES_USER: eliza_test
139+
POSTGRES_PASSWORD: eliza_test_password
140+
POSTGRES_DB: eliza_test
141+
ports:
142+
- 5433:5432
143+
options: >-
144+
--health-cmd pg_isready
145+
--health-interval 10s
146+
--health-timeout 5s
147+
--health-retries 5
148+
strategy:
149+
fail-fast: false
150+
matrix:
151+
containers: [1]
152+
steps:
153+
- name: Checkout code
154+
uses: actions/checkout@v4
155+
156+
- name: Set up Node.js
157+
uses: actions/setup-node@v4
158+
with:
159+
node-version: 23
160+
161+
- name: Set up Bun
162+
uses: oven-sh/setup-bun@v2
163+
with:
164+
bun-version: 1.2.21
165+
166+
- name: Install dependencies
167+
run: bun install
168+
169+
- name: Build packages (Turbo cached)
170+
run: bun run build
171+
172+
- name: Install Cypress binary
173+
working-directory: packages/client
174+
run: bunx cypress install
175+
176+
- name: Create .env file
177+
run: |
178+
echo "OPENAI_API_KEY=$OPENAI_API_KEY" > .env
179+
echo "LOG_LEVEL=info" >> .env
180+
181+
- name: Run E2E tests with authentication
182+
working-directory: packages/client
183+
run: |
184+
chmod +x scripts/test-e2e-server-auth.sh
185+
./scripts/test-e2e-server-auth.sh
186+
env:
187+
SERVER_PORT: 3000
188+
CLIENT_PORT: 5173
189+
190+
# Summary job
191+
cypress-tests-summary:
192+
needs: [cypress-component, cypress-e2e, cypress-e2e-auth]
193+
runs-on: ubuntu-latest
194+
if: always()
195+
steps:
196+
- name: Check test results
197+
run: |
198+
component_result="${{ needs.cypress-component.result }}"
199+
e2e_result="${{ needs.cypress-e2e.result }}"
200+
e2e_auth_result="${{ needs.cypress-e2e-auth.result }}"
201+
202+
if [[ "$component_result" == "failure" || "$e2e_result" == "failure" || "$e2e_auth_result" == "failure" ]]; then
203+
echo "❌ Cypress tests failed"
204+
echo "Component tests: $component_result"
205+
echo "E2E tests (no auth): $e2e_result"
206+
echo "E2E tests (with auth): $e2e_auth_result"
207+
exit 1
208+
elif [[ "$component_result" == "cancelled" || "$e2e_result" == "cancelled" || "$e2e_auth_result" == "cancelled" ]]; then
209+
echo "⏹️ Cypress tests were cancelled"
210+
exit 1
211+
else
212+
echo "✅ All Cypress tests passed"
213+
echo "Component tests: $component_result"
214+
echo "E2E tests (no auth): $e2e_result"
215+
echo "E2E tests (with auth): $e2e_auth_result"
216+
fi

bun.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)