Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Nov 17, 2020

Description

  • Uses same compiler for testing that is used for development
  • Unblocks running web tests in sound mode
  • Removes last build_runner usage.

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

@flutter-dashboard flutter-dashboard bot added c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Nov 17, 2020
@flutter-dashboard
Copy link

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.

@google-cla google-cla bot added the cla: yes label Nov 17, 2020
@jonahwilliams jonahwilliams added the a: null-safety Support for Dart's null safety feature label Nov 17, 2020
Copy link
Contributor Author

@jonahwilliams jonahwilliams left a 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

@skia-gold
Copy link

Gold has detected about 211 untriaged digest(s) on patchset 7.
View them at https://flutter-gold.skia.org/cl/github/70714

@skia-gold
Copy link

Gold has detected about 246 untriaged digest(s) on patchset 9.
View them at https://flutter-gold.skia.org/cl/github/70714

globals.fs.path.join(outputDirectory.path, '${relativeTestSegments.join('_')}.test.dart'));
generatedFile
..createSync(recursive: true)
..writeAsStringSync(_generateEntrypoint(relativeTestSegments.join('/'), testFilePath));
Copy link
Contributor

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?

Copy link
Contributor Author

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() {}');
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

@zanderso zanderso left a 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].
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@jonahwilliams
Copy link
Contributor Author

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('/')))
Copy link
Contributor Author

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.
Copy link
Member

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?

Copy link
Contributor Author

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 =
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: null-safety Support for Dart's null safety feature c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

5 participants