Skip to content
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

Replace @unroll hack with standard Jinja loops in canvas WPT generator #50080

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jan 14, 2025

The @unroll directive was added as a way of generating a statement with
the cross product of a number of possible argument values. It was added
before the test generator was migrated to Jinja. With Jinja, we can now
do the equivalent unrolling by simply using standard for loops.

The @... directives are just disguised regex string replacements and
their interaction with Jinja is delicate, often broken and hard to
maintain. The string replacement often fails for multi-line/statement
content or when combined with Jinja templating. We would be better off
just using standard Jinja templating.

The @unroll directive was only used in a single test and the interaction
with Jinja template expansion made the test definition very hard to
understand. The test is easier to follow if we just use Jinja logic.

Bug: 40207206
Change-Id: I6e31becd7c224d00c3d1d5a32bf8f47ea6ba411c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172744
Reviewed-by: Yi Xu <[email protected]>
Commit-Queue: Jean-Philippe Gravel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1406444}

The @unroll directive was added as a way of generating a statement with
the cross product of a number of possible argument values. It was added
before the test generator was migrated to Jinja. With Jinja, we can now
do the equivalent unrolling by simply using standard `for` loops.

The @... directives are just disguised regex string replacements and
their interaction with Jinja is delicate, often broken and hard to
maintain. The string replacement often fails for multi-line/statement
content or when combined with Jinja templating. We would be better off
just using standard Jinja templating.

The @unroll directive was only used in a single test and the interaction
with Jinja template expansion made the test definition very hard to
understand. The test is easier to follow if we just use Jinja logic.

Bug: 40207206
Change-Id: I6e31becd7c224d00c3d1d5a32bf8f47ea6ba411c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6172744
Reviewed-by: Yi Xu <[email protected]>
Commit-Queue: Jean-Philippe Gravel <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1406444}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 9aa25c6 into master Jan 15, 2025
11 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-6172744 branch January 15, 2025 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants