Unverified Commit 8c6d60bc authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Move commands into their own shard (#39140)

parent 39f85f94
This diff is collapsed.
......@@ -60,7 +60,7 @@ IF NOT EXIST "%cache_dir%" (
REM To debug the tool, you can uncomment the following lines to enable checked mode and set an observatory port:
REM SET FLUTTER_TOOL_ARGS="--checked %FLUTTER_TOOL_ARGS%"
REM SET FLUTTER_TOOL_ARGS="--enable-asserts %FLUTTER_TOOL_ARGS%"
REM SET FLUTTER_TOOL_ARGS="%FLUTTER_TOOL_ARGS% --observe=65432"
:acquire_lock
......
This diff is collapsed.
This directory contains tests for specific `flutter` commands.
Tests that are self-contained unit tests should go in `hermetic/`.
Tests that are more end-to-end, e.g. that involve actually running
subprocesses, should go in `permeable/`.
The `../../tool/coverage_tool.dart` script (which is used to collect
coverage for the tool) runs only the tests in the `hermetic` directory
when collecting coverage.
......@@ -29,7 +29,7 @@ void main() {
fs.path.join('flutter', 'packages', 'flutter_test', 'pubspec.yaml'),
fs.path.join('flutter', 'bin', 'cache', 'artifacts', 'gradle_wrapper', 'wrapper'),
fs.path.join('usr', 'local', 'bin', 'adb'),
fs.path.join('Android', 'platform-tools', 'foo'),
fs.path.join('Android', 'platform-tools', 'adb.exe'),
];
for (String path in paths) {
fs.file(path).createSync(recursive: true);
......@@ -43,25 +43,17 @@ void main() {
final CreateCommand command = CreateCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>[
'create', '--flutter-root=flutter', '--no-pub', '--template=module', 'testy']);
expect(await command.usageValues,
containsPair(CustomDimensions.commandCreateProjectType, 'module'));
await runner.run(<String>['create', '--flutter-root=flutter', '--no-pub', '--template=module', 'testy']);
expect(await command.usageValues, containsPair(CustomDimensions.commandCreateProjectType, 'module'));
await runner.run(<String>[
'create', '--flutter-root=flutter', '--no-pub', '--template=app', 'testy']);
expect(await command.usageValues,
containsPair(CustomDimensions.commandCreateProjectType, 'app'));
await runner.run(<String>['create', '--flutter-root=flutter', '--no-pub', '--template=app', 'testy']);
expect(await command.usageValues, containsPair(CustomDimensions.commandCreateProjectType, 'app'));
await runner.run(<String>[
'create', '--flutter-root=flutter', '--no-pub', '--template=package', 'testy']);
expect(await command.usageValues,
containsPair(CustomDimensions.commandCreateProjectType, 'package'));
await runner.run(<String>['create', '--flutter-root=flutter', '--no-pub', '--template=package', 'testy']);
expect(await command.usageValues, containsPair(CustomDimensions.commandCreateProjectType, 'package'));
await runner.run(<String>[
'create', '--flutter-root=flutter', '--no-pub', '--template=plugin', 'testy']);
expect(await command.usageValues,
containsPair(CustomDimensions.commandCreateProjectType, 'plugin'));
await runner.run(<String>['create', '--flutter-root=flutter', '--no-pub', '--template=plugin', 'testy']);
expect(await command.usageValues, containsPair(CustomDimensions.commandCreateProjectType, 'plugin'));
}));
test('set iOS host language type as usage value', () => testbed.run(() async {
......
......@@ -139,10 +139,10 @@ void main() {
final StreamController<Map<String, dynamic>> commands = StreamController<Map<String, dynamic>>();
final StreamController<Map<String, dynamic>> responses = StreamController<Map<String, dynamic>>();
daemon = Daemon(
commands.stream,
responses.add,
daemonCommand: command,
notifyingLogger: notifyingLogger,
commands.stream,
responses.add,
daemonCommand: command,
notifyingLogger: notifyingLogger,
);
commands.add(<String, dynamic>{
......
......@@ -46,11 +46,9 @@ void main() {
fs.path.join(basePath, '.idea'): 'dir',
fs.path.join(basePath, '.idea', 'modules.xml$suffix'): 'modules $marker',
fs.path.join(basePath, '.idea', 'vcs.xml$suffix'): 'vcs $marker',
fs.path.join(basePath, '.idea', '.name$suffix'):
'codeStyleSettings $marker',
fs.path.join(basePath, '.idea', '.name$suffix'): 'codeStyleSettings $marker',
fs.path.join(basePath, '.idea', 'runConfigurations'): 'dir',
fs.path.join(basePath, '.idea', 'runConfigurations', 'hello_world.xml$suffix'):
'hello_world $marker',
fs.path.join(basePath, '.idea', 'runConfigurations', 'hello_world.xml$suffix'): 'hello_world $marker',
fs.path.join(basePath, 'flutter.iml$suffix'): 'flutter $marker',
fs.path.join(basePath, 'packages', 'new', 'deep.iml$suffix'): 'deep $marker',
};
......
......@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This test performs too poorly to run with coverage enabled.
@Tags(<String>['create', 'no_coverage'])
import 'dart:async';
import 'dart:convert';
import 'dart:typed_data';
......@@ -25,7 +23,6 @@ import 'package:process/process.dart';
import '../../src/common.dart';
import '../../src/context.dart';
const String frameworkRevision = '12345678';
const String frameworkChannel = 'omega';
final Generator _kNoColorTerminalPlatform = () => FakePlatform.fromPlatform(const LocalPlatform())..stdoutSupportsAnsi = false;
......@@ -116,7 +113,9 @@ void main() {
'ios/',
]);
return _runFlutterTest(projectDir);
}, timeout: allowForRemotePubInvocation);
},
timeout: allowForRemotePubInvocation,
);
testUsingContext('cannot create a project if non-empty non-project directory exists with .metadata', () async {
await projectDir.absolute.childDirectory('blag').create(recursive: true);
......
......@@ -39,7 +39,18 @@ Future<void> main(List<String> arguments) async {
<Runtime>[Runtime.vm],
() => vmPlatform,
);
await test.main(<String>['-x', 'no_coverage', '--no-color', '-r', 'compact', '-j', '1', ...arguments]);
if (arguments.isEmpty) {
arguments = <String>[
path.join('test', 'general.shard'),
path.join('test', 'commands.shard', 'hermetic'),
];
}
await test.main(<String>[
'--no-color',
'-r', 'compact',
'-j', '1',
...arguments
]);
exit(exitCode);
});
}
......@@ -141,8 +152,7 @@ class VMPlatform extends PlatformPlugin {
final String result = await coverageCollector.finalizeCoverage(
formatter: formatter,
);
final String prefix = Platform.environment['SUBSHARD'] ?? '';
final String outputLcovPath = path.join('coverage', '$prefix.lcov.info');
final String outputLcovPath = path.join('coverage', 'lcov.info');
File(outputLcovPath)
..createSync(recursive: true)
..writeAsStringSync(result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment