* fix: remove execute worktree prompt and deprecate create-worktree option * test(e2e): align specs with removed --create-worktree * fix: remove execute worktree leftovers and align docs/tests --------- Co-authored-by: Takashi Morikubo <azurite0107@gmail.com>
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
import { resolve, dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { createIsolatedEnv, type IsolatedEnv } from '../helpers/isolated-env';
|
|
import { createTestRepo, type TestRepo } from '../helpers/test-repo';
|
|
import { runTakt } from '../helpers/takt-runner';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
// E2E更新時は docs/testing/e2e.md も更新すること
|
|
describe('E2E: Direct task execution (--task)', () => {
|
|
let isolatedEnv: IsolatedEnv;
|
|
let testRepo: TestRepo;
|
|
|
|
beforeEach(() => {
|
|
isolatedEnv = createIsolatedEnv();
|
|
testRepo = createTestRepo();
|
|
});
|
|
|
|
afterEach(() => {
|
|
try {
|
|
testRepo.cleanup();
|
|
} catch {
|
|
// best-effort
|
|
}
|
|
try {
|
|
isolatedEnv.cleanup();
|
|
} catch {
|
|
// best-effort
|
|
}
|
|
});
|
|
|
|
it('should execute a direct task without worktree prompts', () => {
|
|
const piecePath = resolve(__dirname, '../fixtures/pieces/mock-single-step.yaml');
|
|
const scenarioPath = resolve(__dirname, '../fixtures/scenarios/execute-done.json');
|
|
|
|
const result = runTakt({
|
|
args: [
|
|
'--task', 'Create a file called noop.txt',
|
|
'--piece', piecePath,
|
|
'--provider', 'mock',
|
|
],
|
|
cwd: testRepo.path,
|
|
env: {
|
|
...isolatedEnv.env,
|
|
TAKT_MOCK_SCENARIO: scenarioPath,
|
|
},
|
|
timeout: 240_000,
|
|
});
|
|
|
|
expect(result.exitCode).toBe(0);
|
|
expect(result.stdout).toContain('Piece completed');
|
|
}, 240_000);
|
|
});
|