Remove the warning about the Integration Test plugin (#79520)
This commit is contained in:
@@ -401,6 +401,10 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
|
||||
if (_isIntegrationTest) {
|
||||
integrationTestDevice = await findTargetDevice();
|
||||
|
||||
// Disable reporting of test results to native test frameworks. This isn't
|
||||
// needed as the Flutter Tool will be responsible for reporting results.
|
||||
buildInfo.dartDefines.add('INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false');
|
||||
|
||||
if (integrationTestDevice == null) {
|
||||
throwToolExit(
|
||||
'No devices are connected. '
|
||||
|
||||
@@ -582,6 +582,30 @@ dev_dependencies:
|
||||
FakeDevice('ephemeral', 'ephemeral', ephemeral: true, isSupported: true, type: PlatformType.web),
|
||||
]),
|
||||
});
|
||||
|
||||
testUsingContext('Integration tests set the correct dart-defines', () async {
|
||||
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
|
||||
|
||||
final TestCommand testCommand = TestCommand(testRunner: testRunner);
|
||||
final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand);
|
||||
|
||||
await commandRunner.run(const <String>[
|
||||
'test',
|
||||
'--no-pub',
|
||||
'integration_test',
|
||||
]);
|
||||
|
||||
expect(
|
||||
testRunner.lastDebuggingOptionsValue.buildInfo.dartDefines,
|
||||
contains('INTEGRATION_TEST_SHOULD_REPORT_RESULTS_TO_NATIVE=false'),
|
||||
);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
DeviceManager: () => _FakeDeviceManager(<Device>[
|
||||
FakeDevice('ephemeral', 'ephemeral', ephemeral: true, isSupported: true, type: PlatformType.android),
|
||||
]),
|
||||
});
|
||||
}
|
||||
|
||||
class FakeFlutterTestRunner implements FlutterTestRunner {
|
||||
@@ -589,6 +613,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
|
||||
|
||||
int exitCode;
|
||||
bool lastEnableObservatoryValue;
|
||||
DebuggingOptions lastDebuggingOptionsValue;
|
||||
|
||||
@override
|
||||
Future<int> runTests(
|
||||
@@ -626,6 +651,7 @@ class FakeFlutterTestRunner implements FlutterTestRunner {
|
||||
String integrationTestUserIdentifier,
|
||||
}) async {
|
||||
lastEnableObservatoryValue = enableObservatory;
|
||||
lastDebuggingOptionsValue = debuggingOptions;
|
||||
return exitCode;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user