-
Notifications
You must be signed in to change notification settings - Fork 29.4k
[flutter_tools] Make test asset directory visible on web platform testing #144597
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
[flutter_tools] Make test asset directory visible on web platform testing #144597
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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.
ink_sparkle should be loaded via asset bundles. if the asset bundle is broken, then a fix should be made there, not by adjusting the test harness loading behavior.
@jonahwilliams |
The test assets are built here: maybe those arguments need to be adjusted for web tests? |
03a85a4
to
e8a5b36
Compare
Thanks for pointing out this code. |
e8a5b36
to
9e492b2
Compare
5dfa177
to
6570f03
Compare
4d13643
to
08333b1
Compare
08333b1
to
3c3ce41
Compare
@christopherfujino |
I'm gonna defer to @andrewkolos to make the final review on this one, he's currently out of office but will be back ~1 week. |
Hello, I'm back and trying to catch up on this. I'm starting out from the same place @jonahwilliams did:
I need to figure out where this shader is being loaded, how it's being loaded, and why it's not working for web tests. |
@andrewkolos
Since then I updated the PR to serve the test asset directory which was already correctly built for web tests but whose path was not known by the |
@andrewkolos Did you get a chance to look at this PR? |
Hello, I got preoccupied with other things, but I have no excuse for not communicating this. My apologies.
If the path was not known by Footnotes
|
To extend the previous comment: I believe the code that actually loads |
@andrewkolos Thanks for your insight. I’m far from having a full understanding of asset loading, shaders and flutter tools inner workings. That makes it hard to draw conclusions on this area. For context, here is what led me to this PR:
flutter/packages/flutter/lib/src/material/ink_sparkle.dart Lines 443 to 452 in 13a05de
I will try to get a better understanding of how the shader is supposed to be loaded on web tests and I will try to narrow it down to make progress. |
Just found #31207 which is a great starting point to understand how assets are loaded in non-web tests (it mocks flutter/assets channel to bypass the engine). |
Thanks for the recap!
I work on the tool full-time, and I could still say the same 😆. I would have loved to have a deep dive here and figure all of this out, but I unfortunately do not have the time. If you do figure this out or this turns out to be a higher priority than I thought, I'd be glad to look at this again. |
Hello @bleroux I am also facing the same issue where shaders asset is not found in unit tests for flutter app. @andrewkolos this really blocks users from using updated Flutter version (since 3.16, and the latest SDK is 3.22). Could the flutter team also take a look into this with priority? |
Hello @dvaruas!
Do you mean that it worked before 3.16? (I'm not sure when shaders support was added to Flutter Web) |
Hey @bleroux , thank you for your response. I'll try to create a issue with a minimal example once I isolate it.
yes, I was using 3.13.9 previously and everything works fine. For now I am removing the --no-test-assets flag to bypass this issue. |
Description
This PR makes the test assets directory content available to web tests.
The goal of this PR is to unblock #144314 which activates ink sparkle animation on CanvasKit. The ink sparkle animation relies on a shader.
#144314 works when launching a flutter app but fails when launching a web test with a 404 error for the
ink_sparkle.frag
file.Related Issue
Needed for #144314.
Tests
Adds 1 test.