Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9eed783

Browse files
authored
Selectively enable tests that work on Windows and file issues for ones that don't. (#9852)
This is in preparation for the tryjobs to run these tests. The LUCI harness will also be updated so that the tests to run are specified in the repo instead of the recipe.
1 parent 7ae3c3e commit 9eed783

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

runtime/dart_lifecycle_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ TEST_F(DartLifecycleTest, ShuttingDownTheVMShutsDownAllIsolates) {
121121
ASSERT_TRUE(DartVMRef::IsInstanceRunning());
122122
ASSERT_EQ(last_launch_count + 1, DartVM::GetVMLaunchCount());
123123

124-
const size_t isolate_count = 100;
124+
const size_t isolate_count = 5;
125125

126126
fml::CountDownLatch latch(isolate_count);
127127
auto vm_data = vm_ref.GetVMData();

testing/run_tests.py

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,55 +22,77 @@
2222
time_sensitve_test_flag = '--gtest_filter="-*TimeSensitiveTest*"'
2323

2424
def IsMac():
25-
sys.platform == 'darwin'
25+
return sys.platform == 'darwin'
2626

2727

2828
def IsLinux():
29-
sys.platform.startswith('linux')
29+
return sys.platform.startswith('linux')
3030

3131

3232
def IsWindows():
33-
sys.platform.startswith(('cygwin', 'win'))
33+
return sys.platform.startswith(('cygwin', 'win'))
34+
35+
36+
def ExecutableSuffix():
37+
return '.exe' if IsWindows() else ''
38+
39+
def FindExecutablePath(path):
40+
if os.path.exists(path):
41+
return path
42+
43+
if IsWindows():
44+
exe_path = path + '.exe'
45+
if os.path.exists(exe_path):
46+
return exe_path
47+
48+
bat_path = path + '.bat'
49+
if os.path.exists(bat_path):
50+
return bat_path
51+
52+
raise Exception('Executable %s does not exist!' % path)
3453

3554

3655
def RunEngineExecutable(build_dir, executable_name, filter, flags=[], cwd=buildroot_dir):
3756
if not filter in executable_name:
3857
print 'Skipping %s due to filter.' % executable_name
3958
return
4059

41-
print 'Running %s in %s' % (executable_name, cwd)
42-
43-
executable = os.path.join(build_dir, executable_name)
44-
assert os.path.exists(executable), '%s does not exist!' % executable
60+
executable = FindExecutablePath(os.path.join(build_dir, executable_name))
4561

62+
print 'Running %s in %s' % (executable_name, cwd)
4663
test_command = [ executable ] + flags
47-
print ' '.join(test_command)
48-
64+
print ' '.join(test_command)
4965
subprocess.check_call(test_command, cwd=cwd)
5066

5167

5268
def RunCCTests(build_dir, filter):
53-
print "Running Engine Unit-tests."
69+
print "Running Engine Unit-tests."
5470

5571
RunEngineExecutable(build_dir, 'client_wrapper_glfw_unittests', filter)
5672

5773
RunEngineExecutable(build_dir, 'client_wrapper_unittests', filter)
5874

59-
RunEngineExecutable(build_dir, 'embedder_unittests', filter)
75+
# https://github.com/flutter/flutter/issues/36294
76+
if not IsWindows():
77+
RunEngineExecutable(build_dir, 'embedder_unittests', filter)
6078

6179
RunEngineExecutable(build_dir, 'flow_unittests', filter)
6280

6381
RunEngineExecutable(build_dir, 'fml_unittests', filter, [ time_sensitve_test_flag ])
6482

6583
RunEngineExecutable(build_dir, 'runtime_unittests', filter)
6684

67-
RunEngineExecutable(build_dir, 'shell_unittests', filter)
85+
# https://github.com/flutter/flutter/issues/36295
86+
if not IsWindows():
87+
RunEngineExecutable(build_dir, 'shell_unittests', filter)
6888

6989
RunEngineExecutable(build_dir, 'ui_unittests', filter)
7090

91+
# These unit-tests are Objective-C and can only run on Darwin.
7192
if IsMac():
7293
RunEngineExecutable(build_dir, 'flutter_channels_unittests', filter)
7394

95+
# https://github.com/flutter/flutter/issues/36296
7496
if IsLinux():
7597
RunEngineExecutable(build_dir, 'txt_unittests', filter, [ fonts_dir_flag ])
7698

@@ -146,7 +168,7 @@ def EnsureDebugUnoptSkyPackagesAreBuilt():
146168
variant_out_dir = os.path.join(out_dir, 'host_debug_unopt')
147169

148170
ninja_command = [
149-
'autoninja',
171+
'ninja',
150172
'-C',
151173
variant_out_dir,
152174
'flutter/sky/packages'
@@ -176,7 +198,7 @@ def RunDartTests(build_dir, filter):
176198
EnsureDebugUnoptSkyPackagesAreBuilt();
177199

178200
# Now that we have the Sky packages at the hardcoded location, run `pub get`.
179-
RunPubGet(build_dir, dart_tests_dir)
201+
RunEngineExecutable(build_dir, os.path.join('dart-sdk', 'bin', 'pub'), '', flags=['get'], cwd=dart_tests_dir)
180202

181203
dart_tests = glob.glob('%s/*.dart' % dart_tests_dir)
182204

@@ -192,10 +214,12 @@ def RunTests(build_dir, filter, run_engine_tests, run_dart_tests, run_benchmarks
192214
if run_engine_tests:
193215
RunCCTests(build_dir, filter)
194216

195-
if run_dart_tests:
217+
# https://github.com/flutter/flutter/issues/36301
218+
if run_dart_tests and not IsWindows():
196219
RunDartTests(build_dir, filter)
197220

198-
if run_benchmarks:
221+
# https://github.com/flutter/flutter/issues/36300
222+
if run_benchmarks and not IsWindows():
199223
RunEngineBenchmarks(build_dir, filter)
200224

201225

0 commit comments

Comments
 (0)