[flutter_tools] Remove sound null safety flag #2
This commit is contained in:
committed by
GitHub
parent
484c22682b
commit
f4c3facfdd
@@ -573,9 +573,7 @@ Future<void> _runExampleProjectBuildTests(Directory exampleDirectory, [File? mai
|
||||
// Only verify caching with flutter gallery.
|
||||
final bool verifyCaching = exampleDirectory.path.contains('flutter_gallery');
|
||||
final String examplePath = path.relative(exampleDirectory.path, from: Directory.current.path);
|
||||
final bool hasNullSafety = File(path.join(examplePath, 'null_safety')).existsSync();
|
||||
final List<String> additionalArgs = <String>[
|
||||
if (hasNullSafety) '--no-sound-null-safety',
|
||||
if (mainFile != null) path.relative(mainFile.path, from: exampleDirectory.absolute.path),
|
||||
];
|
||||
if (Directory(path.join(examplePath, 'android')).existsSync()) {
|
||||
@@ -771,8 +769,6 @@ Future<void> _runAddToAppLifeCycleTests() async {
|
||||
}
|
||||
|
||||
Future<void> _runFrameworkTests() async {
|
||||
final List<String> soundNullSafetyOptions = <String>['--null-assertions', '--sound-null-safety'];
|
||||
final List<String> mixedModeNullSafetyOptions = <String>['--null-assertions', '--no-sound-null-safety'];
|
||||
final List<String> trackWidgetCreationAlternatives = <String>['--track-widget-creation', '--no-track-widget-creation'];
|
||||
|
||||
Future<void> runWidgets() async {
|
||||
@@ -780,7 +776,7 @@ Future<void> _runFrameworkTests() async {
|
||||
for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
|
||||
await _runFlutterTest(
|
||||
path.join(flutterRoot, 'packages', 'flutter'),
|
||||
options: <String>[trackWidgetCreationOption, ...soundNullSafetyOptions],
|
||||
options: <String>[trackWidgetCreationOption],
|
||||
tests: <String>[ path.join('test', 'widgets') + path.separator ],
|
||||
);
|
||||
}
|
||||
@@ -795,13 +791,13 @@ Future<void> _runFrameworkTests() async {
|
||||
// Run release mode tests (see packages/flutter/test_release/README.md)
|
||||
await _runFlutterTest(
|
||||
path.join(flutterRoot, 'packages', 'flutter'),
|
||||
options: <String>['--dart-define=dart.vm.product=true', ...soundNullSafetyOptions],
|
||||
options: <String>['--dart-define=dart.vm.product=true'],
|
||||
tests: <String>['test_release${path.separator}'],
|
||||
);
|
||||
// Run profile mode tests (see packages/flutter/test_profile/README.md)
|
||||
await _runFlutterTest(
|
||||
path.join(flutterRoot, 'packages', 'flutter'),
|
||||
options: <String>['--dart-define=dart.vm.product=false', '--dart-define=dart.vm.profile=true', ...soundNullSafetyOptions],
|
||||
options: <String>['--dart-define=dart.vm.product=false', '--dart-define=dart.vm.profile=true'],
|
||||
tests: <String>['test_profile${path.separator}'],
|
||||
);
|
||||
}
|
||||
@@ -817,7 +813,7 @@ Future<void> _runFrameworkTests() async {
|
||||
for (final String trackWidgetCreationOption in trackWidgetCreationAlternatives) {
|
||||
await _runFlutterTest(
|
||||
path.join(flutterRoot, 'packages', 'flutter'),
|
||||
options: <String>[trackWidgetCreationOption, ...soundNullSafetyOptions],
|
||||
options: <String>[trackWidgetCreationOption],
|
||||
tests: tests,
|
||||
);
|
||||
}
|
||||
@@ -837,9 +833,9 @@ Future<void> _runFrameworkTests() async {
|
||||
workingDirectory: path.join(flutterRoot, 'examples', 'api'),
|
||||
);
|
||||
}
|
||||
await _runFlutterTest(path.join(flutterRoot, 'examples', 'api'), options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'), options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'), options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'examples', 'api'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'));
|
||||
}
|
||||
|
||||
Future<void> runTracingTests() async {
|
||||
@@ -945,7 +941,6 @@ Future<void> _runFrameworkTests() async {
|
||||
|
||||
Future<void> runPrivateTests() async {
|
||||
final List<String> args = <String>[
|
||||
'--sound-null-safety',
|
||||
'run',
|
||||
'bin/test_private.dart',
|
||||
];
|
||||
@@ -989,17 +984,17 @@ Future<void> _runFrameworkTests() async {
|
||||
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'gen_defaults'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'dev', 'tools', 'gen_keycodes'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'dev', 'benchmarks', 'test_apps', 'stocks'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'), tests: <String>[path.join('test', 'src', 'real_tests')], options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'), tests: <String>[path.join('test', 'src', 'real_tests')]);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'integration_test'), options: <String>[
|
||||
'--enable-vmservice',
|
||||
// Web-specific tests depend on Chromium, so they run as part of the web_long_running_tests shard.
|
||||
'--exclude-tags=web',
|
||||
]);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_goldens'), options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'), options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'), options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol'), options: soundNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'non_nullable'), options: mixedModeNullSafetyOptions);
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_goldens'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_localizations'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'fuchsia_remote_debug_protocol'));
|
||||
await _runFlutterTest(path.join(flutterRoot, 'dev', 'integration_tests', 'non_nullable'));
|
||||
const String httpClientWarning =
|
||||
'Warning: At least one test in this suite creates an HttpClient. When\n'
|
||||
'running a test suite that uses TestWidgetsFlutterBinding, all HTTP\n'
|
||||
@@ -1229,7 +1224,7 @@ Future<void> _runWebLongRunningTests() async {
|
||||
() => _runWebDebugTest('lib/framework_stack_trace.dart'),
|
||||
() => _runWebDebugTest('lib/web_directory_loading.dart'),
|
||||
() => _runWebDebugTest('test/test.dart'),
|
||||
() => _runWebDebugTest('lib/null_safe_main.dart', enableNullSafety: true),
|
||||
() => _runWebDebugTest('lib/null_safe_main.dart'),
|
||||
() => _runWebDebugTest('lib/web_define_loading.dart',
|
||||
additionalArguments: <String>[
|
||||
'--dart-define=test.valueA=Example,A',
|
||||
@@ -1242,12 +1237,8 @@ Future<void> _runWebLongRunningTests() async {
|
||||
'--dart-define=test.valueB=Value',
|
||||
]
|
||||
),
|
||||
() => _runWebDebugTest('lib/sound_mode.dart', additionalArguments: <String>[
|
||||
'--sound-null-safety',
|
||||
]),
|
||||
() => _runWebReleaseTest('lib/sound_mode.dart', additionalArguments: <String>[
|
||||
'--sound-null-safety',
|
||||
]),
|
||||
() => _runWebDebugTest('lib/sound_mode.dart'),
|
||||
() => _runWebReleaseTest('lib/sound_mode.dart'),
|
||||
() => _runFlutterWebTest(
|
||||
'html',
|
||||
path.join(flutterRoot, 'packages', 'integration_test'),
|
||||
@@ -1306,7 +1297,6 @@ Future<void> _runFlutterDriverWebTest({
|
||||
if (driver != null) '--driver=$driver',
|
||||
'--target=$target',
|
||||
'--browser-name=chrome',
|
||||
'--no-sound-null-safety',
|
||||
'-d',
|
||||
'web-server',
|
||||
'--$buildMode',
|
||||
@@ -1348,7 +1338,6 @@ Future<void> _runWebTreeshakeTest() async {
|
||||
'build',
|
||||
'web',
|
||||
'--target=$target',
|
||||
'--no-sound-null-safety',
|
||||
'--profile',
|
||||
],
|
||||
workingDirectory: testAppDirectory,
|
||||
@@ -1574,7 +1563,6 @@ Future<void> _runGalleryE2eWebTest(String buildMode, { bool canvasKit = false })
|
||||
'--driver=test_driver/transitions_perf_e2e_test.dart',
|
||||
'--target=test_driver/transitions_perf_e2e.dart',
|
||||
'--browser-name=chrome',
|
||||
'--no-sound-null-safety',
|
||||
'-d',
|
||||
'web-server',
|
||||
'--$buildMode',
|
||||
@@ -1681,7 +1669,6 @@ Future<void> _runWebReleaseTest(String target, {
|
||||
///
|
||||
/// Instead, we use `flutter run --debug` and sniff out the standard output.
|
||||
Future<void> _runWebDebugTest(String target, {
|
||||
bool enableNullSafety = false,
|
||||
List<String> additionalArguments = const<String>[],
|
||||
}) async {
|
||||
final String testAppDirectory = path.join(flutterRoot, 'dev', 'integration_tests', 'web');
|
||||
@@ -1695,11 +1682,6 @@ Future<void> _runWebDebugTest(String target, {
|
||||
<String>[
|
||||
'run',
|
||||
'--debug',
|
||||
if (enableNullSafety)
|
||||
...<String>[
|
||||
'--no-sound-null-safety',
|
||||
'--null-assertions',
|
||||
],
|
||||
'-d',
|
||||
'chrome',
|
||||
'--web-run-headless',
|
||||
@@ -1742,7 +1724,6 @@ Future<void> _runFlutterWebTest(String webRenderer, String workingDirectory, Lis
|
||||
'--platform=chrome',
|
||||
'--web-renderer=$webRenderer',
|
||||
'--dart-define=DART_HHH_BOT=$_runningInDartHHHBot',
|
||||
'--sound-null-safety',
|
||||
...flutterTestArgs,
|
||||
...tests,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user