quarto-dev / quarto-dev/quarto-cli

Scheduled smoke tests always fail due to env var pollution from editor-support crossref test

Open
#14,218 0 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Mar 16, 2026.

maintenance
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

The weekly scheduled run of test-smokes.yml (sequential mode, no buckets) has been failing consistently for 3+ months — every single run fails with the same 36 tests. Meanwhile, the parallel bucketed runs (test-smokes-parallel.yml) pass 100%.

Recent examples:

Root cause

In sequential mode, all smoke-all tests run in the same Deno process. The editor-support-crossref test for tests/docs/smoke-all/2023/10/17/issue-7259.qmd triggers src/command/editor-support/crossref.ts, which sets a process-wide environment variable that is never cleared:

https://github.com/quarto-dev/quarto-cli/blob/5b88d3dfe1519179e2e8753c44e058a11ab62ff3/src/command/editor-support/crossref.ts#L91-L92

Once QUARTO_CROSSREF_INPUT_TYPE=qmd persists in the environment, the Lua crossref filter's isQmdInput() returns true for all subsequent renders. This causes writeKeysIndex() to run instead of writeFullIndex(), producing crossref index files without a headings field. Book post-render then crashes at book-crossrefs.ts:263 with:

TypeError: Cannot read properties of undefined (reading 'forEach')

In parallel mode, each bucket runs on a separate GitHub Actions runner (separate VM), so the env var pollution cannot cross bucket boundaries.

Failing tests (36 total, identical on Ubuntu and Windows)

All book-type project tests that run after issue-7259.qmd in alphabetical order:

  • docs/smoke-all/2024/02/01/issue-8514/ (book)
  • docs/smoke-all/2024/02/22/8814/ (book)
  • docs/smoke-all/2024/12/12/11520/ (book)
  • docs/smoke-all/2025/12/10/13769/ (book)
  • docs/smoke-all/2026/02/24/issue-12136/ (book)
  • docs/smoke-all/book/page-footer/ (book)
  • docs/smoke-all/book/simple/ (book)
  • docs/smoke-all/brand/logo/*-book/ (book)
  • Plus a few listing and engine class-override tests (likely related shared state issues)

Related

#12621 addresses the broader Deno.env.set cleanup (milestoned for v1.10). A targeted fix for this specific leak could unblock the scheduled CI sooner — either clearing the env var after use in editor-support/crossref.ts, or making book-crossrefs.ts:263 defensive against missing headings.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.