Unverified Commit d91cfffa authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

switch tool tests to build runner (#28759)

parent 778e95a3
......@@ -143,8 +143,9 @@ Future<void> _runSmokeTests() async {
Future<void> _runToolTests() async {
await _runSmokeTests();
await _pubRunTest(
await _buildRunnerTest(
path.join(flutterRoot, 'packages', 'flutter_tools'),
flutterRoot,
enableFlutterToolAsserts: true,
);
......@@ -306,6 +307,41 @@ Future<void> _runCoverage() async {
print('${bold}DONE: Coverage collection successful.$reset');
}
Future<void> _buildRunnerTest(
String workingDirectory,
String flutterRoot, {
String testPath,
bool enableFlutterToolAsserts = false,
}
) {
final List<String> args = <String>['run', 'build_runner', 'test', '--', '-rcompact', '-j1'];
if (!hasColor) {
args.add('--no-color');
}
if (testPath != null) {
args.add(testPath);
}
final Map<String, String> pubEnvironment = <String, String>{
'FLUTTER_ROOT': flutterRoot,
};
if (Directory(pubCache).existsSync()) {
pubEnvironment['PUB_CACHE'] = pubCache;
}
if (enableFlutterToolAsserts) {
// If an existing env variable exists append to it, but only if
// it doesn't appear to already include enable-asserts.
String toolsArgs = Platform.environment['FLUTTER_TOOL_ARGS'] ?? '';
if (!toolsArgs.contains('--enable-asserts'))
toolsArgs += ' --enable-asserts';
pubEnvironment['FLUTTER_TOOL_ARGS'] = toolsArgs.trim();
}
return runCommand(
pub, args,
workingDirectory: workingDirectory,
environment: pubEnvironment,
);
}
Future<void> _pubRunTest(
String workingDirectory, {
String testPath,
......
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