-
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
Merged
westonruter
merged 13 commits into
develop
from
add/4654-spec-test-configuration-parsing
May 7, 2020
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9407a17
Update spec files
schlessera cea5c76
Adapt spec test to extract configuration arguments from input files
schlessera 9d1317b
Add STYLES configuration key to AmpRuntimeCss transformer
schlessera f477aab
Nake use of styles provided via config if available
schlessera 8c973ee
Remove runtime style tag if stylesheet is linked
schlessera 40ef95e
Add more tests to assert runtime transformer behavior
schlessera b536557
Complete stubbed requests data
schlessera 0bf9452
Remove unused import
schlessera 1661ae7
Add git attributes file to mark certain file as being generated
schlessera a3eaba2
Use substr() instead of a replacement for removing the leading comment
schlessera 96c7991
Remove redundant JSONOBJECT_AS_ARRAY constant
schlessera ef7322c
Move .gitattributes file into lib/optimizer folder
schlessera 295f6cd
Revert "Move .gitattributes file into lib/optimizer folder"
schlessera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib/optimizer/resources/local_fallback/* linguist-generated=true | ||
lib/optimizer/tests/spec/* linguist-generated=true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"ampRuntimeVersion":"012004030010070","ampCssUrl":"https://cdn.ampproject.org/rtv/012004030010070/v0.css","canaryPercentage":"0.005","diversions":["002004012111560","002004012158290","022004030010070","032004012111560","032004012158290","042004030033570"],"ltsRuntimeVersion":"012002251816300","ltsCssUrl":"https://cdn.ampproject.org/rtv/012002251816300/v0.css"} | ||
{"ampRuntimeVersion":"012004252135000","ampCssUrl":"https://cdn.ampproject.org/rtv/012004252135000/v0.css","canaryPercentage":"0.005","diversions":["002004252135000","002005050322000","022004252135000","032004252135000","032005050322000","042005051629000","052004252135000","102004252135000"],"ltsRuntimeVersion":"012004030010070","ltsCssUrl":"https://cdn.ampproject.org/rtv/012004030010070/v0.css"} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
lib/optimizer/tests/spec/end-to-end/body-only/expected_output.valid.html
This file contains 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
16 changes: 8 additions & 8 deletions
16
lib/optimizer/tests/spec/end-to-end/hello-world/expected_output.html
This file contains 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
2 changes: 1 addition & 1 deletion
2
lib/optimizer/tests/spec/end-to-end/hello-world/expected_output.valid.html
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
lib/optimizer/tests/spec/end-to-end/markdown/expected_output.valid.html
This file contains 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
12 changes: 0 additions & 12 deletions
12
...rs/experimental/AmpBoilerplateTransformer/uses_given_runtime_version/expected_output.html
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...transformers/experimental/AmpBoilerplateTransformer/uses_given_runtime_version/input.html
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...timizer/tests/spec/transformers/experimental/RewriteAmpUrls/adds_esm/expected_output.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html ⚡> | ||
<head> | ||
<script async nomodule src="https://cdn.ampproject.org/v0/amp-experiment-0.1.js"></script> | ||
<script async custom-element="amp-experiment" src="https://cdn.ampproject.org/v0/amp-experiment-0.1.mjs" type="module" crossorigin="anonymous"></script> | ||
<link as="script" crossorigin="anonymous" href="https://cdn.ampproject.org/v0.mjs" rel="preload"> | ||
<script async nomodule src="https://cdn.ampproject.org/v0.js"></script> | ||
<script async src="https://cdn.ampproject.org/v0.mjs" type="module" crossorigin="anonymous"></script> | ||
<link rel="stylesheet" href="https://cdn.ampproject.org/v0.css"> | ||
<link href="https://fonts.googleapis.com/css?foobar" rel="stylesheet" type="text/css"> | ||
<link href="https://example.com/favicon.ico" rel="icon"> | ||
<link rel="preload" href="https://cdn.ampproject.org/v0.css" as="style"> | ||
</head> | ||
<body></body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
lib/optimizer/tests/spec/transformers/experimental/RewriteAmpUrls/adds_esm/input.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html> | ||
<html ⚡> | ||
<head> | ||
<script async custom-element=amp-experiment src=https://cdn.ampproject.org/v0/amp-experiment-0.1.js></script> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
<link rel=stylesheet href=https://cdn.ampproject.org/v0.css> | ||
<link href=https://fonts.googleapis.com/css?foobar rel=stylesheet type=text/css> | ||
<link href=https://example.com/favicon.ico rel=icon> | ||
</head> | ||
<body></body> | ||
</html> |
Oops, something went wrong.
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.
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.
No, it doesn't work when the
.gitattributes
file is in a subfolder. I'll revert that change again and leave it in the root for now. This will need to be adapted once we extract the libraries into separate repositories.