Skip to content

test: committable mini .note fixture so Note→HTML smoke assertions actually run in CI #100

@kiki830621

Description

@kiki830621

Problem

Surfaced via PR #93 verify (#93 verify report — Codex + Devil's Advocate findings, 2026-05-25)

NoteHTMLConvertTests.testNoteToHTMLSmoke() now asserts media/ directory contents + a 750 KB index.html size floor (PR #93, refs #86) — but those assertions do not actually run in clean clone / GitHub Actions CI:

  1. test-files/ is .gitignored (.gitignore:103) — no .note fixture ships with the repo
  2. CLITestHelper.noteFixture() (Tests/MacDocCLITests/CLITestHelper.swift:75-113) returns XCTSkip when no .note is found
  3. CI therefore silently passes the test via skip, and the strengthened assertions never fire against real renderer output

The original motivation of #86 (catch byte-minimal HTML stub regressions) is only protected on the maintainer's local machine where the 33 MB fixture 筆記 2026-03-20 15_25_20.note exists.

Type

enhancement (test infrastructure)

Priority

P2 — silent CI skip is a known gap, not blocking, but defeats the regression detection that motivated #86

Expected

A small committable .note fixture (target < 100 KB) that:

  • Lives under Tests/MacDocCLITests/Fixtures/ (or similar in-tree path) so it ships with the repo
  • Contains at least 1 stroke (for index.html JSON content), 1 image (for media/ assets), and ideally 1 short audio recording (for media/ audio assets)
  • Lets testNoteToHTMLSmoke() actually exercise the strengthened assertions in CI
  • Rebaselines the 750 KB index.html size floor to match the new fixture's reference render

CLITestHelper.noteFixture() should then prefer the committed fixture over the .gitignore'd fallback, falling back to local user fixtures only when explicitly requested.

Strategy

  • Author / craft a minimal .note fixture
    • Option A: Use Apple Notes / Notebook app to create a real note with 1 stroke + 1 image + 1 audio (smallest plausible content)
    • Option B: Craft the .note ZIP structure programmatically — possibly via a one-off Swift test helper that constructs a ProtoBuf payload (heavier engineering)
  • Commit fixture to in-tree path (Tests/MacDocCLITests/Fixtures/minimal.note or similar)
  • Update CLITestHelper.noteFixture() to prefer in-tree fixture
  • Update NoteHTMLConvertTests 750 KB floor to a new floor calibrated against the in-tree fixture's reference render
  • Update NotePDFConvertTests if it also depends on the same fixture
  • Verify CI actually exercises the strengthened assertions (not just XCTSkip)

Related

Acceptance

CI logs show testNoteToHTMLSmoke actually running (no XCTSkip) and asserting media/ + 750 KB (or rebaselined) floor against a real fixture render.

Current Status

Phase: verified
Last updated: 2026-05-25 by /idd-diagnose

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions