From 1d9473a0082141752ebd4fff151441623524fe96 Mon Sep 17 00:00:00 2001 From: "auto-revert-app[bot]" <166078896+auto-revert-app[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 22:28:24 -0700 Subject: [PATCH] Revert "SERVER-111758 Remove duplicates when --test_tag_filters=mongo_unittest is set (#42022)" (#42111) Co-authored-by: auto-revert-processor GitOrigin-RevId: 4ee152e8494b9f4347cf87c663d98bbf62ac396f --- .../linux-virtual-workstation.code-workspace | 2 +- bazel/install_rules/install_rules.bzl | 2 +- bazel/mongo_src_rules.bzl | 11 ++++------- bazel/wrapper_hook/autogenerated_targets.py | 2 +- buildscripts/bazel_custom_formatter.py | 2 +- buildscripts/create_bazel_test_report.py | 2 +- buildscripts/gather_failed_unittests.py | 4 ++-- etc/evergreen_yml_components/tasks/compile_tasks.yml | 2 +- etc/evergreen_yml_components/tasks/misc_tasks.yml | 6 +++--- 9 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.vscode_defaults/linux-virtual-workstation.code-workspace b/.vscode_defaults/linux-virtual-workstation.code-workspace index d096fcb2034..f1fbe8d84d8 100644 --- a/.vscode_defaults/linux-virtual-workstation.code-workspace +++ b/.vscode_defaults/linux-virtual-workstation.code-workspace @@ -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, diff --git a/bazel/install_rules/install_rules.bzl b/bazel/install_rules/install_rules.bzl index 117c6bad31a..16e1307e93f 100644 --- a/bazel/install_rules/install_rules.bzl +++ b/bazel/install_rules/install_rules.bzl @@ -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, diff --git a/bazel/mongo_src_rules.bzl b/bazel/mongo_src_rules.bzl index 0c897cc6aa9..0462e1944c7 100644 --- a/bazel/mongo_src_rules.bzl +++ b/bazel/mongo_src_rules.bzl @@ -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, diff --git a/bazel/wrapper_hook/autogenerated_targets.py b/bazel/wrapper_hook/autogenerated_targets.py index e60566a43a9..cc05d217e6f 100644 --- a/bazel/wrapper_hook/autogenerated_targets.py +++ b/bazel/wrapper_hook/autogenerated_targets.py @@ -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", diff --git a/buildscripts/bazel_custom_formatter.py b/buildscripts/bazel_custom_formatter.py index d8ae656d921..59bb8937629 100644 --- a/buildscripts/bazel_custom_formatter.py +++ b/buildscripts/bazel_custom_formatter.py @@ -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, diff --git a/buildscripts/create_bazel_test_report.py b/buildscripts/create_bazel_test_report.py index 7f1eff7fd92..19299e7d2e9 100644 --- a/buildscripts/create_bazel_test_report.py +++ b/buildscripts/create_bazel_test_report.py @@ -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" diff --git a/buildscripts/gather_failed_unittests.py b/buildscripts/gather_failed_unittests.py index 63021cb1791..120d93576a3 100644 --- a/buildscripts/gather_failed_unittests.py +++ b/buildscripts/gather_failed_unittests.py @@ -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 diff --git a/etc/evergreen_yml_components/tasks/compile_tasks.yml b/etc/evergreen_yml_components/tasks/compile_tasks.yml index 8255aae7962..e74802bd6e3 100644 --- a/etc/evergreen_yml_components/tasks/compile_tasks.yml +++ b/etc/evergreen_yml_components/tasks/compile_tasks.yml @@ -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} diff --git a/etc/evergreen_yml_components/tasks/misc_tasks.yml b/etc/evergreen_yml_components/tasks/misc_tasks.yml index a7cf31081e9..35bad6b5774 100644 --- a/etc/evergreen_yml_components/tasks/misc_tasks.yml +++ b/etc/evergreen_yml_components/tasks/misc_tasks.yml @@ -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"]