Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Jul 14, 2021

In particular would have caught NewApi violations in #86427

Fixes flutter/flutter#86430

@dnfield dnfield requested review from blasten and xster July 14, 2021 21:01
@google-cla google-cla bot added the cla: yes label Jul 14, 2021
Comment on lines +119 to +120
if ((flutter_runtime_mode == "debug" || flutter_runtime_mode == "profile") &&
(is_ios || is_android)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since linting is now part of this target, make sure we're not unnecessarily building it.

@zanderso

Copy link

Choose a reason for hiding this comment

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

is profile used somewhere? As far as I remember, debug is only used.

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's used for firebase testlab

Copy link
Member

Choose a reason for hiding this comment

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

How much time does linting add to these build configurations?

]
}

gradle_task("android") {
Copy link

Choose a reason for hiding this comment

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

nice!


@Override
public void finish(int resultCode, Bundle results) {
public void finish(int resultCode, @Nullable Bundle results) {
Copy link

Choose a reason for hiding this comment

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

are we getting lint warnings for @Nullable/@NonNullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link

Choose a reason for hiding this comment

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

We should enable these for the embedding too. I suspect there are places where we don't have the right annotations.

Copy link

Choose a reason for hiding this comment

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

Would it be too crazy if we remove flutter.jar and instead link the source directly?

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 have a seprate script for linting the embedding at //android_lint. There's a baseline file in there with things we already are failing on. That could be driven down separately.

I think this is a better test if we link in flutter.jar the way regular applications do - not quite sure what you have in mind here though.

Copy link

Choose a reason for hiding this comment

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

This way we don't need https://github.com/flutter/engine/blob/1eb8a34a3975070c42bc69f3981348dfa4f50a2d/tools/android_lint/bin/main.dart, right?

Since the linter is usually called by AGP, I wonder if there are additional benefits that required a more conventional Android project structure

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 don't have a normal Gradle project there though.

Copy link

Choose a reason for hiding this comment

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

it still builds with Gradle and AGP right? or is build.gradle never used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That tool directly invokes lint. It does not use Gradle or agp.

Copy link

Choose a reason for hiding this comment

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

The scenario app itself is a Gradle project, no? I was thinking since it is, it can also lint the embedding source code

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

LGTM

@dnfield
Copy link
Contributor Author

dnfield commented Jul 14, 2021

I need to figure out why this is failing CI - it broke something.

@jason-simmons
Copy link
Member

The "Linux Android Scenarios" CI failure is not specific to this PR.

See #27414 - whenever LUCI runs the test on the API 23 emulator, the test hangs until it is killed by the CI task's timeout.

("Linux Android Scenarios" was previously green only because the test failed to build and the LUCI recipe was ignoring the error code from the script that builds and runs the test).

@blasten
Copy link

blasten commented Jul 14, 2021

The timeout seems to be coming from

Seems like smokeTestEngineLaunch is flaky.

cc @GaryQian

@jason-simmons
Copy link
Member

After the test invokes fail("timed out waiting for engine started signal"), the test process on the device continues to hang because it is blocked in the flutterUiRenderedLock.wait() call in TestableFlutterActivity.waitUntilFlutterRendered

(see https://github.com/flutter/engine/blob/master/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/TestableFlutterActivity.java#L36)

@chinmaygarde
Copy link
Contributor

Per Dan, we need to move some test to the framework. More context in flutter/flutter#86427.

Per Jason, we should land rebase and land this.

@dnfield dnfield added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Jul 15, 2021
@fluttergithubbot fluttergithubbot merged commit 69460ca into flutter:master Jul 15, 2021
@dnfield dnfield deleted the lint_scen branch July 15, 2021 22:04
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 16, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 16, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 16, 2021
moffatman pushed a commit to moffatman/engine that referenced this pull request Aug 5, 2021
naudzghebre pushed a commit to naudzghebre/engine that referenced this pull request Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint the scenarios_app

6 participants