mirror of https://github.com/mongodb/mongo
SERVER-111758 Remove duplicates when --test_tag_filters=mongo_unittest is set (#42022)
GitOrigin-RevId: e60515694c6991361a7af04c83827984adc78bd5
This commit is contained in:
parent
63f381fb18
commit
33caaae466
|
|
@ -309,7 +309,7 @@
|
|||
"id": "runTargets",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": "bazel query 'attr(tags, \"mongo_binary\", //...)' union 'attr(tags, \"mongo_unittest\", //...)' | grep mongo | grep -v \"_with_debug\" | grep -v third_party | sed 's;//;bazel-bin/;g' | sed 's;:;/;g'",
|
||||
"command": "bazel query 'attr(tags, \"mongo_binary\", //...)' union 'attr(tags, \"mongo_unittest_target\", //...)' | grep mongo | grep -v \"_with_debug\" | grep -v third_party | sed 's;//;bazel-bin/;g' | sed 's;:;/;g'",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"taskId": "runTargets",
|
||||
"rememberPrevious": true,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ TEST_TAGS = {
|
|||
"mongo_benchmark": 1,
|
||||
"mongo_fuzzer_test": 1,
|
||||
"mongo_integration_test": 1,
|
||||
"mongo_unittest": 1,
|
||||
"mongo_unittest_target": 1,
|
||||
"mongo_unittest_first_group": 1,
|
||||
"mongo_unittest_second_group": 1,
|
||||
"mongo_unittest_third_group": 1,
|
||||
|
|
|
|||
|
|
@ -831,7 +831,7 @@ def _mongo_cc_binary_and_test(
|
|||
name = name,
|
||||
binary_with_debug = ":" + name + WITH_DEBUG_SUFFIX,
|
||||
type = "program",
|
||||
tags = original_tags + ["final_target"],
|
||||
tags = original_tags + ["final_binary"],
|
||||
enabled = SEPARATE_DEBUG_ENABLED,
|
||||
enable_pdb = PDB_GENERATION_ENABLED,
|
||||
deps = all_deps,
|
||||
|
|
@ -839,12 +839,15 @@ def _mongo_cc_binary_and_test(
|
|||
exec_properties = exec_properties,
|
||||
)
|
||||
else:
|
||||
final_binary_tags = original_tags + ["final_binary"]
|
||||
if "mongo_unittest_target" in final_binary_tags:
|
||||
final_binary_tags += ["mongo_unittest"]
|
||||
native.cc_test(**args)
|
||||
extract_debuginfo_test(
|
||||
name = name,
|
||||
binary_with_debug = ":" + name + WITH_DEBUG_SUFFIX,
|
||||
type = "program",
|
||||
tags = original_tags + ["final_target"],
|
||||
tags = final_binary_tags,
|
||||
enabled = SEPARATE_DEBUG_ENABLED,
|
||||
enable_pdb = PDB_GENERATION_ENABLED,
|
||||
deps = all_deps,
|
||||
|
|
@ -853,7 +856,7 @@ def _mongo_cc_binary_and_test(
|
|||
)
|
||||
|
||||
native.sh_test(
|
||||
name = name + "_remote_exec",
|
||||
name = name + "_remote_exec_wrapper",
|
||||
srcs = [
|
||||
"//bazel:test_wrapper",
|
||||
],
|
||||
|
|
@ -1072,7 +1075,7 @@ def mongo_cc_unit_test(
|
|||
header_deps = header_deps,
|
||||
visibility = visibility,
|
||||
data = data,
|
||||
tags = tags + ["mongo_unittest"],
|
||||
tags = tags + ["mongo_unittest_target"],
|
||||
copts = copts,
|
||||
linkopts = linkopts,
|
||||
includes = includes,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ bazel_tags_to_autogenerate = [
|
|||
"mongo_benchmark",
|
||||
"mongo_fuzzer_test",
|
||||
"mongo_integration_test",
|
||||
"mongo_unittest",
|
||||
"mongo_unittest_target",
|
||||
"mongo_unittest_first_group",
|
||||
"mongo_unittest_second_group",
|
||||
"mongo_unittest_third_group",
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ def validate_bazel_groups(generate_report, fix):
|
|||
[
|
||||
bazel_bin,
|
||||
"query",
|
||||
'kind(extract_debug, attr(tags, "[\[ ]mongo_unittest[,\]]", //src/...))',
|
||||
'kind(extract_debug, attr(tags, "[\[ ]mongo_unittest_target[,\]]", //src/...))',
|
||||
]
|
||||
+ query_opts,
|
||||
capture_output=True,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ def main(testlog_dir: str):
|
|||
testcase = testsuite.find("testcase")
|
||||
|
||||
# Replace part of the name added by the remote test wrapper script
|
||||
test_file = testcase.attrib["name"].replace("_remote_exec", "")
|
||||
test_file = testcase.attrib["name"].replace("_remote_exec_wrapper", "")
|
||||
|
||||
if testcase.find("error") is not None:
|
||||
status = "fail"
|
||||
|
|
|
|||
|
|
@ -59,9 +59,9 @@ def _copy_bins_to_upload(failed_tests: List[str], upload_bin_dir: str, upload_li
|
|||
# Search both in the top level remote exec shellscript wrapper output directory, and in the
|
||||
# binary output directory.
|
||||
failed_tests += [
|
||||
failed_test.replace("_remote_exec", "")
|
||||
failed_test.replace("_remote_exec_wrapper", "")
|
||||
for failed_test in failed_tests
|
||||
if "_remote_exec" in failed_test
|
||||
if "_remote_exec_wrapper" in failed_test
|
||||
]
|
||||
for failed_test in failed_tests:
|
||||
full_binary_path = bazel_bin_dir / failed_test
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ tasks:
|
|||
# compiled. We therefore link them without debug symbols to compile them faster.
|
||||
bazel_args: >-
|
||||
--config=evg
|
||||
--build_tag_filters=-mongo_unittest,mongo_binary,mongo_benchmark,mongo_integration_test
|
||||
--build_tag_filters=-mongo_unittest_target,mongo_binary,mongo_benchmark,mongo_integration_test
|
||||
--linkopt=-s
|
||||
task_compile_flags: ${compile_all_but_not_unittests_flags|--linkopt=-s}
|
||||
|
||||
|
|
|
|||
|
|
@ -800,7 +800,7 @@ tasks:
|
|||
target: >-
|
||||
//src/mongo/...
|
||||
args: >-
|
||||
--test_tag_filters=mongo_unittest_debug,-final_target,-code_coverage_quarantine_debug
|
||||
--test_tag_filters=mongo_unittest_target_debug,-final_binary,-code_coverage_quarantine_debug
|
||||
--test_timeout=600
|
||||
--verbose_failures
|
||||
--instrumentation_filter="^//src/mongo[/:],-^//src/mongo/util:boost_assert_shim,-^//src/mongo/util:icu,-^//src/mongo/db/modules/enterprise/src/streams[/:]"
|
||||
|
|
@ -1043,8 +1043,8 @@ tasks:
|
|||
bazel_args: >-
|
||||
--config=evg
|
||||
--linkstatic=False
|
||||
--test_tag_filters=mongo_unittest,-final_target,-intermediate_debug,-incompatible_with_bazel_remote_test
|
||||
--build_tag_filters=mongo_unittest,-incompatible_with_bazel_remote_test
|
||||
--test_tag_filters=mongo_unittest_target,-final_binary,-intermediate_debug,-incompatible_with_bazel_remote_test
|
||||
--build_tag_filters=mongo_unittest_target,-incompatible_with_bazel_remote_test
|
||||
|
||||
- name: unit_tests_remote_exec_incompatible
|
||||
tags: ["assigned_to_jira_team_devprod_correctness", "auxiliary"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue