-
Notifications
You must be signed in to change notification settings - Fork 384
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
Add input file configuration parsing for spec tests #4662
Add input file configuration parsing for spec tests #4662
Conversation
@@ -0,0 +1,2 @@ | |||
lib/optimizer/resources/local_fallback/* linguist-generated=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL about using .gitattributes
to suppress diffs for generated code (docs) 😄.
Would the path lib/optimiser/
be a better place for this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right. Placing it into lib/optimizer
will work, per Git docs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as GitHub recognizes this, as their docs only mention the repo root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed it would only work in the project root, but I can try moving it around to see what happens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Weston Ruter <westonruter@google.com>
This reverts commit ef7322c.
* Update spec files * Adapt spec test to extract configuration arguments from input files * Add STYLES configuration key to AmpRuntimeCss transformer * Nake use of styles provided via config if available * Remove runtime style tag if stylesheet is linked * Add more tests to assert runtime transformer behavior * Complete stubbed requests data * Remove unused import * Add git attributes file to mark certain file as being generated * Use substr() instead of a replacement for removing the leading comment * Remove redundant JSONOBJECT_AS_ARRAY constant * Move .gitattributes file into lib/optimizer folder * Revert "Move .gitattributes file into lib/optimizer folder"
Summary
This PR includes the following changes:
amp-toolbox
version.SpecTest.php
to extract the HTML comment with configuration arguments from the input HTML files of the spec test suite.STYLES
configuration key to theAmpRuntimeCss
configuration.STYLES
config argument.<style amp-runtime>
element if the stylesheet ended up being linked to.AmpRuntimeCss
to ensure configuration arguments behave as expected.StubbedRequests
filtering from Stub request based on test scenario #4588.gitattributes
file to denote generated files, so that these are collapsed by default in code review.Fixes #4654
Checklist