-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[flutter_tools] use frontend_server for web test compilation #70714
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
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 Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
jonahwilliams
left a comment
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.
TestOn chrome is not supported anymore, so we'll need to add the failing tests to the skip list
|
Gold has detected about 211 untriaged digest(s) on patchset 7. |
|
Gold has detected about 246 untriaged digest(s) on patchset 9. |
| globals.fs.path.join(outputDirectory.path, '${relativeTestSegments.join('_')}.test.dart')); | ||
| generatedFile | ||
| ..createSync(recursive: true) | ||
| ..writeAsStringSync(_generateEntrypoint(relativeTestSegments.join('/'), testFilePath)); |
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.
Would it be noticeably faster to fan out these writes into multiple concurrent writes and wait on them using Future.wait?
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.
This part of the process doesn't take much time - performance optimization is not a goal of this PR
| for (final File generatedFile in generatedFiles) { | ||
| buffer.writeln('import "${globals.fs.path.basename(generatedFile.path)}";'); | ||
| } | ||
| buffer.writeln('void main() {}'); |
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.
Can you please leave a comment explaining why the main.dart file has an empty main function?
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.
Done
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.
web_compilation_delegate.dart looks very fiddly. I suspect that file would benefit from a paragraph or two at the top explaining how it's all put together.
| import '../project.dart'; | ||
| import '../web/compile.dart'; | ||
|
|
||
| /// A build_runner specific implementation of the [WebCompilationProxy]. |
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.
Does this comment need an update?
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.
Done
|
web_compilation_delegate.dart needs substantial refactoring/removing - but thought the line length doesn't show it this was a monster of a PR to get working, so I tried to keep most of the APIs the same. I have a lot of follow up work to do, but that should be much easier to get started on |
| .whereType<File>() | ||
| .map<String>((File file) => path.relative(file.path, from: flutterPackageDirectory.path)) | ||
| .where((String filePath) => !kWebTestFileKnownFailures.contains(filePath)) | ||
| .where((String filePath) => !kWebTestFileKnownFailures.contains(path.split(filePath).join('/'))) |
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.
allows running on windows
| @@ -1,14 +0,0 @@ | |||
| // Copyright 2014 The Flutter Authors. All rights reserved. | |||
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.
Don't like this one?
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.
This is still unresolved: dart-lang/sdk#41764
| File metadataFile; | ||
| List<String> modules; | ||
| try { | ||
| final Directory parentDirectory = |
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.
Are you reformatting 80 character lines to longer? We're just fighting each other's autoformatting settings. We should get on the same page so we're not thrashing.
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 don't generally mind if you reformat things to be shorter, but that has to be a reciprocal agreement
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.
You know I wouldn't have any character limits if I were Boss. But I would rather just hit a button to format. We can talk about it outside this PR, but I don't think you even touched this file other than formatting it?
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.
done
Description
As a follow up, there is more refactoring required so that the bootstrap logic is shared between web run and test
Fixes #61120
Fixes #52685
Fixes #50594
Fixes #50594
Fixes #44583