Skip to content

🤖 refactor: organize IPC tests into namespace folders#2370

Merged
ammario merged 2 commits intomainfrom
tests-rakp
Feb 12, 2026
Merged

🤖 refactor: organize IPC tests into namespace folders#2370
ammario merged 2 commits intomainfrom
tests-rakp

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Restructures 44 flat IPC test files into 8 namespace subfolders mirroring oRPC areas, making it easier to find related tests at a glance.

Background

All 46+ IPC tests lived in a single tests/ipc/ directory with no subfolders. Finding related tests required reading every filename. This is Phase 1 of the broader test restructuring plan.

Implementation

Moved test files into namespace folders using git mv:

Folder Area Files
workspace/ Workspace lifecycle (create, remove, rename, fork, init, AI settings, file change notification) 7
streaming/ sendMessage variants, interrupt, resume, queued messages, truncate, error recovery, history replay, compaction 17
runtime/ executeBash, backgroundBash, runtimeFileEditing, originFetch 6
terminal/ Terminal IPC 1
projects/ Project create, refactor, name generation 3
agents/ Agent list/plan commands 3
config/ MCP config, model preferences, model not found 3
providers/ Anthropic cache, Ollama, OpenAI web search, OpenAI response ID recovery 4

Shared helpers (setup.ts, helpers.ts, streamCollector.ts, orpcTestClient.ts, sendMessageTestHelpers.ts) stay at tests/ipc/ top level. Two misc tests (doubleRegister, windowTitle) also stay top-level.

File renames in this commit:

  • openai-web-search.test.tsproviders/openaiWebSearch.test.ts
  • interruptStream.starting.test.tsstreaming/interrupt.test.ts
  • resumeStream.test.tsstreaming/resume.test.ts
  • system1BashCompaction.matrix.integration.test.tsstreaming/system1BashCompaction.matrix.test.ts (dropped .integration suffix)
  • Various createWorkspace / projectCreate etc. normalized to workspace/create / projects/create style

All relative imports updated for the new depth (./setup../setup, ../../src/../../../src/, etc.).

Validation

  • bun x jest tests/ipc --runInBand after rebase: 47 suites, 0 failures (8 passed, 39 pending/skipped — the skipped ones require TEST_INTEGRATION=1 with real API keys, same as before)

Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: xhigh • Cost: $5.82

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.

Reviewed commit: 47d8937d44

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent
Copy link
Collaborator Author

@codex review

The dynamic import path in sendMessage.basic.test.ts was already fixed in the second commit (./setup../setup).

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Move 44 flat IPC test files into 8 namespace subfolders:
workspace/, streaming/, runtime/, terminal/, projects/, agents/, config/, providers/

Update all relative imports for moved files. Drop .integration suffix
from system1BashCompaction filename. Normalize openai-web-search to
openaiWebSearch.
Fix dynamic import path in sendMessage.basic.test.ts and update
Windows smoke test paths in pr.yml to match new folder structure.
@ammario ammario merged commit dff5f03 into main Feb 12, 2026
22 checks passed
@ammario ammario deleted the tests-rakp branch February 12, 2026 16:30
ammario pushed a commit that referenced this pull request Feb 12, 2026
## Summary

Reorganize 38 flat UI test files into semantic subfolders aligned with
docs product areas. Phase 2 of the integration test restructuring (Phase
1 was IPC tests in #2370).

## Background

All 38 UI tests lived in a flat `tests/ui/` directory with verbose
filenames like `workspaceLifecycle.integration.test.ts`. Finding related
tests required scanning every filename. The `.integration` suffix is
redundant since being in `tests/` already means "integration test."

## Implementation

Created 11 subfolders matching documentation product areas:

| Folder | Files | Examples |
|--------|-------|---------|
| `workspaces/` | 6 | lifecycle, fork, draft, intermediateStatus |
| `chat/` | 8 | sections, truncation, streamInterrupt, readMore |
| `agents/` | 4 | picker, thinkingPolicy, creationSlashCommands |
| `review/` | 3 | baseSelector, focus, refresh |
| `tasks/` | 3 | applyGitPatchCommits, awaitVisualization |
| `layout/` | 4 | leftSidebarResize, rightSidebar, fileTreeViewMode |
| `compaction/` | 2 | compaction, contextExceeded |
| `config/` | 2 | customModels, modelOneshot |
| `git/` | 3 | initBanner, status, parseStatusOutput |
| `gateway/` | 2 | sessionExpired, chatEventAggregator |
| `runtime/` | 1 | docker |

Shared helpers (`dom.ts`, `helpers.ts`, `harness/`,
`renderReviewPanel.tsx`) remain at `tests/ui/` root to minimize import
churn.

All moves used `git mv` to preserve history. Relative imports updated
(one level deeper: `./dom` → `../dom`, `../ipc/` → `../../ipc/`, etc.).

## Validation

- 35/35 test suites pass (`TEST_INTEGRATION=1 bun x jest tests/ui`)
- `make typecheck` clean
- `make lint` clean
- `make fmt-check` clean (2 files auto-formatted by `make fmt`)
- No CI config changes needed (CI uses directory-level globs
`tests/ui/`)

Note: 3 `.test.tsx` files aren't discovered by Jest due to pre-existing
`testMatch` pattern (`*.test.ts` only) — not caused by this change.

---

_Generated with `mux` • Model: `anthropic:claude-opus-4-6` • Thinking:
`xhigh` • Cost: `$14.99`_

<!-- mux-attribution: model=anthropic:claude-opus-4-6 thinking=xhigh
costs=14.99 -->
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.

2 participants