Repository navigation
fix(ci): regenerate gitignored CSS before unit-test Hugo build - #2922
Merged
Merged
Conversation
test/unit/hugo-homepage-partials.test.ts spawns a real Hugo build. head.html:27 does `resources.Get "css/fundamental-styles-icon.css" | minify | fingerprint`. Since ac6b7e3 stopped committing the generated CSS (sap-fundamental.css, fundamental-styles-icon.css are now gitignored build outputs), these assets are absent on a fresh checkout. unit-tests.yml never regenerated them, so resources.Get missed the asset, minify got a non-transformable resource.Resource, and the Hugo build exited 1 — failing 7 test files. rebuild-content.yml already regenerates these before its Hugo build; this mirrors that step (build:icon-subset + build:css) before npm test. Verified: without the assets Hugo exits 1 (4 minify errors); after the two gen steps Hugo exits 0 and hugo-homepage-partials.test.ts passes 4/4.
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.
Problem
Unit tests are red in CI. 7 test files fail, all downstream of
test/unit/hugo-homepage-partials.test.ts, which spawns a real Hugo build that exits 1 with:Root cause
hugo/layouts/partials/head.html:27runsresources.Get "css/fundamental-styles-icon.css" | minify | fingerprint. Commitac6b7e39f("stop committing generated CSS so deploy & rebuild agree on fingerprint") movedsap-fundamental.cssandfundamental-styles-icon.cssto gitignored build outputs — absent on a fresh checkout.rebuild-content.yml/rebuild-content-qa.ymlwere updated to regenerate them before their Hugo build, butunit-tests.ymlwas not. Soresources.Getmisses the asset,minifyreceives a non-transformableresource.Resource, and the build fails.Fix
Add a
build:icon-subset+build:cssstep beforenpm test, mirroring the existing rebuild workflows.Verification
hugo --source hugo/exits 1, 4ResourceTransformererrors (reproduces the bug).build:icon-subset+build:css→ Hugo exits 0, 0 errors.vitest run test/unit/hugo-homepage-partials.test.ts→ 4 passed.