Revert "SERVER-111758 Remove duplicates when --test_tag_filters=mongo_unittest is set (#42022)" (#42111)

Co-authored-by: auto-revert-processor <devprod-si-team@mongodb.com>
GitOrigin-RevId: 4ee152e8494b9f4347cf87c663d98bbf62ac396f
This commit is contained in:
auto-revert-app[bot] 2025-10-01 22:28:24 -07:00 committed by MongoDB Bot
parent d0024cffcc
commit 1d9473a008
9 changed files with 15 additions and 18 deletions

View File

@ -309,7 +309,7 @@
"id": "runTargets",
"command": "shellCommand.execute",
"args": {
"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'",
"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'",
"cwd": "${workspaceFolder}",
"taskId": "runTargets",
"rememberPrevious": true,

View File

@ -37,7 +37,7 @@ TEST_TAGS = {
"mongo_benchmark": 1,
"mongo_fuzzer_test": 1,
"mongo_integration_test": 1,
"mongo_unittest_target": 1,
"mongo_unittest": 1,
"mongo_unittest_first_group": 1,
"mongo_unittest_second_group": 1,
"mongo_unittest_third_group": 1,

View File

@ -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_binary"],
tags = original_tags + ["final_target"],
enabled = SEPARATE_DEBUG_ENABLED,
enable_pdb = PDB_GENERATION_ENABLED,
deps = all_deps,
@ -839,15 +839,12 @@ 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 = final_binary_tags,
tags = original_tags + ["final_target"],
enabled = SEPARATE_DEBUG_ENABLED,
enable_pdb = PDB_GENERATION_ENABLED,
deps = all_deps,
@ -856,7 +853,7 @@ def _mongo_cc_binary_and_test(
)
native.sh_test(
name = name + "_remote_exec_wrapper",
name = name + "_remote_exec",
srcs = [
"//bazel:test_wrapper",
],
@ -1075,7 +1072,7 @@ def mongo_cc_unit_test(
header_deps = header_deps,
visibility = visibility,
data = data,
tags = tags + ["mongo_unittest_target"],
tags = tags + ["mongo_unittest"],
copts = copts,
linkopts = linkopts,
includes = includes,

View File

@ -7,7 +7,7 @@ bazel_tags_to_autogenerate = [
"mongo_benchmark",
"mongo_fuzzer_test",
"mongo_integration_test",
"mongo_unittest_target",
"mongo_unittest",
"mongo_unittest_first_group",
"mongo_unittest_second_group",
"mongo_unittest_third_group",

View File

@ -239,7 +239,7 @@ def validate_bazel_groups(generate_report, fix):
[
bazel_bin,
"query",
'kind(extract_debug, attr(tags, "[\[ ]mongo_unittest_target[,\]]", //src/...))',
'kind(extract_debug, attr(tags, "[\[ ]mongo_unittest[,\]]", //src/...))',
]
+ query_opts,
capture_output=True,

View File

@ -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_wrapper", "")
test_file = testcase.attrib["name"].replace("_remote_exec", "")
if testcase.find("error") is not None:
status = "fail"

View File

@ -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_wrapper", "")
failed_test.replace("_remote_exec", "")
for failed_test in failed_tests
if "_remote_exec_wrapper" in failed_test
if "_remote_exec" in failed_test
]
for failed_test in failed_tests:
full_binary_path = bazel_bin_dir / failed_test

View File

@ -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_target,mongo_binary,mongo_benchmark,mongo_integration_test
--build_tag_filters=-mongo_unittest,mongo_binary,mongo_benchmark,mongo_integration_test
--linkopt=-s
task_compile_flags: ${compile_all_but_not_unittests_flags|--linkopt=-s}

View File

@ -800,7 +800,7 @@ tasks:
target: >-
//src/mongo/...
args: >-
--test_tag_filters=mongo_unittest_target_debug,-final_binary,-code_coverage_quarantine_debug
--test_tag_filters=mongo_unittest_debug,-final_target,-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_target,-final_binary,-intermediate_debug,-incompatible_with_bazel_remote_test
--build_tag_filters=mongo_unittest_target,-incompatible_with_bazel_remote_test
--test_tag_filters=mongo_unittest,-final_target,-intermediate_debug,-incompatible_with_bazel_remote_test
--build_tag_filters=mongo_unittest,-incompatible_with_bazel_remote_test
- name: unit_tests_remote_exec_incompatible
tags: ["assigned_to_jira_team_devprod_correctness", "auxiliary"]