Skip to content

BUG: Fix mermaid.ink visual comparison test sensitivity to environment#99

Merged
Carwyn Pelley (cpelley) merged 1 commit intomainfrom
fixed_mermaid_image_comparison
Oct 30, 2025
Merged

BUG: Fix mermaid.ink visual comparison test sensitivity to environment#99
Carwyn Pelley (cpelley) merged 1 commit intomainfrom
fixed_mermaid_image_comparison

Conversation

@cpelley
Copy link
Copy Markdown
Collaborator

@cpelley Carwyn Pelley (cpelley) commented Oct 30, 2025

Opted for simply checking that images are successfully returned by mermaid.ink and that such files are non-zero in size.

Can't justify adding and maintaining code to DAGrunner testing for handling tolerant image comparison (svg/png/jpg).

Image generation is not operational or even part of the visualisation UI so doing anything more than checking that mermaid.ink actually returns a file cannot be justified.

Background

Mermaid cannot return consistent results since it works by dynamically generating a users diagram -- floating-point value precision differences leading to logic differences with layout.
Even svg element IDs are themselves allocated. We can enforce a consistent seed but this has its own implications on svg support.

Issues

Note

Markdown file (.md) generation (which we do care about) continues to be fully tested (i.e. content verified against reference file).

@cpelley Carwyn Pelley (cpelley) merged commit 3e3fcad into main Oct 30, 2025
3 checks passed
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.

TEST: Failing image comparison in some environments and not others

2 participants