Skip to content

Add integration fixtures for common LaTeX scenarios #10

Closed

Description

@nishide-dev

背景

texrun は subprocess、TeX Live、ログ解析、artifact 生成が絡むため、unit test だけでは回帰を十分に検出できない。

小さな TeX fixture をリポジトリに保持し、integration test で end-to-end に確認する。

初期 fixture 候補

tests/fixtures/
├── minimal/
├── syntax-error/
├── undefined-command/
├── missing-package/
├── references/
├── overfull-box/
└── timeout/

作業内容

  • minimal article が成功する fixture
  • compile error fixture
  • undefined command fixture
  • missing package fixture
  • multi-file(\input / \include、サブディレクトリ)fixture — file 情報の抽出と workspace コピーの確認
  • reference/citation warning fixture
  • overfull box fixture
  • timeout / pathological input の安全な fixture(例: \def\x{\x}\x の無限ループ。短い timeout を指定して実行時間を抑える)
  • security fixture: \write18 / \immediate\write18、\input{/etc/passwd}、latexmkrc 同梱、root 外 symlink(Add execution limits and define the sandbox boundary #9 の保証範囲を検証)
  • artifact の existence / metadata を確認する test
  • diagnostic parser と integration test を接続する

テスト設計

TeX distribution の minor difference で壊れすぎないように、ログ全文の snapshot 完全一致には依存しすぎない。

構造化した結果に対して検証する(例: 「kind = undefined_control_sequence かつ line = 5 の diagnostic が含まれる」)。

TeX Live が無い環境でも cargo test --workspace が通るようにする。案:

  • integration test を #[ignore] にし、CI の integration job では --ignored(nextest なら filter)で実行する
  • または環境変数(例: TEXRUN_TEST_TEXLIVE=1)/ cargo feature で有効化する

いずれにせよ「latexmk が無いので skip した」ことが CI で黙って成功扱いにならないよう、integration job では latexmk 不在を失敗にする。

references fixture は bibtex を使い、biber への依存は避ける(最小 TeX Live 構成に含まれないことが多いため)。

完了条件

主要な compile success/failure path を fixture で再現でき、engine や diagnostic parser の変更による回帰を CI で検知できる

依存

Activity

  1. added this to the MVP milestone on Sep 30, 2026
  2. added
    enhancement
    on Sep 30, 2026
  3. nishide-dev commented on Sep 30, 2026

    @nishide-dev
    OwnerAuthor

    PR #30(#5)からの申し送り:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions