Skip to content

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Feb 12, 2020

Description

I want to write a test that checks the timeline without starting paused or being in coverage mode. I need to enable the observatory to do that.

Related Issues

#50648

Tests

I added the following tests:

Test that the flag gets piped through as expected.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 12, 2020
..addFlag('enable-observatory',
defaultsTo: false,
hide: !verboseHelp,
help: 'Enables the observatory without --start-paused. This flag is '
Copy link
Contributor

Choose a reason for hiding this comment

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

enable-vmservice and replace "observatory" with "vmservice". The former is the name of the particular html client, though we've conflated the two a lot we've been trying to separate 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.

}

class _FlutterTestRunnerImpl extends FlutterTestRunner {
const _FlutterTestRunnerImpl() : super._();
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just use implements

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
Contributor

Choose a reason for hiding this comment

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

Suggested change
}
}

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

if (!globals.processManager.canRun(shellPath)) {
throwToolExit('Cannot execute Flutter tester at $shellPath');
}
/// A class that abstracts launching the test process from the test runner.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonahwilliams or @zanderso - should I leave a method here that redirects to const _FlutterTestRunnerImpl().runTests to avoid breaking internal customers? I don't see evidence that we use this but not sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI @chingjun, though I don't think this is used at all

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is used internally. But whenever in doubt, you could always run the tests go/flutter-pr-test :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, good idea!

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.

FYI @zanderso

Change LGTM with nit. Would you verify this wrapper isn't used in g3? (I don't think it is..)

@dnfield
Copy link
Contributor Author

dnfield commented Feb 12, 2020

The only reference I can find is in our own code.

throwToolExit('Failed to compile tests');
/// Runs tests using package:test and the Flutter engine.
Future<int> runTests(
TestWrapper testWrapper,
Copy link
Member

Choose a reason for hiding this comment

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

This method has a lot of parameters. Should we have a TestRunnerConfig class to encapsulate and document them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably - I'd rather do that as a separate effort to avoid breaking things (right now I'm just moving it to a class so we can inject and test this)

@dnfield dnfield mentioned this pull request Feb 12, 2020
9 tasks
@dnfield dnfield merged commit 24f8f79 into flutter:master Feb 12, 2020
@dnfield dnfield deleted the enable_obs branch February 12, 2020 22:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants