Skip to content

Commit 20d7fb1

Browse files
committed
refactor: update Playwright config and worktree integration tests
- Adjusted Playwright configuration to set workers to undefined for improved test execution. - Updated comments in worktree integration tests to clarify branch creation logic and ensure accurate assertions regarding branch and worktree paths.
1 parent a192eaa commit 20d7fb1

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

apps/app/playwright.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import { defineConfig, devices } from "@playwright/test";
33
const port = process.env.TEST_PORT || 3007;
44
const serverPort = process.env.TEST_SERVER_PORT || 3008;
55
const reuseServer = process.env.TEST_REUSE_SERVER === "true";
6-
const mockAgent = process.env.CI === "true" || process.env.AUTOMAKER_MOCK_AGENT === "true";
6+
const mockAgent =
7+
process.env.CI === "true" || process.env.AUTOMAKER_MOCK_AGENT === "true";
78

89
export default defineConfig({
910
testDir: "./tests",
1011
fullyParallel: true,
1112
forbidOnly: !!process.env.CI,
1213
retries: process.env.CI ? 2 : 0,
13-
workers: process.env.CI ? 1 : undefined,
14+
workers: undefined,
1415
reporter: "html",
1516
timeout: 30000,
1617
use: {

apps/app/tests/worktree-integration.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,9 +2441,9 @@ test.describe("Worktree Integration Tests", () => {
24412441
// Verify worktree was NOT created during editing (worktrees are created at execution time)
24422442
expect(fs.existsSync(expectedWorktreePath)).toBe(false);
24432443

2444-
// Verify the branch was created (if branch creation is part of the autocomplete flow)
2444+
// Verify branch was NOT created (created at execution time)
24452445
const branches = await listBranches(testRepo.path);
2446-
expect(branches).toContain(newBranchName);
2446+
expect(branches).not.toContain(newBranchName);
24472447

24482448
// Verify feature was updated with correct branchName only
24492449
// Note: worktreePath is no longer stored - worktrees are created server-side at execution time
@@ -2593,7 +2593,8 @@ test.describe("Worktree Integration Tests", () => {
25932593
);
25942594
expect(matchingWorktrees.length).toBe(1);
25952595

2596-
// Verify feature was updated with the correct worktreePath
2596+
// Verify feature was updated with the correct branchName
2597+
// Note: worktreePath is no longer stored - worktrees are created server-side at execution time
25972598
const featuresDir = path.join(testRepo.path, ".automaker", "features");
25982599
const featureDirs = fs.readdirSync(featuresDir);
25992600
const featureDir = featureDirs.find((dir) => {
@@ -2608,6 +2609,7 @@ test.describe("Worktree Integration Tests", () => {
26082609
const featureFilePath = path.join(featuresDir, featureDir!, "feature.json");
26092610
const featureData = JSON.parse(fs.readFileSync(featureFilePath, "utf-8"));
26102611
expect(featureData.branchName).toBe(existingBranch);
2611-
expect(featureData.worktreePath).toBe(existingWorktreePath);
2612+
// worktreePath should not exist in the feature data (worktrees are created at execution time)
2613+
expect(featureData.worktreePath).toBeUndefined();
26122614
});
26132615
});

0 commit comments

Comments
 (0)