feat(FN-5518): merge fusion/fn-5518
This commit is contained in:
@@ -12,7 +12,8 @@ function git(repo: string, command: string): string {
|
|||||||
return execSync(command, { cwd: repo, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
return execSync(command, { cwd: repo, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
describeIfGit("merger auto-prerebase real-git scenarios", () => {
|
// FN-5518 (FN-4807 pattern): real-git rebase scenarios exceed Vitest's 5s default under workspace pnpm test contention; bound but raise the per-test deadline without weakening subprocess guards.
|
||||||
|
describeIfGit("merger auto-prerebase real-git scenarios", { timeout: 30_000 }, () => {
|
||||||
const dirs: string[] = [];
|
const dirs: string[] = [];
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
for (const dir of dirs.splice(0)) rmSync(dir, { recursive: true, force: true });
|
for (const dir of dirs.splice(0)) rmSync(dir, { recursive: true, force: true });
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ function createRepoWithFeatureCommit() {
|
|||||||
return { dir, baseSha, mainTipSha, auditSha };
|
return { dir, baseSha, mainTipSha, auditSha };
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("resolvePostMergeAuditInvocation", () => {
|
// FN-5518 (FN-4807 pattern): rangebase resolution drives real-git rev-parse / merge-base ceremony; bound but lift the per-test deadline above Vitest's 5s default to absorb pnpm test contention without weakening subprocess guards.
|
||||||
|
describe("resolvePostMergeAuditInvocation", { timeout: 30_000 }, () => {
|
||||||
const cleanup: string[] = [];
|
const cleanup: string[] = [];
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
for (const dir of cleanup.splice(0)) rmSync(dir, { recursive: true, force: true });
|
for (const dir of cleanup.splice(0)) rmSync(dir, { recursive: true, force: true });
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ function makeUnprovenDoneTask(taskId: string): Task {
|
|||||||
} as Task;
|
} as Task;
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("FN-4811 follow-up: integrity warning dedup persists across restarts", () => {
|
// FN-5518 (FN-4807 pattern): the file header already documents this is real-git wallclock under parallel CI load (FN-4839); lift the per-test deadline above Vitest's 5s default rather than weakening or removing the real-git regression backstop.
|
||||||
|
describe("FN-4811 follow-up: integrity warning dedup persists across restarts", { timeout: 30_000 }, () => {
|
||||||
it("emits the unproven warning once, persists it on mergeDetails.integrityWarning", async () => {
|
it("emits the unproven warning once, persists it on mergeDetails.integrityWarning", async () => {
|
||||||
const dir = mkdtempSync(join(tmpdir(), "fn-4811-dedup-first-"));
|
const dir = mkdtempSync(join(tmpdir(), "fn-4811-dedup-first-"));
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -899,11 +899,7 @@ export function packageNamesForFiles(rootDir: string, files: string[]): string[]
|
|||||||
*
|
*
|
||||||
* @internal Exported for testing only.
|
* @internal Exported for testing only.
|
||||||
*/
|
*/
|
||||||
export function deriveScopedPnpmTestCommand(
|
export function deriveScopedPnpmTestCommand(rootDir: string, baseBranch: string): string | null {
|
||||||
rootDir: string,
|
|
||||||
baseBranch: string,
|
|
||||||
branch: string,
|
|
||||||
): string | null {
|
|
||||||
// 1. Read and parse pnpm-workspace.yaml
|
// 1. Read and parse pnpm-workspace.yaml
|
||||||
const workspacePath = join(rootDir, "pnpm-workspace.yaml");
|
const workspacePath = join(rootDir, "pnpm-workspace.yaml");
|
||||||
let workspaceContent: string;
|
let workspaceContent: string;
|
||||||
@@ -992,7 +988,7 @@ export function inferDefaultTestCommand(
|
|||||||
if (existsSync(join(rootDir, "pnpm-workspace.yaml"))) {
|
if (existsSync(join(rootDir, "pnpm-workspace.yaml"))) {
|
||||||
if (baseBranch?.trim() && branch?.trim()) {
|
if (baseBranch?.trim() && branch?.trim()) {
|
||||||
try {
|
try {
|
||||||
const scoped = deriveScopedPnpmTestCommand(rootDir, baseBranch.trim(), branch.trim());
|
const scoped = deriveScopedPnpmTestCommand(rootDir, baseBranch.trim());
|
||||||
if (scoped) {
|
if (scoped) {
|
||||||
mergerLog.log(
|
mergerLog.log(
|
||||||
`Scoped inferred test command to changed packages: ${scoped}`,
|
`Scoped inferred test command to changed packages: ${scoped}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user