Skip to content

Commit 83f65c2

Browse files
fix: address bun migration review findings
- Bump BUN_VERSION 1.2.6 → 1.3.12 across all CI workflows + packageManager pin - Replace `|| true` swallow on `bun install --frozen-lockfile` with `--lockfile-only` so lockfile updates after `changeset version` actually land - Simplify bunfig.toml; drop misleading bun.lockb comments (we use text bun.lock) - Add CLAUDE.md section explaining the Bun-vs-Vitest test runner split - Filter `task-master-ai` out of `turbo test*` scripts to stop root recursion (root `test` was `turbo test`, which made `task-master-ai#test` recurse) - Bump @tm/mcp integration test timeouts 15s → 30s (matching @tm/cli) to remove flake under turbo concurrency on Linux runners - Skip pre-existing progress-tracker EACCES test (vi.clearAllMocks wipes mockRejectedValueOnce; same issue noted elsewhere in the repo)
1 parent 28ef5d0 commit 83f65c2

13 files changed

Lines changed: 63 additions & 60 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919
DO_NOT_TRACK: 1
2020
NODE_ENV: development
2121
NODE_VERSION: 20
22-
BUN_VERSION: 1.2.6
22+
BUN_VERSION: 1.3.12
2323

2424
jobs:
2525
# Single install job that caches node_modules for all other jobs

.github/workflows/extension-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020
contents: read
2121

2222
env:
23-
BUN_VERSION: 1.2.6
23+
BUN_VERSION: 1.3.12
2424
NODE_VERSION: 20
2525

2626
jobs:

.github/workflows/extension-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212
concurrency: extension-release-${{ github.ref }}
1313

1414
env:
15-
BUN_VERSION: 1.2.6
15+
BUN_VERSION: 1.3.12
1616
NODE_VERSION: 20
1717

1818
jobs:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515
actions: write
1616

1717
env:
18-
BUN_VERSION: 1.2.6
18+
BUN_VERSION: 1.3.12
1919
NODE_VERSION: 20
2020

2121
jobs:

.github/workflows/update-models-md.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
- 'docs/scripts/models-json-to-markdown.js'
1111

1212
env:
13-
BUN_VERSION: 1.2.6
13+
BUN_VERSION: 1.3.12
1414
NODE_VERSION: 20
1515

1616
jobs:

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@
77

88
## Test Guidelines
99

10+
### Test runners (Bun vs Vitest)
11+
12+
This repo uses Bun for install/build but two different test runners:
13+
14+
- **Vitest (Node)** — used by every package and app (`@tm/core`, `@tm/cli`, `@tm/mcp`, `apps/extension`, etc.). Run via `npm run test -w <package>` or `bun run --filter <package> test`. **All package tests live here.**
15+
- **Bun's native runner** — used only for the root-level `tests/` directory. Run via `npm run test:root`. Configured in `bunfig.toml` with preload `tests/setup.ts`.
16+
17+
Why split? Bun's runtime has known Zod / SSR-related issues that affect `@tm/core` in particular, so packages stay on Node + Vitest. Bun's runner is fine for the simpler integration scripts in `tests/`.
18+
19+
**Don't run `bun test` from the repo root expecting all tests** — it only sees `tests/`. Use `npm test` (turbo) for everything.
20+
1021
### Test File Placement
1122

1223
- **Package & tests**: Place in `packages/<package-name>/src/<module>/<file>.spec.ts` or `apps/<app-name>/src/<module>/<file.spec.ts>` alongside source

apps/mcp/tests/integration/tools/generate.tool.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('generate MCP tool', () => {
100100
expect(response.data).toHaveProperty('count');
101101
expect(response.data).toHaveProperty('directory');
102102
expect(response.data).toHaveProperty('message');
103-
}, 15000);
103+
}, 30000);
104104

