Skip to content

test(engine): add ffprobe-unavailable fallback regression tests#379

Open
vanceingalls wants to merge 1 commit intovance/shader-midpoint-testsfrom
vance/ffprobe-fallback-tests
Open

test(engine): add ffprobe-unavailable fallback regression tests#379
vanceingalls wants to merge 1 commit intovance/shader-midpoint-testsfrom
vance/ffprobe-fallback-tests

Conversation

@vanceingalls
Copy link
Copy Markdown
Collaborator

@vanceingalls vanceingalls commented Apr 21, 2026

Summary

Mock node:child_process.spawn to surface ENOENT and verify ffprobe's three callers behave correctly when ffprobe is missing.

Why

Chunk 9B of plans/hdr-followups.md. The PNG cICP fallback in extractMediaMetadata was added to support environments without ffprobe, but no test pinned the behavior — silently regressing it would break HDR image support on any system without ffprobe installed.

What changed

packages/engine/src/utils/ffprobe.test.ts: mocks child_process.spawn to surface ENOENT and asserts:

  • extractMediaMetadata falls back to PNG cICP metadata for image inputs.
  • extractMediaMetadata rethrows for non-image inputs lacking a still-image fallback.
  • extractAudioMetadata + analyzeKeyframeIntervals propagate the install-hint error verbatim.

Test plan

  • All new tests pass.
  • No production code changes — pure regression coverage of existing fallback behavior.

Stack

Chunk 9B of plans/hdr-followups.md. Test-only change, independent of all other chunks.

Copy link
Copy Markdown
Collaborator Author

vanceingalls commented Apr 21, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch 2 times, most recently from c1d8c12 to 1f9a361 Compare April 22, 2026 22:50
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from de75bbd to 817ab68 Compare April 22, 2026 22:51
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 1f9a361 to f6c9af0 Compare April 22, 2026 23:26
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 817ab68 to 1af0218 Compare April 22, 2026 23:26
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from f6c9af0 to addad95 Compare April 23, 2026 00:04
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 1af0218 to 7923df2 Compare April 23, 2026 00:04
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from addad95 to 500c56b Compare April 23, 2026 00:09
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch 2 times, most recently from 2b3dd2c to 4b1cbf9 Compare April 23, 2026 00:45
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 500c56b to 652f647 Compare April 23, 2026 00:45
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 4b1cbf9 to f2464f3 Compare April 23, 2026 01:58
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch 2 times, most recently from 9e0d048 to 1655176 Compare April 23, 2026 02:56
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from f2464f3 to 72f4d29 Compare April 23, 2026 02:57
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 1655176 to 16e2fa4 Compare April 23, 2026 03:19
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 72f4d29 to 2196dec Compare April 23, 2026 03:20
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 16e2fa4 to 58f97e9 Compare April 23, 2026 03:41
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 2196dec to 2c19da9 Compare April 23, 2026 03:42
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from 58f97e9 to ea05258 Compare April 23, 2026 04:49
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 2c19da9 to 40e2154 Compare April 23, 2026 04:50
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from ea05258 to b4fa284 Compare April 23, 2026 05:09
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from 40e2154 to efe5bcb Compare April 23, 2026 05:10
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch from b4fa284 to 193ed00 Compare April 23, 2026 05:44
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch 2 times, most recently from 633de87 to ef05bfc Compare April 23, 2026 06:07
@vanceingalls vanceingalls force-pushed the vance/shader-midpoint-tests branch 2 times, most recently from ff0f25b to e24208f Compare April 23, 2026 06:57
Mock node:child_process.spawn to surface ENOENT and verify that:
- extractMediaMetadata falls back to PNG cICP metadata for image inputs
- extractMediaMetadata rethrows for non-image inputs lacking a still-image fallback
- extractAudioMetadata + analyzeKeyframeIntervals propagate the install-hint error verbatim

Closed gap from hdr-followups Chunk 9B.
@vanceingalls vanceingalls force-pushed the vance/ffprobe-fallback-tests branch from ef05bfc to 1b05a9e Compare April 23, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants