Skip to content

Commit 0eb7093

Browse files
committed
Scope the #14683 renv-activation note to the one file that needs it
tests/unit/CLAUDE.md would have loaded for every file touched under tests/unit/, but the renv-activation workaround only matters for preview-subdir-knitr-cwd.test.ts. Move it to .claude/rules/testing/ with paths frontmatter scoped to that single file, matching how the other testing rules (smoke-all-tests.md, playwright-tests.md) are scoped.
1 parent d0c3e16 commit 0eb7093

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# tests/unit — notes for AI-assisted debugging
1+
---
2+
paths:
3+
- "tests/unit/preview-subdir-knitr-cwd.test.ts"
4+
---
25

3-
## `preview-subdir-knitr-cwd.test.ts` — forced renv activation
6+
# `preview-subdir-knitr-cwd.test.ts` — forced renv activation
47

5-
This test's first case (`preview of a knitr subdir doc from that subdir's cwd
8+
The first test case (`preview of a knitr subdir doc from that subdir's cwd
69
renders (#14683)`) writes a `.Rprofile` into its scratch project directory
710
during `setup()`. If this test starts failing on CI with an R error like:
811

@@ -14,7 +17,7 @@ read this before touching product code (`src/execute/rmd.ts`,
1417
`src/execute/engine.ts`) — it is very likely this workaround, not a
1518
regression in Quarto itself.
1619

17-
### Why it's there
20+
## Why it's there
1821

1922
The test reproduces quarto-dev/quarto-cli#14683, which only manifests when
2023
the process's working directory is the *document's subdirectory* (not the
@@ -46,7 +49,7 @@ This never showed up locally because a typical dev machine (e.g. an R
4649
install managed by `rig`) has rmarkdown/knitr in a library that's on
4750
`.libPaths()` regardless of renv activation.
4851

49-
### The fix
52+
## The fix
5053

5154
`setup()` writes a `.Rprofile` into the scratch project dir (`e2eProjDir` —
5255
the directory `callR` actually spawns Rscript in for a non-single-file
@@ -64,7 +67,7 @@ project and library, regardless of the fixture's own cwd. The absolute path
6467
is derived from `import.meta.url` (this test file's own location), not an
6568
env var, so it's self-contained.
6669

67-
### If this breaks again
70+
## If this breaks again
6871

6972
- Confirm the theory by reading the raw Rscript stderr in the CI log for
7073
this test (search the job log for `preview-subdir-knitr-cwd`) — a missing

0 commit comments

Comments
 (0)