Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Aug 18, 2020

Description

This "hermetic" test uses real pub.

FlutterCommandRunner.initFlutterRoot(); was setting the cache root to ../...
analyze_continuously_test runs pub get relative to the temp directory, and ../../bin/cache/dart-sdk/bin/pub doesn't exist there.

Related Issues

Fixes #64008

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added a: tests "flutter test", flutter_test, or one of our tests tool Affects the "flutter" command-line tool. See also t: labels. labels Aug 18, 2020
@jmagman jmagman requested a review from jonahwilliams August 18, 2020 04:59
@jmagman jmagman self-assigned this Aug 18, 2020
Logger logger;

setUp(() {
platform = const LocalPlatform();
Copy link
Member Author

Choose a reason for hiding this comment

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

This was set twice

Copy link
Contributor

Choose a reason for hiding this comment

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

copy-paste strikes again

@jonahwilliams
Copy link
Contributor

Was this just passing because of the CWD on cirrus? additionally, should we move this to the integration shard to make it clear it is absolutely not a unit test?

Copy link
Contributor

@christopherfujino christopherfujino 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 a later PR, should we move this to permeable?

@jmagman
Copy link
Member Author

jmagman commented Aug 18, 2020

Was this just passing because of the CWD on cirrus? additionally, should we move this to the integration shard to make it clear it is absolutely not a unit test?

When I run SHARD=tool_tests SUBSHARD=commands dart test.dart locally it passes, the cache flutter root state seems to be leaking between tests.

I tried to track down the leak but I couldn't spot it, I should probably spend more time on that but I got distracted.

@christopherfujino
Copy link
Contributor

Was this just passing because of the CWD on cirrus? additionally, should we move this to the integration shard to make it clear it is absolutely not a unit test?

When I run SHARD=tool_tests SUBSHARD=commands dart test.dart locally it passes, the cache flutter root state seems to be leaking between tests.

I tried to track down the leak but I couldn't spot it, I should probably spend more time on that but I got distracted.

Does test.dart run in a different order than pub run test? Or is test.dart running from a different working directory?

@jonahwilliams
Copy link
Contributor

test.dart runs with FLUTTER_ROOT environment variable set

Copy link
Contributor

@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.

LGTM

@jmagman jmagman merged commit 6ca9cd7 into flutter:master Aug 19, 2020
@jmagman jmagman deleted the pub-root branch August 19, 2020 00:09
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: tests "flutter test", flutter_test, or one of our tests tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[flutter_tools] commands.shard analyze_continuously_test.dart failing locally

4 participants