Repository navigation
Add complex Shopify template rendering tests - #13
Merged
Merged
Conversation
Wire 6 real-world templates from Shopify's Ruby Liquid benchmark suite
(performance/tests/{tribble,vogue,dropify,ripen}) into the test runner as
end-to-end rendering tests.
These exercise the renderer comprehensively: nested for-loops, cycle,
forloop.first/last, nested object access, hyphenated keys
(linklists.main-menu), list .size/.first, money/pluralize/truncate filters,
and nested conditionals.
A universal passthrough filter stub stands in for the Shopify-specific
filters liquid-ml does not implement (asset_url, product_img_url, link_to,
within, stylesheet_tag, ...); the standard library is consulted first so
real filters keep their behavior. Each template is rendered against a shared
representative context and asserted to contain stable marker substrings.
Adds 6 tests (262 -> 268), all passing.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
Adds end-to-end rendering tests built from 6 real-world templates taken from Shopify's own Ruby Liquid benchmark suite (
performance/tests/{tribble,vogue,dropify,ripen}). These give the renderer a comprehensive, real-world workout beyond the existing focused unit tests.Templates added under
test/templates/complex/:theme.liquidlimit/offset), featured products,pluralize,dateminicart_theme.liquidpluralize,money, linklistsindex.liquidproduct.liquid<select>, image loopsproduct_variants.liquidprice_variescart.liquidcycle,money_with_currency,forloop.first,limitHow it works
shop,cart,product,collections,linklists,pages,blogs, …) is built with small helper constructors.asset_url,product_img_url,link_to,within,stylesheet_tag, …). The standard library is consulted first, so real filters (money,pluralize,truncate, …) keep their behavior.Notes / findings
cycle,forloop.first/last, hyphenated keys (linklists.main-menu), list.size/.first, and nested conditionals.{% for article in blogs.news.articles limit: 6 offset: 1 %}correctly skips the first article, so the test assertsNews Tworather thanNews One.Testing
dune test— 268 tests run, all passing (was 262; +6).