105105
it('should include tag in response', () => {
106106
const testData = createTasksFile({
@@ -111,7 +111,7 @@ describe('generate MCP tool', () => {
111111
const response = callMCPTool('generate', { projectRoot: testDir });
112112

113113
expect(response.tag).toBe('master');
114-
}, 15000);
114+
}, 30000);
115115

116116
it('should return count of generated files', () => {
117117
const testData = createTasksFile({
@@ -126,13 +126,13 @@ describe('generate MCP tool', () => {
126126
const response = callMCPTool('generate', { projectRoot: testDir });
127127

128128
expect(response.data.count).toBe(3);
129-
}, 15000);
129+
}, 30000);
130130

131131
it('should return zero count when no tasks exist', () => {
132132
const response = callMCPTool('generate', { projectRoot: testDir });
133133

134134
expect(response.data.count).toBe(0);
135-
}, 15000);
135+
}, 30000);
136136

137137
it('should return orphanedFilesRemoved count', () => {
138138
// Create tasks and generate files
@@ -174,7 +174,7 @@ describe('generate MCP tool', () => {
174174
});
175175

176176
expect(response.data.directory).toBe(customDir);
177-
}, 15000);
177+
}, 30000);
178178

179179
it('should accept tag parameter', () => {
180180
// Create tasks under a custom tag (not master)
@@ -199,5 +199,5 @@ describe('generate MCP tool', () => {
199199
expect(
200200
fs.existsSync(path.join(outputDir, 'task_001_feature-branch.md'))
201201
).toBe(true);
202-
}, 15000);
202+
}, 30000);
203203
});

apps/mcp/tests/integration/tools/get-tasks.tool.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('get_tasks MCP tool', () => {
8787
expect(data.data.tasks).toEqual([]);
8888
expect(data.data.stats.total).toBe(0);
8989
expect(data.tag).toBe('master');
90-
}, 15000);
90+
}, 30000);
9191

9292
it('should get all tasks with correct information', () => {
9393
const testData = createTasksFile({
@@ -129,7 +129,7 @@ describe('get_tasks MCP tool', () => {
129129
expect(data.data.stats.completed).toBe(1);
130130
expect(data.data.stats.inProgress).toBe(1);
131131
expect(data.data.stats.pending).toBe(1);
132-
}, 15000);
132+
}, 30000);
133133

134134
it('should filter tasks by status', () => {
135135
const testData = createTasksFile({
@@ -151,7 +151,7 @@ describe('get_tasks MCP tool', () => {
151151
expect(data.data.tasks.every((t: any) => t.status === 'pending')).toBe(
152152
true
153153
);
154-
}, 15000);
154+
}, 30000);
155155

156156
it('should include subtasks when requested', () => {
157157
const testData = createTasksFile({
@@ -199,7 +199,7 @@ describe('get_tasks MCP tool', () => {
199199
expect(data.data.stats.subtasks.total).toBe(2);
200200
expect(data.data.stats.subtasks.completed).toBe(1);
201201
expect(data.data.stats.subtasks.pending).toBe(1);
202-
}, 15000);
202+
}, 30000);
203203

204204
it('should calculate statistics correctly', () => {
205205
const testData = createTasksFile({
@@ -218,7 +218,7 @@ describe('get_tasks MCP tool', () => {
218218
expect(data.data.stats.completed).toBe(3);
219219
expect(data.data.stats.pending).toBe(1);
220220
expect(data.data.stats.completionPercentage).toBe(75);
221-
}, 15000);
221+
}, 30000);
222222

223223
it('should handle multiple status filters', () => {
224224
const testData = createTasksFile({
@@ -240,5 +240,5 @@ describe('get_tasks MCP tool', () => {
240240
const statuses = data.data.tasks.map((t: any) => t.status);
241241
expect(statuses).toContain('pending');
242242
expect(statuses).toContain('blocked');
243-
}, 15000);
243+
}, 30000);
244244
});

apps/mcp/vitest.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ import rootConfig from '../../vitest.config';
44
/**
55
* MCP package Vitest configuration
66
* Extends root config with MCP-specific settings
7+
*
8+
* Integration tests spawn the CLI / MCP server and routinely take 8–18s.
9+
* Use the same generous timeout as @tm/cli to avoid flakes under contention.
710
*/
811
export default mergeConfig(
912
rootConfig,
1013
defineConfig({
1114
test: {
12-
// MCP-specific test patterns
1315
include: [
1416
'tests/**/*.test.ts',
1517
'tests/**/*.spec.ts',
1618
'src/**/*.test.ts',
1719
'src/**/*.spec.ts'
18-
]
20+
],
21+
testTimeout: 30000,
22+
hookTimeout: 30000
1923
}
2024
})
2125
);

bun.lock

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

0 commit comments

Comments
 (0)