Skip to content

Commit f72b590

Browse files
committed
Try a test that fails with the locking issue.
1 parent 25bdae6 commit f72b590

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
**/*.quarto_ipynb
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: "Test Output Dir"
3+
format: html
4+
---
5+
6+
This is a simple document to test rendering with --output-dir flag.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* render-output-dir.test.ts
3+
*
4+
* Test for Windows file locking issue with --output-dir flag
5+
* Regression test for: https://github.com/quarto-dev/quarto-cli/issues/XXXXX
6+
*
7+
* Copyright (C) 2020-2025 Posit Software, PBC
8+
*
9+
*/
10+
import { dirname, join } from "../../../src/deno_ral/path.ts";
11+
import { existsSync, safeRemoveSync } from "../../../src/deno_ral/fs.ts";
12+
import { docs } from "../../utils.ts";
13+
import { isWindows } from "../../../src/deno_ral/platform.ts";
14+
import { pathDoNotExists } from "../../verify.ts";
15+
import { testRender } from "./render.ts";
16+
17+
if (isWindows) {
18+
const inputDir = docs("render-output-dir/");
19+
const quartoDir = ".quarto"
20+
const outputDir = "output-test-dir"
21+
22+
testRender(
23+
"test.qmd",
24+
"html",
25+
true,
26+
[pathDoNotExists(quartoDir)],
27+
{
28+
cwd: () => inputDir,
29+
setup: async () => {
30+
// Ensure output and quarto dirs are removed before test
31+
if (existsSync(outputDir)) {
32+
safeRemoveSync(outputDir, { recursive: true });
33+
}
34+
if (existsSync(quartoDir)) {
35+
safeRemoveSync(quartoDir, { recursive: true });
36+
}
37+
},
38+
teardown: async () => {
39+
if (existsSync(outputDir)) {
40+
safeRemoveSync(outputDir, { recursive: true });
41+
}
42+
if (existsSync(quartoDir)) {
43+
safeRemoveSync(quartoDir, { recursive: true });
44+
}
45+
},
46+
},
47+
["--output-dir", outputDir],
48+
outputDir,
49+
);
50+
}

0 commit comments

Comments
 (0)