From f1e11e07b1b3e3a5328ae3062cdad08a409ce0a2 Mon Sep 17 00:00:00 2001 From: jeffyxu Date: Sat, 9 May 2026 15:26:37 +0800 Subject: [PATCH 1/4] ci: trigger e2e validation From b18c7186c0967b5764655272fb3e926ed8877d21 Mon Sep 17 00:00:00 2001 From: jeffyxu Date: Sat, 9 May 2026 15:37:57 +0800 Subject: [PATCH 2/4] ci: re-trigger e2e after fixture repo init From f3e1429fc4a2b727061ad32e996724aecb8a7f9a Mon Sep 17 00:00:00 2001 From: jeffyxu Date: Sat, 9 May 2026 15:59:16 +0800 Subject: [PATCH 3/4] ci: re-trigger after fixing fixture teamai.yaml schema From 1bb4e838d7167ae53b152f705fae92407dfd4fa9 Mon Sep 17 00:00:00 2001 From: jeffyxu Date: Sat, 9 May 2026 16:39:30 +0800 Subject: [PATCH 4/4] fix(e2e): disable file parallelism and add init diagnostic output - Set fileParallelism: false in vitest.e2e.config.ts to prevent "Cannot find module dist/index.js" race condition on GitHub Actions - Add output to init assertion for debugging remaining failure --- src/__tests__/e2e/e2e.test.ts | 10 ++++++++-- vitest.e2e.config.ts | 10 ++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/__tests__/e2e/e2e.test.ts b/src/__tests__/e2e/e2e.test.ts index cb2160b..77fc55f 100644 --- a/src/__tests__/e2e/e2e.test.ts +++ b/src/__tests__/e2e/e2e.test.ts @@ -668,19 +668,25 @@ describe('init project scope (sandboxed)', () => { const stdinAllBlanks = '\n\n\n\n\n'; const result = await runCLIWithEnv( - ['init', '--scope', 'project', '--repo', fullUrl, '--force'], + ['init', '--scope', 'project', '--repo', fullUrl, '--role', 'common', '--force'], { // GitHub: gh CLI / REST honors GITHUB_TOKEN // TGit: gf CLI honors TGIT_TOKEN GITHUB_TOKEN: process.env.TEAMAI_TEST_TOKEN ?? '', TGIT_TOKEN: process.env.TEAMAI_TEST_TOKEN ?? '', HOME: sandbox, // isolate from user-scope ~/.teamai + // Git identity must be set explicitly because HOME override + // hides the global .gitconfig written by CI setup steps. + GIT_AUTHOR_NAME: 'TeamAI CI', + GIT_AUTHOR_EMAIL: 'ci@teamai.test', + GIT_COMMITTER_NAME: 'TeamAI CI', + GIT_COMMITTER_EMAIL: 'ci@teamai.test', }, stdinAllBlanks, sandbox, // cwd = sandbox, so .teamai/ lands here ); - expect(result.code).toBe(0); + expect(result.code, `init failed with output:\n${result.output}`).toBe(0); expect(fs.existsSync(path.join(sandbox, '.teamai', 'config.yaml'))).toBe(true); // Verify the project-scope config has the expected shape diff --git a/vitest.e2e.config.ts b/vitest.e2e.config.ts index 5308c21..2f1f69e 100644 --- a/vitest.e2e.config.ts +++ b/vitest.e2e.config.ts @@ -8,10 +8,12 @@ export default defineConfig({ ], testTimeout: 60_000, hookTimeout: 30_000, - // E2E tests spawn child processes and touch the real filesystem; a few - // (notably auto-recall-e2e) are inherently slightly flaky on CI runners - // due to timing/state. Retry once: flaky tests recover, real bugs stay - // failed (since they'll fail both runs). + // E2E tests spawn child processes and touch the real filesystem. + // Run test files sequentially to avoid race conditions (parallel + // file-level execution causes intermittent "Cannot find module + // dist/index.js" on GitHub Actions CI runners). + fileParallelism: false, + // Retry once: flaky tests recover, real bugs stay failed. retry: 1, }, });