[flutter_tools] Normalize paths before checking for Integration Tests (#79521)
This commit is contained in:
@@ -273,7 +273,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts {
|
||||
if (globals.fs.isDirectorySync(path))
|
||||
..._findTests(globals.fs.directory(path))
|
||||
else
|
||||
globals.fs.path.absolute(path)
|
||||
globals.fs.path.normalize(globals.fs.path.absolute(path))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -446,6 +446,27 @@ dev_dependencies:
|
||||
]),
|
||||
});
|
||||
|
||||
testUsingContext('when absolute unnormalized path to integration test is passed', () async {
|
||||
final FakePackageTest fakePackageTest = FakePackageTest();
|
||||
|
||||
final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest);
|
||||
final CommandRunner<void> commandRunner = createTestCommandRunner(testCommand);
|
||||
|
||||
await commandRunner.run(const <String>[
|
||||
'test',
|
||||
'--no-pub',
|
||||
'/package/../package/integration_test/some_integration_test.dart',
|
||||
]);
|
||||
|
||||
expect(testCommand.isIntegrationTest, true);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
ProcessManager: () => FakeProcessManager.any(),
|
||||
DeviceManager: () => _FakeDeviceManager(<Device>[
|
||||
FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android),
|
||||
]),
|
||||
});
|
||||
|
||||
testUsingContext('when both test and integration test are passed', () async {
|
||||
final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user