Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

Add comprehensive integration tests for the mux-server HTTP/WebSocket API.

Tests cover:

  • Health & Version endpoints - Basic server availability
  • Authentication - Bearer token for HTTP, query param for WebSocket
  • IPC channel routing - project:list, providers:list, providers:getConfig
  • WebSocket subscriptions - workspace:metadata, workspace:activity
  • --add-project CLI flag - Project creation on startup

Test infrastructure:

  • Real server instances with isolated MUX_ROOT directories
  • Each test suite gets its own server on a random port
  • serverTestUtils.ts provides reusable helpers for:
    • Server lifecycle management
    • Test directory setup (with optional git repo)
    • IPC request helpers
    • WebSocket connection and message utilities

Running:

make build-main  # Required first
TEST_INTEGRATION=1 bun x jest tests/server/server.test.ts

Generated with mux

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Add comprehensive integration tests for the mux-server HTTP/WebSocket API:

- Health and version endpoint tests
- Authentication tests (bearer token for HTTP, query param for WebSocket)
- IPC channel routing tests (project:list, providers:list, etc.)
- WebSocket subscription tests (workspace:metadata, workspace:activity)
- --add-project CLI flag test

Tests use real server instances with isolated MUX_ROOT directories.
Each test suite gets its own server on a random port.

Test infrastructure in serverTestUtils.ts provides:
- Server lifecycle management (start/stop)
- Test directory setup with optional git repo
- IPC request helpers
- WebSocket connection and message helpers

Run with: TEST_INTEGRATION=1 bun x jest tests/server/server.test.ts

_Generated with mux_
Address Codex review - wrap test suite in describeIntegration to skip
when TEST_INTEGRATION is not set, matching the pattern used by other
integration tests in tests/ipcMain/.
Fix TypeScript path resolution in CI where relative paths may not
resolve correctly across different workspace configurations.
The mux-server architecture changed from IPC to ORPC. Server tests
already exist in src/cli/server.test.ts covering the new ORPC endpoints.

These tests were based on the old IPC-based server which no longer exists.
@ibetitsmike
Copy link
Contributor Author

Closing this PR - the mux-server architecture changed from IPC to ORPC while I was writing these tests. Comprehensive server tests already exist in src/cli/server.test.ts covering the new ORPC endpoints (13 tests covering health, version, HTTP and WebSocket RPC calls, and streaming).

The IPC-based tests I wrote are now obsolete since the IPC infrastructure no longer exists.

@ibetitsmike ibetitsmike closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant