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
Copy file name to clipboardExpand all lines: tests/README.md
+103-4Lines changed: 103 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,44 @@ Running tests require to have a local environment setup with Quarto development,
35
35
To help with this configuration, the `tests/` folder contains `configure-test-env.sh` and `configure-test-env.ps1`. It will check for the tools and update the dependencies to what is used by Quarto tests.
36
36
Running the script at least one will insure you are correctly setup. Then, it is run as part of running the tests so that dependencies are always updated. Set `QUARTO_TESTS_NO_CONFIG` to skip this step when running tests.
37
37
38
+
#### Optional test dependencies
39
+
40
+
The configure scripts also check for optional tools that some tests require. Tests will gracefully skip when these tools are not available, but having them installed enables full test coverage:
41
+
42
+
**Java** (version 8, 11, 17, or 21)
43
+
44
+
- Required for: PDF standard validation tests using veraPDF
45
+
- The script will install veraPDF automatically if Java is found using `quarto install verapdf`
46
+
47
+
**Node.js** (version 18 or later) and **npm**
48
+
49
+
- Required for: Playwright integration tests and JATS/MECA validation
50
+
- Installation: Download from https://nodejs.org/ or use a version manager like nvm
51
+
- The script will:
52
+
- Check Node.js version and warn if < 18
53
+
- Install the `meca` package globally for MECA validation
54
+
- Install Playwright and its dependencies
55
+
- Set up the multiplex server for Playwright tests
#### Prevent configuration for dependencies (R, Julia, Python, ...)
143
+
#### Test environment variables
144
+
145
+
The test scripts support several environment variables to control their behavior:
106
146
107
-
Those files will run `configure-test-env` scripts to check for requirements and set up dependencies (except on Github Action as this is done in the workflow file directly).
108
-
You can prevent test configuration locally by setting `QUARTO_TESTS_NO_CONFIG` environment variable to a non-empty value.
147
+
**QUARTO_TESTS_NO_CONFIG**
148
+
- Skip running `configure-test-env` scripts
149
+
- Useful for faster test runs when environment is already configured
- Tests will use system Python packages instead of UV-managed dependencies
164
+
- Use with caution: Python tests may fail if dependencies aren't in system Python
165
+
166
+
```bash
167
+
QUARTO_TESTS_FORCE_NO_VENV="true" ./run-tests.sh
168
+
```
169
+
170
+
```powershell
171
+
$env:QUARTO_TESTS_FORCE_NO_VENV="true"
116
172
./run-tests.ps1
117
173
```
118
174
175
+
**Quick test runs with run-fast-tests scripts**
176
+
177
+
For convenience, `run-fast-tests.sh` and `run-fast-tests.ps1` are provided to skip environment configuration:
178
+
179
+
```bash
180
+
# Linux/macOS
181
+
./run-fast-tests.sh
182
+
183
+
# Windows
184
+
./run-fast-tests.ps1
185
+
```
186
+
187
+
These scripts set `QUARTO_TESTS_NO_CONFIG` automatically. Use after running `configure-test-env` at least once.
188
+
189
+
**QUARTO_TEST_KEEP_OUTPUTS** (or use `--keep-outputs`/`-k` flag)
190
+
- Keep test output artifacts instead of cleaning them up
191
+
- Useful for debugging test failures or inspecting generated files
192
+
- Can be set via environment variable or command-line flag
193
+
194
+
```bash
195
+
# Using flag
196
+
./run-tests.sh --keep-outputs
197
+
./run-tests.sh -k
198
+
199
+
# Using environment variable
200
+
QUARTO_TEST_KEEP_OUTPUTS="true" ./run-tests.sh
201
+
```
202
+
203
+
```powershell
204
+
# Using flag
205
+
./run-tests.ps1 --keep-outputs
206
+
./run-tests.ps1 -k
207
+
208
+
# Using environment variable
209
+
$env:QUARTO_TEST_KEEP_OUTPUTS="true"
210
+
./run-tests.ps1
211
+
```
212
+
213
+
**Other environment variables**
214
+
-`QUARTO_TEST_VERBOSE` - Enable verbose test output
215
+
-`QUARTO_TESTS_NO_CHECK` - Not currently used (legacy variable)
216
+
119
217
#### About smoke-all tests
120
218
121
219
`docs/smoke-all/` is a specific folder to run some tests written directly within `.qmd`, `.md` or `.ipynb` files (but files starting with `_` will be ignored). They are run through the `smoke/smoke-all.tests.ts` script. To ease running smoke-all tests, `run-tests.sh` has a special behavior where it will run `./smoke/smoke-all.tests.ts` when passed a `.qmd`, `.md` or `.ipynb` file, not starting with `_`.
@@ -284,6 +382,7 @@ _quarto:
284
382
The snapshot file should be saved alongside the output with a `.snapshot` extension (e.g., `output.html.snapshot`).
285
383
286
384
When a snapshot test fails:
385
+
287
386
- A **unified diff** is displayed with colored output (red for removed, green for added)
288
387
- A **word-level diff** shows changes with surrounding context
289
388
- For **whitespace-only changes**, special markers visualize invisible characters:
0 commit comments