fix(ci): the svg text tests assumed the host has fonts - #395
Merged
Merged
Conversation
#394 turned main red. Two tests written against a Mac asserted that Helvetica resolves; CI's Ubuntu runner installs `libfontconfig1-dev` and `libfreetype6-dev` — the font *libraries* — and no font *files* at all, so nothing resolved and usvg dropped the `<text>` node exactly as it does for any host with an empty fontdb. That is the residual gap #374's own rule file documents, arriving as a red build rather than as a render. Both sides fixed, because each was wrong on its own: The tests no longer name a family. They ask the shared fontdb for a family the host actually has and skip when there is none, so they mean the same thing on a laptop and in a container. A new test covers the other side directly: with an empty fontdb the `<text>` count resolves to 0, which is the condition the warning exists for. CI gains `fonts-dejavu-core`. A renderer that draws text needs font files on the host, and a runner that has none is not a realistic environment to prove anything about text in. I merged #394 while its `test` job was still pending. That is what let this reach main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
main is red. #394 broke it and this is the fix.
What happened
Two tests from #374 asserted that
Helveticaresolves. True on the Mac they were written on; false on CI's Ubuntu runner, which installslibfontconfig1-devandlibfreetype6-dev— the font libraries — and no font files. Nothing resolved, usvg dropped the<text>node, and both tests failed:This is precisely the residual gap #374's own rule file describes — "a render host with zero usable fonts anywhere, e.g. a bare container with no font packages" — arriving as a red build instead of as a bad render.
Both sides were wrong, so both are fixed
The tests no longer name a family. They ask the shared fontdb for one the host actually has, and skip when there is none. They now mean the same thing on a laptop and in a container.
A new test covers the other side head-on: with an empty fontdb, the resolved
<text>count is 0. That is the condition the warning exists for, and nothing was asserting it.CI gains
fonts-dejavu-core. A renderer that draws text needs font files on the host. A runner with none is not an environment that can prove anything about text, and leaving it that way would only mean the next text feature discovers this again.How it reached main
I merged #394 while its
testjob was stillpending.gh pr checks --watchreturned on an earlier run and I did not re-read the state before merging — the second time today. Stating it because the fix for that is mine to apply, not the code's.cargo fmt --all --checkandcargo clippy --workspace --all-targets -- -D warningsclean; the eightsvgtests pass locally, including the two that failed on CI and the new empty-fontdb one.