Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8dd9762
[backport] Fix Windows paths with accented characters breaking dart-s…
cderv Mar 27, 2026
c829202
[backport] Fix transient .quarto_ipynb files accumulating during prev…
cderv Mar 31, 2026
f2b075f
Add missing lua-types declarations for public Lua API (#14295)
cderv Apr 1, 2026
e8126a5
Update remaining GitHub Actions for Node.js 24 compatibility (#14294)
cderv Apr 1, 2026
448eea6
[backport] Fix preview browse URL for single-file documents (#14301)
cderv Apr 3, 2026
5f5993c
Fix skill about preview testing
cderv Apr 3, 2026
da25f51
Add changelog entry for Typst margin layout (#13879)
gordonwoodhull Apr 7, 2026
cff3319
[backport] Fix quarto inspect standalone file project emission for RS…
cderv Apr 7, 2026
9db6863
[backport] Add arm64 Linux support for chrome-headless-shell and depr…
cderv Apr 9, 2026
35a1f14
Update version.txt
github-actions[bot] Apr 9, 2026
01754ec
[release checklist] Move release items
cderv Apr 9, 2026
e541ca7
[backport] Fix tinytex install silently ignoring extraction failures …
cderv Apr 15, 2026
8b184cb
[backport] Fix Dart Sass failing in enterprise Windows with Group Pol…
cderv Apr 16, 2026
f26f7f6
[backport] Bump julia-actions/cache to v3 (#14412)
cderv Apr 22, 2026
a8748c3
[backport] Cache Deno development cache in CI (#14452)
cderv Apr 28, 2026
89ff73c
[backport] fix(preview): restore --output-dir for single-file preview…
cderv May 6, 2026
b4c00ec
[backport] Fix dart-sass failure on Windows usernames containing ampe…
cderv May 22, 2026
4df84fd
Update version.txt
github-actions[bot] May 25, 2026
86d05a5
Revert version.txt update (4df84fd841dbfa1a66e22ac4592b8122c5c7cb83)
cderv May 25, 2026
6ebb5db
Update version.txt
github-actions[bot] May 25, 2026
778425b
Support fully offline builds from a pre-populated deno cache
eejd Jul 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 143 additions & 0 deletions .claude/commands/quarto-preview-test/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
name: quarto-preview-test
description: Use when testing preview functionality, verifying live reload, or validating preview fixes. Covers starting preview with port/logging, browser verification via /agent-browser, and checking logs/filesystem for artifacts.
---

# Quarto Preview Test

Interactive testing of `quarto preview` with automated browser verification.

## Tools

| Tool | When to use |
|------|-------------|
| `/agent-browser` | **Preferred.** Token-efficient browser automation. Navigate, verify content, screenshot. |
| Chrome DevTools MCP | Deep debugging: console messages, network requests, DOM inspection. |
| `jq` / `grep` | Parse debug log output. |

## Prerequisites

- Quarto dev version built (`./configure.sh` or `./configure.cmd`)
- Test environment configured (`tests/configure-test-env.sh` or `tests/configure-test-env.ps1`)
- `/agent-browser` CLI installed (preferred), OR Chrome + Chrome DevTools MCP connected

## Starting Preview

Preview needs the test venv for Jupyter tests. Activate it first (`tests/.venv`), matching how `run-tests.sh` / `run-tests.ps1` do it.

```bash
# Linux/macOS
source tests/.venv/bin/activate
./package/dist/bin/quarto preview <file-or-dir> --no-browser --port 4444

# Windows (Git Bash)
source tests/.venv/Scripts/activate
./package/dist/bin/quarto.cmd preview <file-or-dir> --no-browser --port 4444
```

Use `--no-browser` to control browser connection. Use `--port` for a predictable URL.

### With debug logging

```bash
./package/dist/bin/quarto preview <file> --no-browser --port 4444 --log-level debug 2>&1 | tee preview.log
```

### In background

```bash
# Linux/macOS (after venv activation)
./package/dist/bin/quarto preview <file> --no-browser --port 4444 &
PREVIEW_PID=$!
# ... run verification ...
kill $PREVIEW_PID

# Windows (Git Bash, after venv activation)
./package/dist/bin/quarto.cmd preview <file> --no-browser --port 4444 &
PREVIEW_PID=$!
# ... run verification ...
kill $PREVIEW_PID
```

## Edit-Verify Cycle

The core test pattern:

1. Start preview with `--no-browser --port 4444`
2. Use `/agent-browser` to navigate to `http://localhost:4444/` and verify content
3. Edit source file, wait 3-5 seconds for re-render
4. Verify content updated in browser
5. Check filesystem for unexpected artifacts
6. Stop preview, verify cleanup

## What to Verify

**In browser** (via `/agent-browser`): Page loads, content matches source, updates reflect edits.

**In terminal/logs**: No `BadResource` errors, no crashes, preview stays responsive.

**On filesystem**: No orphaned temp files, cleanup happens on exit.

## Windows Limitations

On Windows, `kill` from Git Bash does not trigger Quarto's `onCleanup` handler (SIGINT doesn't propagate to Windows processes the same way). Cleanup-on-exit verification requires an interactive terminal with Ctrl+C. For automated testing, verify artifacts *during* preview instead.

## Context Types

Preview behaves differently depending on input:

| Input | Code path |
|-------|-----------|
| Single file (no project) | `preview()` -> `renderForPreview()` |
| File within a project | May redirect to project preview via `serveProject()` |
| Project directory | `serveProject()` -> `watchProject()` |

## When NOT to Use

- Automated smoke tests — use `tests/smoke/` instead
- Testing render output only (no live preview needed) — use `quarto render`
- CI environments without browser access

## Test Matrix

The full test matrix lives in `tests/docs/manual/preview/README.md`. Test fixtures live alongside it in `tests/docs/manual/preview/`.

### Running specific tests by ID

When invoked with test IDs (e.g., `/quarto-preview-test T17 T18`):

1. Read `tests/docs/manual/preview/README.md`
2. Find each requested test by its ID (e.g., `#### T17:`)
3. Parse the **Setup**, **Steps**, and **Expected** fields
4. Execute each test following the steps, using the fixtures in `tests/docs/manual/preview/`
5. Report PASS/FAIL for each test with the actual vs expected result

### Running tests by topic

When invoked with a topic description instead of IDs (e.g., `/quarto-preview-test root URL` or "run preview tests for single-file"):

1. Read `tests/docs/manual/preview/README.md`
2. Search test titles and descriptions for matches (keywords, issue numbers, feature area)
3. Present the matched tests to the user for confirmation before running:
```
Found these matching tests:
- T17: Single-file preview — root URL accessible (#14298)
- T18: Single-file preview — named output URL also accessible
Run these? [Y/n]
```
4. Only execute after user confirms

### Running without arguments

When invoked without test IDs or topic (e.g., `/quarto-preview-test`), use the general Edit-Verify Cycle workflow described above for ad-hoc preview testing. The test matrix is for targeted regression testing.

## Baseline Comparison

Compare dev build against installed release to distinguish regressions:

```bash
quarto --version # installed
./package/dist/bin/quarto --version # dev
```

If both show the same issue, it's pre-existing.
12 changes: 12 additions & 0 deletions .github/workflows/actions/quarto-dev/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,28 @@ runs:
restore-keys: |
${{ runner.os }}-cargo-typst-gather-

- name: Cache Deno development cache
uses: actions/cache@v5
with:
path: ./package/dist/bin/deno_cache
key: ${{ runner.os }}-${{ runner.arch }}-deno-cache-v1-${{ hashFiles('configuration', 'src/import_map.json', 'src/vendor_deps.ts', 'tests/test-deps.ts', 'package/scripts/deno_std/deno_std.ts') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-deno-cache-v1-

- name: Configure Quarto (.sh)
if: runner.os != 'Windows'
shell: bash
env:
QUARTO_SKIP_DENO_CACHE_WIPE: "1"
run: |
# install with symlink in /usr/local/bin which in PATH on CI
./configure.sh

- name: Configure Quarto (.ps1)
if: runner.os == 'Windows'
shell: pwsh
env:
QUARTO_SKIP_DENO_CACHE_WIPE: "1"
run: |
./configure.cmd
"$(Get-ChildItem -Path ./package/dist/bin/quarto.cmd | %{ $_.FullName } | Split-Path)" >> $env:GITHUB_PATH
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
run: |
echo ${{ steps.read-version.outputs.version_full }} > version.txt

- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5
- uses: EndBug/add-and-commit@290ea2c423ad77ca9c62ae0f5b224379612c0321
if: ${{ inputs.publish-release }}
id: version_commit
with:
Expand Down Expand Up @@ -677,9 +677,7 @@ jobs:

- name: Create Release
id: create_release
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe
with:
tag_name: ${{needs.configure.outputs.tag_name}}
target_commitish: ${{ needs.configure.outputs.version_commit }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-ff-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:
- ".github/workflows/stale-needs-repro.yml"
- ".github/workflows/test-bundle.yml"
- ".github/workflows/test-smokes-parallel.yml"
- ".github/workflows/test-install.yml"
- ".github/workflows/test-quarto-latexmk.yml"
- ".github/workflows/update-test-timing.yml"
pull_request:
Expand All @@ -31,6 +32,7 @@ on:
- ".github/workflows/performance-check.yml"
- ".github/workflows/stale-needs-repro.yml"
- ".github/workflows/test-bundle.yml"
- ".github/workflows/test-install.yml"
- ".github/workflows/test-smokes-parallel.yml"
- ".github/workflows/test-quarto-latexmk.yml"
- ".github/workflows/update-test-timing.yml"
Expand Down
134 changes: 134 additions & 0 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Integration test for `quarto install` on platforms not covered by smoke tests.
# Smoke tests (test-smokes.yml) cover x86_64 Linux and Windows.
# This workflow fills the gap for arm64 Linux and macOS.
name: Test Tool Install
on:
workflow_dispatch:
push:
branches:
- main
- "v1.*"
paths:
- "src/tools/**"
- ".github/workflows/test-install.yml"
pull_request:
paths:
- "src/tools/**"
- ".github/workflows/test-install.yml"
schedule:
# Weekly Monday 9am UTC — detect upstream CDN/API breakage
- cron: "0 9 * * 1"

permissions:
contents: read

jobs:
test-install:
name: Install tools (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04-arm, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v6

- uses: ./.github/workflows/actions/quarto-dev

- name: Install TinyTeX
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
quarto install tinytex

- name: Install Chrome Headless Shell
run: |
quarto install chrome-headless-shell --no-prompt

- name: Verify tools with quarto check
run: |
quarto check install

test-chromium-deprecation:
name: Chromium deprecation warning (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v6

- uses: ./.github/workflows/actions/quarto-dev

- name: Make quarto available in bash (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
quarto_cmd=$(command -v quarto.cmd)
dir=$(dirname "$quarto_cmd")
printf '#!/bin/bash\nexec "%s" "$@"\n' "$quarto_cmd" > "$dir/quarto"
chmod +x "$dir/quarto"

- name: Install chromium and capture result
id: install-chromium
shell: bash
run: |
set +e
output=$(quarto install chromium --no-prompt 2>&1)
exit_code=$?
set -e
echo "$output"
if echo "$output" | grep -Fq "is deprecated"; then
echo "deprecation-warning=true" >> "$GITHUB_OUTPUT"
fi
if [ "$exit_code" -eq 0 ]; then
echo "chromium-installed=true" >> "$GITHUB_OUTPUT"
fi

- name: Assert install deprecation warning was shown
shell: bash
run: |
if [ "${{ steps.install-chromium.outputs.deprecation-warning }}" != "true" ]; then
echo "::error::Deprecation warning missing from quarto install chromium output"
exit 1
fi
echo "Install deprecation warning found"

- name: Update chromium and capture result
id: update-chromium
shell: bash
run: |
set +e
output=$(quarto update chromium --no-prompt 2>&1)
set -e
echo "$output"
if echo "$output" | grep -Fq "is deprecated"; then
echo "deprecation-warning=true" >> "$GITHUB_OUTPUT"
fi

- name: Assert update deprecation warning was shown
shell: bash
run: |
if [ "${{ steps.update-chromium.outputs.deprecation-warning }}" != "true" ]; then
echo "::error::Deprecation warning missing from quarto update chromium output"
exit 1
fi
echo "Update deprecation warning found"

- name: Verify quarto check warns about outdated Chromium
shell: bash
run: |
if [ "${{ steps.install-chromium.outputs.chromium-installed }}" != "true" ]; then
echo "Chromium install did not succeed on this platform, skipping check"
exit 0
fi
output=$(quarto check install 2>&1)
echo "$output"
if ! echo "$output" | grep -Fq "Chromium is outdated"; then
echo "::error::Outdated Chromium warning missing from quarto check"
exit 1
fi
echo "Outdated Chromium warning found in quarto check"
1 change: 1 addition & 0 deletions .github/workflows/test-smokes-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
- ".github/workflows/stale-needs-repro.yml"
- ".github/workflows/test-bundle.yml"
- ".github/workflows/test-ff-matrix.yml"
- ".github/workflows/test-install.yml"
- ".github/workflows/test-quarto-latexmk.yml"
- ".github/workflows/update-test-timing.yml"
push:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-smokes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ jobs:
quarto install chrome-headless-shell --no-prompt

- name: Setup Julia
uses: julia-actions/setup-julia@v2
uses: julia-actions/setup-julia@a8c65a2a580b6a5cf30070e825e62f9fc0fee1d7
id: setup-julia
with:
version: "1.11.7"

- name: Load Julia packages from cache
uses: julia-actions/cache@v2
uses: julia-actions/cache@v3
with:
cache-name: julia-cache;workflow=${{ github.workflow }};job=${{ github.job }};julia=${{ steps.setup-julia.outputs.julia-version }}

Expand Down
Loading