You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Python**: `tests/.venv/` (managed by uv/pyproject.toml)
290
+
-**R**: `tests/renv/` + `tests/renv.lock`
291
+
292
+
The `configure-test-env` scripts ONLY manage these main environments. CI builds depend on this structure.
293
+
294
+
**Do NOT create language environment files in test subdirectories:**
295
+
296
+
```
297
+
tests/docs/my-test/
298
+
├── Project.toml # ❌ WRONG - breaks test infrastructure
299
+
├── .venv/ # ❌ WRONG - breaks test infrastructure
300
+
├── renv.lock # ❌ WRONG - breaks test infrastructure
301
+
└── test.qmd
302
+
```
303
+
304
+
**Why this fails:**
305
+
- Julia searches UP for `Project.toml` and uses the first one found
306
+
- Python/R will use local environments if present
307
+
- CI scripts won't configure these local environments
308
+
- Tests will fail in CI even if they work locally
309
+
310
+
**Adding new package dependencies:**
311
+
312
+
For ANY engine (Julia, Python, R), add dependencies to the main `tests/` environment:
313
+
314
+
```bash
315
+
# Julia: Use Pkg from tests/ directory
316
+
cd tests
317
+
julia --project=. -e 'using Pkg; Pkg.add("PackageName")'
318
+
# Then run configure to update environment
319
+
./configure-test-env.sh # or .ps1 on Windows
320
+
321
+
# Python: Use uv from tests/ directory
322
+
cd tests
323
+
uv add packagename
324
+
325
+
# R: Edit tests/DESCRIPTION, then
326
+
cd tests
327
+
Rscript -e "renv::install(); renv::snapshot()"
328
+
```
329
+
330
+
**Note:** While Quarto supports local Project.toml files in document directories for production use, the quarto-cli test infrastructure specifically does NOT support this pattern. All test dependencies must be in the main `tests/` environment.
331
+
238
332
## Best Practices
239
333
240
334
1.**Always clean up**: Use teardown to remove generated files
Copy file name to clipboardExpand all lines: news/changelog-1.9.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,10 @@ All changes included in 1.9:
132
132
133
133
- ([#13748](https://github.com/quarto-dev/quarto-cli/pull/13748)): Fix stdin encoding to UTF-8 on Windows to correctly handle JSON in documents containing non-ASCII characters.
134
134
135
+
### `knitr`
136
+
137
+
- ([#13958](https://github.com/quarto-dev/quarto-cli/issues/13958)): Use max precision for `ojs_define` number like this is the case for `jupyter` or `julia` engine.
138
+
135
139
## Other fixes and improvements
136
140
137
141
- ([#8730](https://github.com/quarto-dev/quarto-cli/issues/8730)): Detect x64 R crashes on Windows ARM and provide helpful error message directing users to install native ARM64 R instead of showing generic "check your R installation" error.
Copy file name to clipboardExpand all lines: tests/README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,20 @@ Julia uses built-in package manager [**Pkg.jl**](https://pkgdocs.julialang.org/v
118
118
119
119
`Project.toml` contains our direct dependency and `Manifest.toml` is the lock file that will be created (`Pkg.resolve()`).
120
120
121
+
**Important:** All test dependencies must be in the main `tests/` environment. Julia searches UP the directory tree for `Project.toml` starting from the document being rendered.
122
+
123
+
**Adding a new package dependency:**
124
+
125
+
```bash
126
+
cd tests
127
+
julia --project=. -e 'using Pkg; Pkg.add("PackageName")'
128
+
./configure-test-env.sh # or .ps1 on Windows
129
+
```
130
+
131
+
**Do NOT create** local `Project.toml` files in test subdirectories (e.g., `tests/docs/*/Project.toml`). Julia will use that environment instead of the main `tests/` environment. The `configure-test-env` scripts only manage the main environment, so tests with local environments will fail in CI even if they work locally.
132
+
133
+
**Note:** This applies to ALL engines (Julia, Python, R). Python and R will also use local `.venv/` or `renv.lock` if present. The quarto-cli test infrastructure uses a single managed environment per language at `tests/`, and CI only configures these main environments.
134
+
121
135
See [documentation](https://pkgdocs.julialang.org/v1/managing-packages/) on how to add, remove, update if you need to tweak the Julia environment.
0 commit comments