ci: run unittests on clean Chromium (#15125)
* ci: run unittests on clean Chromium * test: add '--run-only-disabled-tests' flag to "script/native-tests.py" * ci: add a job to run only disabled unittests * test: use a different GN config for the native tests * test: enable blink_common_unittests * test: disable WeakPtrDeathTest*
This commit is contained in:
parent
13247e592b
commit
5e199152e2
7 changed files with 167 additions and 99 deletions
|
@ -42,13 +42,13 @@ env-stack-dumping: &env-stack-dumping
|
||||||
ELECTRON_ENABLE_STACK_DUMPING: '1'
|
ELECTRON_ENABLE_STACK_DUMPING: '1'
|
||||||
|
|
||||||
env-browsertests: &env-browsertests
|
env-browsertests: &env-browsertests
|
||||||
GN_EXTRA_ARGS: 'is_component_ffmpeg = false'
|
GN_CONFIG: //electron/build/args/native_tests.gn
|
||||||
BUILD_TARGET: electron:chromium_browsertests
|
BUILD_TARGET: electron/spec:chromium_browsertests
|
||||||
TESTS_CONFIG: src/electron/spec/configs/browsertests.yml
|
TESTS_CONFIG: src/electron/spec/configs/browsertests.yml
|
||||||
|
|
||||||
env-unittests: &env-unittests
|
env-unittests: &env-unittests
|
||||||
GN_EXTRA_ARGS: 'is_component_ffmpeg = false'
|
GN_CONFIG: //electron/build/args/native_tests.gn
|
||||||
BUILD_TARGET: electron:chromium_unittests
|
BUILD_TARGET: electron/spec:chromium_unittests
|
||||||
TESTS_CONFIG: src/electron/spec/configs/unittests.yml
|
TESTS_CONFIG: src/electron/spec/configs/unittests.yml
|
||||||
|
|
||||||
# Build targets options.
|
# Build targets options.
|
||||||
|
@ -598,7 +598,8 @@ steps-native-tests: &steps-native-tests
|
||||||
python src/electron/script/native-tests.py run \
|
python src/electron/script/native-tests.py run \
|
||||||
--config $TESTS_CONFIG \
|
--config $TESTS_CONFIG \
|
||||||
--tests-dir src/out/Default \
|
--tests-dir src/out/Default \
|
||||||
--output-dir test_results
|
--output-dir test_results \
|
||||||
|
$TESTS_ARGS
|
||||||
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: test_results
|
path: test_results
|
||||||
|
@ -723,6 +724,12 @@ jobs:
|
||||||
<<: *machine-linux-2xlarge
|
<<: *machine-linux-2xlarge
|
||||||
<<: *steps-checkout
|
<<: *steps-checkout
|
||||||
|
|
||||||
|
linux-x64-checkout-no-patches:
|
||||||
|
<<: *machine-linux-2xlarge
|
||||||
|
environment:
|
||||||
|
GCLIENT_EXTRA_ARGS: '--custom-var=apply_patches=False'
|
||||||
|
<<: *steps-checkout
|
||||||
|
|
||||||
# Layer 2: Builds.
|
# Layer 2: Builds.
|
||||||
linux-x64-debug:
|
linux-x64-debug:
|
||||||
<<: *machine-linux-2xlarge
|
<<: *machine-linux-2xlarge
|
||||||
|
@ -956,7 +963,23 @@ jobs:
|
||||||
<<: *machine-linux-2xlarge
|
<<: *machine-linux-2xlarge
|
||||||
environment:
|
environment:
|
||||||
<<: *env-unittests
|
<<: *env-unittests
|
||||||
<<: *env-testing-build
|
<<: *env-enable-sccache
|
||||||
|
<<: *env-headless-testing
|
||||||
|
<<: *steps-native-tests
|
||||||
|
|
||||||
|
linux-x64-disabled-unittests:
|
||||||
|
<<: *machine-linux-2xlarge
|
||||||
|
environment:
|
||||||
|
<<: *env-unittests
|
||||||
|
<<: *env-enable-sccache
|
||||||
|
<<: *env-headless-testing
|
||||||
|
TESTS_ARGS: '--run-only-disabled-tests'
|
||||||
|
<<: *steps-native-tests
|
||||||
|
|
||||||
|
linux-x64-chromium-unittests:
|
||||||
|
<<: *machine-linux-2xlarge
|
||||||
|
environment:
|
||||||
|
<<: *env-unittests
|
||||||
<<: *env-enable-sccache
|
<<: *env-enable-sccache
|
||||||
<<: *env-headless-testing
|
<<: *env-headless-testing
|
||||||
<<: *steps-native-tests
|
<<: *steps-native-tests
|
||||||
|
@ -1234,3 +1257,13 @@ workflows:
|
||||||
- linux-x64-unittests:
|
- linux-x64-unittests:
|
||||||
requires:
|
requires:
|
||||||
- linux-x64-checkout
|
- linux-x64-checkout
|
||||||
|
|
||||||
|
- linux-x64-disabled-unittests:
|
||||||
|
requires:
|
||||||
|
- linux-x64-checkout
|
||||||
|
|
||||||
|
- linux-x64-checkout-no-patches
|
||||||
|
|
||||||
|
- linux-x64-chromium-unittests:
|
||||||
|
requires:
|
||||||
|
- linux-x64-checkout-no-patches
|
||||||
|
|
69
BUILD.gn
69
BUILD.gn
|
@ -810,75 +810,6 @@ if (is_mac) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
group("electron_tests") {
|
|
||||||
testonly = true
|
|
||||||
|
|
||||||
deps = [
|
|
||||||
":chromium_browsertests",
|
|
||||||
":chromium_unittests",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
group("chromium_unittests") {
|
|
||||||
testonly = true
|
|
||||||
|
|
||||||
deps = [
|
|
||||||
"//base:base_unittests",
|
|
||||||
"//cc:cc_unittests",
|
|
||||||
"//content/test:content_unittests",
|
|
||||||
"//crypto:crypto_unittests",
|
|
||||||
"//device:device_unittests",
|
|
||||||
"//gin:gin_unittests",
|
|
||||||
"//gpu:gpu_unittests",
|
|
||||||
"//ipc:ipc_tests",
|
|
||||||
"//media:media_unittests",
|
|
||||||
"//media/capture:capture_unittests",
|
|
||||||
"//media/midi:midi_unittests",
|
|
||||||
"//media/mojo:media_mojo_unittests",
|
|
||||||
"//mojo:mojo_unittests",
|
|
||||||
"//net:net_unittests",
|
|
||||||
"//ppapi:ppapi_unittests",
|
|
||||||
"//skia:skia_unittests",
|
|
||||||
"//sql:sql_unittests",
|
|
||||||
"//storage:storage_unittests",
|
|
||||||
"//third_party/angle/src/tests:angle_unittests",
|
|
||||||
"//third_party/blink/public:all_blink",
|
|
||||||
"//third_party/blink/public:test_support",
|
|
||||||
"//third_party/leveldatabase:env_chromium_unittests",
|
|
||||||
"//ui/base:ui_base_unittests",
|
|
||||||
"//ui/compositor:compositor_unittests",
|
|
||||||
"//ui/display:display_unittests",
|
|
||||||
"//ui/events:events_unittests",
|
|
||||||
"//ui/gl:gl_unittests",
|
|
||||||
"//url:url_unittests",
|
|
||||||
"//url/ipc:url_ipc_unittests",
|
|
||||||
"//v8/test/unittests:unittests",
|
|
||||||
]
|
|
||||||
|
|
||||||
if (enable_basic_printing) {
|
|
||||||
deps += [ "//printing:printing_unittests" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_linux) {
|
|
||||||
deps += [
|
|
||||||
"//net:disk_cache_memory_test",
|
|
||||||
"//sandbox/linux:sandbox_linux_unittests",
|
|
||||||
]
|
|
||||||
|
|
||||||
if (use_dbus) {
|
|
||||||
deps += [ "//dbus:dbus_unittests" ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
group("chromium_browsertests") {
|
|
||||||
testonly = true
|
|
||||||
|
|
||||||
deps = [
|
|
||||||
"//content/test:content_browsertests",
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
template("dist_zip") {
|
template("dist_zip") {
|
||||||
_runtime_deps_target = "${target_name}__deps"
|
_runtime_deps_target = "${target_name}__deps"
|
||||||
_runtime_deps_file =
|
_runtime_deps_file =
|
||||||
|
|
8
build/args/native_tests.gn
Normal file
8
build/args/native_tests.gn
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
root_extra_deps = [ "//electron/spec" ]
|
||||||
|
|
||||||
|
dcheck_always_on = true
|
||||||
|
is_debug = false
|
||||||
|
is_component_build = false
|
||||||
|
is_component_ffmpeg = false
|
||||||
|
symbol_level = 1
|
||||||
|
use_jumbo_build = true
|
|
@ -87,7 +87,8 @@ class TestsList():
|
||||||
supported_binaries = filter(self.__platform_supports, all_binaries)
|
supported_binaries = filter(self.__platform_supports, all_binaries)
|
||||||
return supported_binaries
|
return supported_binaries
|
||||||
|
|
||||||
def run(self, binaries, output_dir=None, verbosity=Verbosity.CHATTY):
|
def run(self, binaries, output_dir=None, verbosity=Verbosity.CHATTY,
|
||||||
|
run_only_disabled_tests=False):
|
||||||
# Don't run anything twice.
|
# Don't run anything twice.
|
||||||
binaries = set(binaries)
|
binaries = set(binaries)
|
||||||
|
|
||||||
|
@ -105,14 +106,19 @@ class TestsList():
|
||||||
binary_name, Platform.get_current()))
|
binary_name, Platform.get_current()))
|
||||||
|
|
||||||
suite_returncode = sum(
|
suite_returncode = sum(
|
||||||
[self.__run(binary, output_dir, verbosity) for binary in binaries])
|
[self.__run(binary, output_dir, verbosity, run_only_disabled_tests)
|
||||||
|
for binary in binaries])
|
||||||
return suite_returncode
|
return suite_returncode
|
||||||
|
|
||||||
def run_only(self, binary_name, output_dir=None, verbosity=Verbosity.CHATTY):
|
def run_only(self, binary_name, output_dir=None, verbosity=Verbosity.CHATTY,
|
||||||
return self.run([binary_name], output_dir, verbosity)
|
run_only_disabled_tests=False):
|
||||||
|
return self.run([binary_name], output_dir, verbosity,
|
||||||
|
run_only_disabled_tests)
|
||||||
|
|
||||||
def run_all(self, output_dir=None, verbosity=Verbosity.CHATTY):
|
def run_all(self, output_dir=None, verbosity=Verbosity.CHATTY,
|
||||||
return self.run(self.get_for_current_platform(), output_dir, verbosity)
|
run_only_disabled_tests=False):
|
||||||
|
return self.run(self.get_for_current_platform(), output_dir, verbosity,
|
||||||
|
run_only_disabled_tests)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_tests_list(config_path):
|
def __get_tests_list(config_path):
|
||||||
|
@ -169,7 +175,7 @@ class TestsList():
|
||||||
|
|
||||||
binary_name = data_item.keys()[0]
|
binary_name = data_item.keys()[0]
|
||||||
test_data = {
|
test_data = {
|
||||||
'excluded_tests': None,
|
'excluded_tests': [],
|
||||||
'platforms': Platform.get_all()
|
'platforms': Platform.get_all()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,16 +199,26 @@ class TestsList():
|
||||||
|
|
||||||
return (binary_name, test_data)
|
return (binary_name, test_data)
|
||||||
|
|
||||||
def __run(self, binary_name, output_dir, verbosity):
|
def __run(self, binary_name, output_dir, verbosity,
|
||||||
|
run_only_disabled_tests):
|
||||||
binary_path = os.path.join(self.tests_dir, binary_name)
|
binary_path = os.path.join(self.tests_dir, binary_name)
|
||||||
test_binary = TestBinary(binary_path)
|
test_binary = TestBinary(binary_path)
|
||||||
|
|
||||||
test_data = self.tests[binary_name]
|
test_data = self.tests[binary_name]
|
||||||
|
included_tests = []
|
||||||
excluded_tests = test_data['excluded_tests']
|
excluded_tests = test_data['excluded_tests']
|
||||||
|
|
||||||
|
if run_only_disabled_tests and len(excluded_tests) == 0:
|
||||||
|
# There is nothing to run.
|
||||||
|
return 0
|
||||||
|
|
||||||
|
if run_only_disabled_tests:
|
||||||
|
included_tests, excluded_tests = excluded_tests, included_tests
|
||||||
|
|
||||||
output_file_path = TestsList.__get_output_path(binary_name, output_dir)
|
output_file_path = TestsList.__get_output_path(binary_name, output_dir)
|
||||||
|
|
||||||
return test_binary.run(excluded_tests=excluded_tests,
|
return test_binary.run(included_tests=included_tests,
|
||||||
|
excluded_tests=excluded_tests,
|
||||||
output_file_path=output_file_path,
|
output_file_path=output_file_path,
|
||||||
verbosity=verbosity)
|
verbosity=verbosity)
|
||||||
|
|
||||||
|
@ -221,9 +237,10 @@ class TestBinary():
|
||||||
def __init__(self, binary_path):
|
def __init__(self, binary_path):
|
||||||
self.binary_path = binary_path
|
self.binary_path = binary_path
|
||||||
|
|
||||||
def run(self, excluded_tests=None, output_file_path=None,
|
def run(self, included_tests=None, excluded_tests=None,
|
||||||
verbosity=Verbosity.CHATTY):
|
output_file_path=None, verbosity=Verbosity.CHATTY):
|
||||||
gtest_filter = TestBinary.__get_gtest_filter(excluded_tests)
|
gtest_filter = TestBinary.__get_gtest_filter(included_tests,
|
||||||
|
excluded_tests)
|
||||||
gtest_output = TestBinary.__get_gtest_output(output_file_path)
|
gtest_output = TestBinary.__get_gtest_output(output_file_path)
|
||||||
|
|
||||||
args = [self.binary_path, gtest_filter, gtest_output]
|
args = [self.binary_path, gtest_filter, gtest_output]
|
||||||
|
@ -241,12 +258,12 @@ class TestBinary():
|
||||||
return returncode
|
return returncode
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_gtest_filter(excluded_tests):
|
def __get_gtest_filter(included_tests, excluded_tests):
|
||||||
gtest_filter = ""
|
included_tests_string = TestBinary.__list_tests(included_tests)
|
||||||
if excluded_tests is not None and len(excluded_tests) > 0:
|
excluded_tests_string = TestBinary.__list_tests(excluded_tests)
|
||||||
excluded_tests_string = TestBinary.__format_excluded_tests(
|
|
||||||
excluded_tests)
|
gtest_filter = "--gtest_filter={}-{}".format(included_tests_string,
|
||||||
gtest_filter = "--gtest_filter={}".format(excluded_tests_string)
|
excluded_tests_string)
|
||||||
return gtest_filter
|
return gtest_filter
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -258,8 +275,10 @@ class TestBinary():
|
||||||
return gtest_output
|
return gtest_output
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __format_excluded_tests(excluded_tests):
|
def __list_tests(tests):
|
||||||
return "-" + ":".join(excluded_tests)
|
if tests is None:
|
||||||
|
return ''
|
||||||
|
return ':'.join(tests)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def __get_stdout_and_stderr(verbosity):
|
def __get_stdout_and_stderr(verbosity):
|
||||||
|
|
|
@ -25,6 +25,9 @@ def parse_args():
|
||||||
help='binaries to run')
|
help='binaries to run')
|
||||||
parser.add_argument('-c', '--config', required=True,
|
parser.add_argument('-c', '--config', required=True,
|
||||||
help='path to a tests config')
|
help='path to a tests config')
|
||||||
|
parser.add_argument('--run-only-disabled-tests',
|
||||||
|
action='store_true', default=False,
|
||||||
|
help='if disabled tests should be run')
|
||||||
parser.add_argument('-t', '--tests-dir', required=False,
|
parser.add_argument('-t', '--tests-dir', required=False,
|
||||||
help='path to a directory with test binaries')
|
help='path to a directory with test binaries')
|
||||||
parser.add_argument('-o', '--output-dir', required=False,
|
parser.add_argument('-o', '--output-dir', required=False,
|
||||||
|
@ -82,9 +85,11 @@ def main():
|
||||||
|
|
||||||
if args.command == Command.RUN:
|
if args.command == Command.RUN:
|
||||||
if args.binary is not None:
|
if args.binary is not None:
|
||||||
return tests_list.run(args.binary, args.output_dir, args.verbosity)
|
return tests_list.run(args.binary, args.output_dir, args.verbosity,
|
||||||
|
args.run_only_disabled_tests)
|
||||||
else:
|
else:
|
||||||
return tests_list.run_all(args.output_dir, args.verbosity)
|
return tests_list.run_all(args.output_dir, args.verbosity,
|
||||||
|
args.run_only_disabled_tests)
|
||||||
|
|
||||||
assert False, "unexpected command '{}'".format(args.command)
|
assert False, "unexpected command '{}'".format(args.command)
|
||||||
|
|
||||||
|
|
72
spec/BUILD.gn
Normal file
72
spec/BUILD.gn
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
import("//build/config/features.gni")
|
||||||
|
import("//printing/buildflags/buildflags.gni")
|
||||||
|
|
||||||
|
group("spec") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
":chromium_browsertests",
|
||||||
|
":chromium_unittests",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
group("chromium_unittests") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//base:base_unittests",
|
||||||
|
"//cc:cc_unittests",
|
||||||
|
"//content/test:content_unittests",
|
||||||
|
"//crypto:crypto_unittests",
|
||||||
|
"//device:device_unittests",
|
||||||
|
"//gin:gin_unittests",
|
||||||
|
"//gpu:gpu_unittests",
|
||||||
|
"//ipc:ipc_tests",
|
||||||
|
"//media:media_unittests",
|
||||||
|
"//media/capture:capture_unittests",
|
||||||
|
"//media/midi:midi_unittests",
|
||||||
|
"//media/mojo:media_mojo_unittests",
|
||||||
|
"//mojo:mojo_unittests",
|
||||||
|
"//net:net_unittests",
|
||||||
|
"//ppapi:ppapi_unittests",
|
||||||
|
"//printing:printing_unittests",
|
||||||
|
"//skia:skia_unittests",
|
||||||
|
"//sql:sql_unittests",
|
||||||
|
"//storage:storage_unittests",
|
||||||
|
"//third_party/angle/src/tests:angle_unittests",
|
||||||
|
"//third_party/blink/public:all_blink",
|
||||||
|
"//third_party/blink/public:test_support",
|
||||||
|
"//third_party/leveldatabase:env_chromium_unittests",
|
||||||
|
"//ui/base:ui_base_unittests",
|
||||||
|
"//ui/compositor:compositor_unittests",
|
||||||
|
"//ui/display:display_unittests",
|
||||||
|
"//ui/events:events_unittests",
|
||||||
|
"//ui/gl:gl_unittests",
|
||||||
|
"//url:url_unittests",
|
||||||
|
"//url/ipc:url_ipc_unittests",
|
||||||
|
"//v8/test/unittests:unittests",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (enable_basic_printing) {
|
||||||
|
deps += [ "//printing:printing_unittests" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_linux) {
|
||||||
|
deps += [
|
||||||
|
"//net:disk_cache_memory_test",
|
||||||
|
"//sandbox/linux:sandbox_linux_unittests",
|
||||||
|
]
|
||||||
|
|
||||||
|
if (use_dbus) {
|
||||||
|
deps += [ "//dbus:dbus_unittests" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group("chromium_browsertests") {
|
||||||
|
testonly = true
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
"//content/test:content_browsertests",
|
||||||
|
]
|
||||||
|
}
|
|
@ -10,6 +10,7 @@ tests:
|
||||||
- RTLTest*
|
- RTLTest*
|
||||||
- SysStrings*
|
- SysStrings*
|
||||||
- UTFOffsetStringConversionsTest*
|
- UTFOffsetStringConversionsTest*
|
||||||
|
- WeakPtrDeathTest*
|
||||||
- cc_unittests
|
- cc_unittests
|
||||||
- cc_blink_unittests
|
- cc_blink_unittests
|
||||||
- content_unittests:
|
- content_unittests:
|
||||||
|
@ -75,8 +76,7 @@ tests:
|
||||||
# TODO(alexeykuzmin): Should it be fixed?
|
# TODO(alexeykuzmin): Should it be fixed?
|
||||||
- LiveRangeUnitTest*
|
- LiveRangeUnitTest*
|
||||||
# Blink
|
# Blink
|
||||||
# TODO: Enable in Ch68.
|
- blink_common_unittests
|
||||||
# - blink_common_unittests
|
|
||||||
- blink_heap_unittests
|
- blink_heap_unittests
|
||||||
- blink_platform_unittests:
|
- blink_platform_unittests:
|
||||||
disabled:
|
disabled:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue