Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 26 additions & 10 deletions scripts/customer_testing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,47 @@

import 'dart:io';

Future<void> main() async {
await _run('flutter', ['analyze', '--no-fatal-infos']);

// Golden and rendering tests are platform-sensitive, so the full per-package
// test suites only run on Linux, where the golden files are generated.
if (!Platform.isLinux) {
return;
}
// flame_3d builds on the experimental flutter_gpu library, whose API changes
// frequently in flutter/flutter's presubmit. Analyzing it here would block
// framework changes on an unstable dependency that is not representative of
// Flame, so it is excluded from this run.
const _excludedPackages = {'flame_3d'};

Future<void> main() async {
final packages =
Directory('packages')
.listSync()
.whereType<Directory>()
.where(
(directory) => Directory('${directory.path}/test').existsSync(),
(directory) => !_excludedPackages.contains(_packageName(directory)),
)
.toList()
..sort((a, b) => a.path.compareTo(b.path));

for (final package in packages) {
await _run('flutter', [
'analyze',
'--no-fatal-infos',
'doc',
...packages.map((directory) => directory.path),
]);

// Golden and rendering tests are platform-sensitive, so the full per-package
// test suites only run on Linux, where the golden files are generated.
if (!Platform.isLinux) {
return;
}

for (final package in packages.where(
(directory) => Directory('${directory.path}/test').existsSync(),
)) {
stdout.writeln('Running tests in ${package.path}');
await _run('flutter', ['test'], workingDirectory: package.path);
}
}

String _packageName(Directory directory) =>
directory.path.split(Platform.pathSeparator).last;

Future<void> _run(
String executable,
List<String> arguments, {
Expand Down
Loading