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

Web test reorganization #39984

Merged
merged 56 commits into from
Mar 28, 2023
Merged

Conversation

eyebrowsoffire
Copy link
Contributor

@eyebrowsoffire eyebrowsoffire commented Mar 1, 2023

This is a major rework of the way we organize, compile, and run unit tests. See lib/web_ui/README.md and lib/web_ui/test/README.md for more details.

@flutter-dashboard flutter-dashboard bot added the platform-web Code specifically for the web engine label Mar 1, 2023
lib/web_ui/README.md Outdated Show resolved Hide resolved
```

### Optimizing local builds

Concurrency of various build steps can be configured via environment variables:

- `FELT_DART2JS_CONCURRENCY` specifies the number of concurrent `dart2js`
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure this isn't being used by recipes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are sure, because the web_engine recipes will no longer be used at all after this PR, and we'll be using new fresh and shiny engine_v2 builders

@@ -25,7 +24,6 @@ CommandRunner<bool> runner = CommandRunner<bool>(
..addCommand(CleanCommand())
..addCommand(GenerateFallbackFontDataCommand())
..addCommand(LicensesCommand())
..addCommand(RunCommand())
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK, this was being used by recipes. Did you remove 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.

Again, the old web_engine recipes are defunct and will no longer be used. Basically all CI is going to be redone and modernized with this change.

lib/web_ui/dev/steps/compile_bundle_step.dart Outdated Show resolved Hide resolved
@eyebrowsoffire eyebrowsoffire marked this pull request as ready for review March 24, 2023 03:07
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #39984 at sha 6d5fa74

@mdebbar
Copy link
Contributor

mdebbar commented Mar 24, 2023

Looked at the golden diffs. They are tiny diffs of antialiasing/shadows.

The ones I'm a bit worried about are text diffs. They are showing some artifacts:

wasm non-wasm
image image

These are probably caused by slightly different rounding in wasm mode.

@eyebrowsoffire eyebrowsoffire changed the title Web test reorganization (WIP) Web test reorganization Mar 24, 2023
],
"realm": "production"
}
"builds": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Content wise the config LGTM, but let's monitor capacity usage. With these many shards a single build will be using 1/4+ of the total capacity.

Copy link
Contributor

@godofredoc godofredoc left a comment

Choose a reason for hiding this comment

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

LGTM for the configs

command via the `--local-web-sdk=wasm_release` command.

##### Examples
Builds all web engine targets, then runs a Flutter app using it:
Copy link
Contributor

Choose a reason for hiding this comment

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

An example for how to specify targets would be helpful too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's an example of that directly below

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool! I missed it.

ArtifactDependencies.none()
: canvasKit = false
, canvasKitChromium = false
, skwasm = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

style nit: in Dart commas go on the previous line

if (testFiles != null && !testFiles!.contains(testFile)) {
return MapEntry<String, CompileResult>(relativePath, CompileResult.filtered);
}
final bool success = await compiler.compileTest(testFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we communicate failures to LUCI? It seems even success == false results in a successful completion of the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The compilation actually writes out a json file that contains the result of the compilation of each test. It still will run any of the tests that actually did compile. I did this because it was really irritating debugging dart2wasm stuff and never being able to actually run any tests at all if a single one failed to compile. However, I need to double check that if some tests fail to compile but all the ones that compile succeed that it actually properly fails and LUCI can pick that up. I'm not positive if I actually did that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It turns out we were immediately failing still, despite my best efforts otherwise 😆 . I went ahead and made a change that allows us to fail compilation and continue, and then bubble up that result at the end.

final String directory;
}

class TestBundle {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "bundle" sounds too similar to "set", how about TestCompilation?

}
}

class TestSuite {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "suite" is also too close to "set" and "bundle". How about TestRun?

@@ -0,0 +1,268 @@
compile-configs:
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider documenting at the top of the file common update scenarios, such as adding a new test suite. Or do we expect this to mostly stay as is?

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 do expect this to possibly change in the future. I think rather than doing a bunch of comments in the .yaml file, I'll just refer to the README.md in this directory which describes the structure of this file. Do you feel like that readme already has enough info? Or is there something more specific you'd like to see in there? I do have examples for each data type (test set, test bundle, test suite, run configuration, compile configuration, etc)

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

lgtm

@eyebrowsoffire
Copy link
Contributor Author

Looked at the golden diffs. They are tiny diffs of antialiasing/shadows.

The ones I'm a bit worried about are text diffs. They are showing some artifacts:

wasm non-wasm
image image
These are probably caused by slightly different rounding in wasm mode.

I went ahead and approved all the goldens. When I looked at the one you posted though in Skia Gold, the left image is actually safari with dart2js, and the right image is Chrome with wasm. So I think its a separate issue with safari rendering. Do you want to file a follow-on for that issue?

@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 27, 2023
@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #39984 at sha ba83669

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #39984 at sha 9b61f3a

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

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

Can't wait to give this a shot!

@@ -99,7 +116,7 @@ this option is particularly effective for building on low-powered laptops.
### Test browsers

Chromium, Firefox, and Safari for iOS are version-locked using the
[browser_lock.yaml][2] configuration file. Safari for macOS is supplied by the
[browser_lock.yaml][3] configuration file. Safari for macOS is supplied by the
computer's operating system. Tests can be run in Edge locally, but Edge is not
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to determine the version of safari that's running in CI? I've tried myself and the journey is pretty cryptic :P

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 honestly don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine will affect goldens
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants