Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] docfx.Snapshots.Tests tests detect PDF diffs on non Ubuntu environment #10473

Open
filzrev opened this issue Dec 18, 2024 · 0 comments
Open
Labels
bug A bug to fix

Comments

@filzrev
Copy link
Contributor

filzrev commented Dec 18, 2024

Describe the bug
When running docfx.Snapshots.Tests tests on Windows environment.
Snapshot diffs are detected that are relating to generated PDF files.

Expected behavior
docfx.Snapshots.Tests run successfully without diffs on Windows environment.

Context

  • OS: Windows

Additional context

PDF snapshot diffs are caused by following OS dependent behaviors.

  1. OS dependent fonts differences (Embedded fonts are selected by specified font family)
  2. OS specific rendering differences. (See https://github.com/UglyToad/PdfPig/issues/840)

I've tried to use Web Fonts (Noto Sans and Noto Sans Mono) to resolve issues.
But 2. OS specific rendering differences seems to be hard to resolve. (It cause diffs on line break location)

As a temporary workaround.
I'm using following git commands to ignore diffs.

git update-index --skip-worktree test/docfx.Snapshot.Tests/SamplesTest.Seed/api/toc.pdf.verified.json
git update-index --skip-worktree test/docfx.Snapshot.Tests/SamplesTest.Seed/apipage/toc.pdf.verified.json
git update-index --skip-worktree test/docfx.Snapshot.Tests/SamplesTest.Seed/articles/seed.pdf.verified.json
git update-index --skip-worktree test/docfx.Snapshot.Tests/SamplesTest.Seed/md/toc.pdf.verified.json
git update-index --skip-worktree test/docfx.Snapshot.Tests/SamplesTest.Seed/pdf/toc.pdf.verified.json
git update-index --skip-worktree test/docfx.Snapshot.Tests/SamplesTest.Seed/restapi/toc.pdf.verified.json
git update-index --skip-worktree test/docfx.Snapshot.Tests/SamplesTest.Seed/toc.pdf.verified.json

Note

When reset above settings.
It need to exec command with --no-skip-worktree.
Skipped files can be found by using git ls-files -v command and S flag.

@filzrev filzrev added the bug A bug to fix label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix
Projects
None yet
Development

No branches or pull requests

1 participant