Skip to content

Commit c2db169

Browse files
committed
test: increase timeout for imageTag priority tests to 30s
1 parent aa5c141 commit c2db169

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cli/test/init.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ describe("CLI commands", () => {
792792
describe("imageTag priority behavior", () => {
793793
// Tests for the imageTag priority: --tag flag > PGAI_TAG env var > pkg.version
794794
// This verifies the fix that prevents stale .env PGAI_TAG from being used
795+
// These tests spawn subprocesses so need longer timeout
795796

796797
let tempDir: string;
797798

@@ -828,7 +829,7 @@ describe("imageTag priority behavior", () => {
828829
expect(envContent).not.toMatch(/PGAI_TAG=beta/);
829830
// It should contain the CLI version (0.0.0-dev.0 in dev)
830831
expect(envContent).toMatch(/PGAI_TAG=\d+\.\d+\.\d+|PGAI_TAG=0\.0\.0-dev/);
831-
});
832+
}, 30000);
832833

833834
test("--tag flag takes priority over pkg.version", () => {
834835
const testDir = resolve(tempDir, "tag-flag-test");
@@ -848,7 +849,7 @@ describe("imageTag priority behavior", () => {
848849
// Verify stdout confirms the tag being used
849850
const stdout = new TextDecoder().decode(result.stdout);
850851
expect(stdout).toMatch(/Using image tag: v1\.2\.3-custom/);
851-
});
852+
}, 30000);
852853

853854
test("PGAI_TAG env var is intentionally ignored (Bun auto-loads .env)", () => {
854855
// Note: We do NOT use process.env.PGAI_TAG because Bun auto-loads .env files,
@@ -869,7 +870,7 @@ describe("imageTag priority behavior", () => {
869870
// PGAI_TAG env var should be IGNORED - uses pkg.version instead
870871
expect(envContent).not.toMatch(/PGAI_TAG=v2\.0\.0-from-env/);
871872
expect(envContent).toMatch(/PGAI_TAG=\d+\.\d+\.\d+|PGAI_TAG=0\.0\.0-dev/);
872-
});
873+
}, 30000);
873874

874875
test("existing registry and password are preserved while tag is updated", () => {
875876
const testDir = resolve(tempDir, "preserve-test");
@@ -894,5 +895,5 @@ describe("imageTag priority behavior", () => {
894895
// But registry and password should be preserved
895896
expect(envContent).toMatch(/PGAI_REGISTRY=my\.registry\.com/);
896897
expect(envContent).toMatch(/GF_SECURITY_ADMIN_PASSWORD=secret123/);
897-
});
898+
}, 30000);
898899
});

0 commit comments

Comments
 (0)