mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 21:03:08 +00:00
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.
This commit is contained in:
@@ -3,14 +3,15 @@ import { defineConfig, devices } from "@playwright/test";
|
|||||||
const port = process.env.TEST_PORT || 3007;
|
const port = process.env.TEST_PORT || 3007;
|
||||||
const serverPort = process.env.TEST_SERVER_PORT || 3008;
|
const serverPort = process.env.TEST_SERVER_PORT || 3008;
|
||||||
const reuseServer = process.env.TEST_REUSE_SERVER === "true";
|
const reuseServer = process.env.TEST_REUSE_SERVER === "true";
|
||||||
const mockAgent = process.env.CI === "true" || process.env.AUTOMAKER_MOCK_AGENT === "true";
|
const mockAgent =
|
||||||
|
process.env.CI === "true" || process.env.AUTOMAKER_MOCK_AGENT === "true";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
testDir: "./tests",
|
testDir: "./tests",
|
||||||
fullyParallel: true,
|
fullyParallel: true,
|
||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
retries: process.env.CI ? 2 : 0,
|
retries: process.env.CI ? 2 : 0,
|
||||||
workers: process.env.CI ? 1 : undefined,
|
workers: undefined,
|
||||||
reporter: "html",
|
reporter: "html",
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
use: {
|
use: {
|
||||||
|
|||||||
@@ -2441,9 +2441,9 @@ test.describe("Worktree Integration Tests", () => {
|
|||||||
// Verify worktree was NOT created during editing (worktrees are created at execution time)
|
// Verify worktree was NOT created during editing (worktrees are created at execution time)
|
||||||
expect(fs.existsSync(expectedWorktreePath)).toBe(false);
|
expect(fs.existsSync(expectedWorktreePath)).toBe(false);
|
||||||
|
|
||||||
// Verify the branch was created (if branch creation is part of the autocomplete flow)
|
// Verify branch was NOT created (created at execution time)
|
||||||
const branches = await listBranches(testRepo.path);
|
const branches = await listBranches(testRepo.path);
|
||||||
expect(branches).toContain(newBranchName);
|
expect(branches).not.toContain(newBranchName);
|
||||||
|
|
||||||
// Verify feature was updated with correct branchName only
|
// Verify feature was updated with correct branchName only
|
||||||
// Note: worktreePath is no longer stored - worktrees are created server-side at execution time
|
// Note: worktreePath is no longer stored - worktrees are created server-side at execution time
|
||||||
@@ -2593,7 +2593,8 @@ test.describe("Worktree Integration Tests", () => {
|
|||||||
);
|
);
|
||||||
expect(matchingWorktrees.length).toBe(1);
|
expect(matchingWorktrees.length).toBe(1);
|
||||||
|
|
||||||
// Verify feature was updated with the correct worktreePath
|
// Verify feature was updated with the correct branchName
|
||||||
|
// Note: worktreePath is no longer stored - worktrees are created server-side at execution time
|
||||||
const featuresDir = path.join(testRepo.path, ".automaker", "features");
|
const featuresDir = path.join(testRepo.path, ".automaker", "features");
|
||||||
const featureDirs = fs.readdirSync(featuresDir);
|
const featureDirs = fs.readdirSync(featuresDir);
|
||||||
const featureDir = featureDirs.find((dir) => {
|
const featureDir = featureDirs.find((dir) => {
|
||||||
@@ -2608,6 +2609,7 @@ test.describe("Worktree Integration Tests", () => {
|
|||||||
const featureFilePath = path.join(featuresDir, featureDir!, "feature.json");
|
const featureFilePath = path.join(featuresDir, featureDir!, "feature.json");
|
||||||
const featureData = JSON.parse(fs.readFileSync(featureFilePath, "utf-8"));
|
const featureData = JSON.parse(fs.readFileSync(featureFilePath, "utf-8"));
|
||||||
expect(featureData.branchName).toBe(existingBranch);
|
expect(featureData.branchName).toBe(existingBranch);
|
||||||
expect(featureData.worktreePath).toBe(existingWorktreePath);
|
// worktreePath should not exist in the feature data (worktrees are created at execution time)
|
||||||
|
expect(featureData.worktreePath).toBeUndefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user