SERVER-126501: Add bazel targets for buildscripts tests (#53703)

GitOrigin-RevId: eeec1eaf457d23e5fd9e67dd10c171f65df0899b
This commit is contained in:
Sean Lyons 2026-05-15 12:25:10 -04:00 committed by MongoDB Bot
parent 4c636d3b94
commit b270115356
103 changed files with 1477 additions and 71 deletions

View File

@ -8,6 +8,7 @@ py_library(
"autogenerated_targets.py",
"check_resources.py",
"compiledb.py",
"compiledb_postprocess.py",
"engflow_check.py",
"generate_common_bes_bazelrc.py",
"git_age_check.py",
@ -19,7 +20,13 @@ py_library(
"wrapper_util.py",
"write_wrapper_hook_bazelrc.py",
],
data = [
"bazel_commands.commands",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:setup_clang_tidy",
],
)
py_library(

View File

@ -2,8 +2,7 @@ import json
import os
import pathlib
import tempfile
from urllib.parse import urlparse, unquote
from urllib.parse import unquote, urlparse
COMPILE_COMMAND_FRAGMENT_EXT = ".compile_command.json"

View File

@ -45,15 +45,19 @@ py_binary(
],
)
py_library(
name = "build_system_options",
srcs = ["build_system_options.py"],
visibility = ["//visibility:public"],
)
py_binary(
name = "mongosymb",
srcs = [
"build_system_options.py",
"mongosymb.py",
],
srcs = ["mongosymb.py"],
main = "mongosymb.py",
visibility = ["//visibility:public"],
deps = [
"//buildscripts:build_system_options",
"//buildscripts/util",
dependency(
"requests",
@ -311,13 +315,25 @@ py_binary(
"//buildscripts/patch_builds",
"//buildscripts/resmokelib",
dependency(
"structlog",
"click",
group = "evergreen",
),
dependency(
"gitpython",
group = "evergreen",
),
dependency(
"pydantic",
group = "evergreen",
),
dependency(
"pyyaml",
group = "core",
),
dependency(
"structlog",
group = "evergreen",
),
],
)
@ -421,6 +437,7 @@ py_binary(
py_binary(
name = "validate_evg_project_config",
srcs = ["validate_evg_project_config.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/ciconfig",
dependency(
@ -590,3 +607,237 @@ py_binary(
),
],
)
py_library(
name = "check_for_noexcept",
srcs = ["check_for_noexcept.py"],
visibility = ["//visibility:public"],
deps = [
dependency(
"gitpython",
group = "evergreen",
),
dependency(
"structlog",
group = "evergreen",
),
dependency(
"typer",
group = "core",
),
],
)
py_library(
name = "debugsymb_mapper",
srcs = ["debugsymb_mapper.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:build_system_options",
"//buildscripts/resmokelib",
"//buildscripts/util",
dependency(
"requests",
group = "core",
),
],
)
py_library(
name = "evergreen_activate_gen_tasks",
srcs = ["evergreen_activate_gen_tasks.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
dependency(
"click",
group = "evergreen",
),
dependency(
"requests",
group = "core",
),
dependency(
"structlog",
group = "evergreen",
),
dependency(
"pydantic",
group = "evergreen",
),
dependency(
"retry",
group = "testing",
),
dependency(
"evergreen-py",
group = "testing",
),
],
)
py_library(
name = "evergreen_resmoke_job_count",
srcs = ["evergreen_resmoke_job_count.py"],
visibility = ["//visibility:public"],
deps = [
dependency(
"psutil",
group = "build-metrics",
),
dependency(
"structlog",
group = "evergreen",
),
dependency(
"pyyaml",
group = "core",
),
],
)
py_library(
name = "evergreen_task_tags",
srcs = ["evergreen_task_tags.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/ciconfig",
],
)
py_library(
name = "feature_flag_tags_check",
srcs = ["feature_flag_tags_check.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_library(
name = "jepsen_report",
srcs = ["jepsen_report.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:simple_report",
dependency(
"click",
group = "evergreen",
),
dependency(
"typing-extensions",
group = "core",
),
],
)
py_library(
name = "package_test_internal",
srcs = ["package_test_internal.py"],
visibility = ["//visibility:public"],
)
py_library(
name = "packager",
srcs = ["packager.py"],
visibility = ["//visibility:public"],
deps = [
dependency(
"gitpython",
group = "evergreen",
),
],
)
py_library(
name = "powercycle_sentinel",
srcs = ["powercycle_sentinel.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
dependency(
"click",
group = "evergreen",
),
dependency(
"structlog",
group = "evergreen",
),
dependency(
"evergreen-py",
group = "testing",
),
],
)
py_library(
name = "sort_backport_multiversion",
srcs = ["sort_backport_multiversion.py"],
visibility = ["//visibility:public"],
deps = [
dependency(
"pyyaml",
group = "core",
),
],
)
py_library(
name = "validate_commit_message",
srcs = ["validate_commit_message.py"],
visibility = ["//visibility:public"],
deps = [
"@bazel_rules_mongo//utils:evergreen_git",
"@poetry//:library_pathspec",
dependency(
"requests",
group = "core",
),
dependency(
"structlog",
group = "evergreen",
),
dependency(
"typer",
group = "core",
),
dependency(
"gitpython",
group = "evergreen",
),
dependency(
"typing-extensions",
group = "core",
),
],
)
py_library(
name = "todo_check",
srcs = ["todo_check.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:validate_commit_message",
dependency(
"click",
group = "evergreen",
),
dependency(
"evergreen-py",
group = "testing",
),
],
)
py_library(
name = "validate_mongocryptd",
srcs = ["validate_mongocryptd.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/ciconfig",
dependency(
"pyyaml",
group = "core",
),
],
)

View File

@ -1,6 +1,26 @@
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_library")
py_library(
name = "jiraclient",
srcs = [
"__init__.py",
"jiraclient.py",
],
visibility = ["//visibility:public"],
deps = [
dependency(
"jira",
group = "jira-client",
),
dependency(
"pydantic",
group = "evergreen",
),
],
)
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),

View File

@ -1,4 +1,40 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_library")
py_library(
name = "monitor_build_status",
srcs = glob(["*.py"]),
visibility = ["//visibility:public"],
deps = [
"//buildscripts/client:jiraclient",
"//buildscripts/util",
dependency(
"jira",
group = "jira-client",
),
"@poetry//:library_python_dateutil",
dependency(
"requests",
group = "core",
),
dependency(
"structlog",
group = "evergreen",
),
dependency(
"tabulate",
group = "build-metrics",
),
dependency(
"typer",
group = "core",
),
dependency(
"typing-extensions",
group = "core",
),
],
)
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(

View File

@ -1,3 +1,4 @@
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_binary")
py_binary(
@ -8,6 +9,10 @@ py_binary(
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
"//buildscripts:resmoke",
dependency(
"inject",
group = "evergreen",
),
],
)

View File

@ -3,6 +3,11 @@ load("//bazel:mongo_js_rules.bzl", "mongo_js_library")
package(default_visibility = ["//visibility:public"])
exports_files([
"fully_disabled_feature_flags.yml",
"resmoke_modules.yml",
])
filegroup(
name = "all_files",
srcs = glob(["**"]),

View File

@ -430,7 +430,8 @@ def _set_up_tracing(
extra_context["git.branch_name"] = branch_name
except Exception:
print(
"Unable to setup git repo. This will result in incomplete telemetry data being uploaded."
"Unable to setup git repo. This will result in incomplete telemetry data being uploaded.",
file=sys.stderr,
)
processor = BatchedBaggageSpanProcessor(OTLPSpanExporter(endpoint=COLLECTOR_ENDPOINT))

View File

@ -1,5 +1,7 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
exports_files(["metadata.cdx.json"])
py_library(
name = "config",
srcs = ["config.py"],

View File

@ -34,6 +34,313 @@ py_test(
],
)
py_test(
name = "test_activate_task",
srcs = ["test_activate_task.py"],
visibility = ["//visibility:public"],
deps = [
"//evergreen:all_python_files",
],
)
py_test(
name = "test_bazel_plus_test_interface",
srcs = ["test_bazel_plus_test_interface.py"],
visibility = ["//visibility:public"],
deps = [
"//bazel/wrapper_hook",
],
)
py_test(
name = "test_bazel_run_resmoke",
srcs = ["test_bazel_run_resmoke.py"],
data = [
"//buildscripts/resmokeconfig:all_files",
"//buildscripts/resmokeconfig/loggers:all_files",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_check_for_noexcept",
srcs = ["test_check_for_noexcept.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:check_for_noexcept",
],
)
py_test(
name = "test_codeowners_auto_approver",
srcs = ["test_codeowners_auto_approver.py"],
visibility = ["//visibility:public"],
deps = [
"@bazel_rules_mongo//codeowners",
],
)
py_test(
name = "test_compiledb_output_format",
srcs = ["test_compiledb_output_format.py"],
visibility = ["//visibility:public"],
deps = [
"//bazel/wrapper_hook",
],
)
py_test(
name = "test_compiledb_posthook",
srcs = ["test_compiledb_posthook.py"],
visibility = ["//visibility:public"],
deps = [
"//bazel/wrapper_hook",
],
)
py_test(
name = "test_debugsymb_mapper",
srcs = ["test_debugsymb_mapper.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:debugsymb_mapper",
],
)
py_test(
name = "test_errorcodes",
srcs = ["test_errorcodes.py"],
data = glob(["data/errorcodes/**/*"]),
visibility = ["//visibility:public"],
deps = [
"//buildscripts:errorcodes",
],
)
py_test(
name = "test_evergreen_activate_gen_tasks",
srcs = ["test_evergreen_activate_gen_tasks.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:evergreen_activate_gen_tasks",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_evergreen_resmoke_job_count",
srcs = ["test_evergreen_resmoke_job_count.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:evergreen_resmoke_job_count",
],
)
py_test(
name = "test_evergreen_task_tags",
srcs = ["test_evergreen_task_tags.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:evergreen_task_tags",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_evergreen_task_timeout",
srcs = ["test_evergreen_task_timeout.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:evergreen_task_timeout",
],
)
py_test(
name = "test_exception_extractor",
srcs = ["test_exception_extractor.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_feature_flag_tags_check",
srcs = ["test_feature_flag_tags_check.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:feature_flag_tags_check",
],
)
py_test(
name = "test_feature_flags",
srcs = ["test_feature_flags.py"],
data = ["//buildscripts/resmokeconfig:fully_disabled_feature_flags.yml"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/idl",
"//buildscripts/resmokelib",
dependency(
"pyyaml",
group = "core",
),
],
)
py_test(
name = "test_generate_sbom",
srcs = ["test_generate_sbom.py"],
data = [
"//buildscripts/sbom:metadata.cdx.json",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/sbom:config",
"//buildscripts/sbom:endorctl_utils",
"//buildscripts/sbom:sbom_utils",
],
)
py_test(
name = "test_jepsen_report",
srcs = ["test_jepsen_report.py"],
data = ["//buildscripts/tests:test_jepsen_report_corpus.log.txt"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:jepsen_report",
],
)
py_test(
name = "test_legacy_commands_check",
srcs = ["test_legacy_commands_check.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:legacy_commands_check",
],
)
py_test(
name = "test_merge_tidy_configs",
srcs = ["test_merge_tidy_configs.py"],
visibility = ["//visibility:public"],
deps = [
"//bazel:merge_tidy_configs",
dependency(
"pyyaml",
group = "core",
),
],
)
py_test(
name = "test_mongosymb",
srcs = ["test_mongosymb.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:mongosymb",
],
)
py_test(
name = "test_package_test_internal",
srcs = ["test_package_test_internal.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:package_test_internal",
],
)
py_test(
name = "test_packager",
srcs = ["test_packager.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:packager",
],
)
py_test(
name = "test_powercycle_sentinel",
srcs = ["test_powercycle_sentinel.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:powercycle_sentinel",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_simple_report",
srcs = ["test_simple_report.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:simple_report",
],
)
py_test(
name = "test_sort_backport_multiversion",
srcs = ["test_sort_backport_multiversion.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:sort_backport_multiversion",
],
)
py_test(
name = "test_todo_check",
srcs = ["test_todo_check.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:todo_check",
],
)
py_test(
name = "test_todo_linter",
srcs = ["test_todo_linter.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:todo_linter",
],
)
py_test(
name = "test_validate_evg_project_config",
srcs = ["test_validate_evg_project_config.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:validate_evg_project_config",
],
)
py_test(
name = "test_validate_mongocryptd",
srcs = ["test_validate_mongocryptd.py"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:validate_mongocryptd",
dependency(
"mock",
group = "testing",
),
],
)
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",

View File

@ -6,6 +6,7 @@ py_test(
"__init__.py",
"test_evergreen.py",
],
data = ["//buildscripts/tests/ciconfig:evergreen.yml"],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/ciconfig",

View File

@ -588,3 +588,7 @@ class TestVariant(unittest.TestCase):
variant_amazon = self.conf.get_variant("amazon")
self.assertEqual(3, len(variant_amazon.tasks))
self.assertIn("compile", variant_amazon.task_names)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,37 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_cli",
srcs = [
"__init__.py",
"test_cli.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/monitor_build_status",
],
)
py_test(
name = "test_issue_report",
srcs = [
"__init__.py",
"test_issue_report.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/monitor_build_status",
],
)
py_test(
name = "test_jira_service",
srcs = [
"__init__.py",
"test_jira_service.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/monitor_build_status",
],
)

View File

@ -107,3 +107,7 @@ class TestSummarize(unittest.TestCase):
expected_summary = f"`SUMMARY [scope]` " f"{under_test.SummaryMsg.BELOW_THRESHOLDS.value}"
self.assertEqual(summary, expected_summary)
if __name__ == "__main__":
unittest.main()

View File

@ -65,3 +65,7 @@ class TestIssueReport(unittest.TestCase):
count = report.get_issue_count(under_test.IssueCategory.HOT)
self.assertEqual(count, 2)
if __name__ == "__main__":
unittest.main()

View File

@ -71,3 +71,7 @@ class TestBfIssue(unittest.TestCase):
bf_issue = under_test.IssueTuple.from_jira_issue(jira_issue)
self.assertEqual(bf_issue.team_assignment_duration_hours, 3 * 24)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,18 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_change_data",
srcs = [
"__init__.py",
"test_change_data.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/patch_builds",
dependency(
"mock",
group = "testing",
),
],
)

View File

@ -111,3 +111,7 @@ class TestFindChangedFilesAndLinesInRepos(unittest.TestCase):
mock_open.assert_called_once_with("src/module/test1.cpp", "r")
self.assertEqual(result, expected_result)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,13 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_resmoke_proxy",
srcs = [
"__init__.py",
"test_resmoke_proxy.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmoke_proxy",
],
)

View File

@ -19,3 +19,7 @@ class TestResmokeProxy(unittest.TestCase):
test_list = resmoke_proxy.list_tests("some suite")
self.assertEqual(len(test_list), 7)
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,3 @@
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
py_test(
@ -13,9 +12,13 @@ py_test(
py_test(
name = "test_find_suites",
srcs = ["test_find_suites.py"],
data = [
"//buildscripts/resmokeconfig:all_files",
"//jstests/core/testing:all_subpackage_javascript_files",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
"//buildscripts:resmoke",
],
)

View File

@ -5,3 +5,7 @@ class TestAssert(unittest.TestCase):
def test_pass(self):
true = True
self.assertTrue(true)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,65 @@
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
load("@rules_python//python:defs.bzl", "py_library")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_library", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
visibility = ["//visibility:public"],
)
py_test(
name = "test_multiversionconstants_location",
srcs = [
"__init__.py",
"test_multiversionconstants_location.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_parser",
srcs = [
"__init__.py",
"test_parser.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts:resmoke",
],
)
py_test(
name = "test_suite_hierarchy",
srcs = [
"__init__.py",
"test_suite_hierarchy.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_suitesconfig",
srcs = [
"__init__.py",
"test_suitesconfig.py",
],
data = [
"//buildscripts/resmokeconfig:all_files",
"//buildscripts/resmokeconfig/loggers:all_files",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)

View File

@ -1,8 +1,42 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_pipe",
srcs = [
"__init__.py",
"test_pipe.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_programs",
srcs = [
"__init__.py",
"test_programs.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_redirect",
srcs = [
"__init__.py",
"test_redirect.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)

View File

@ -79,3 +79,7 @@ class TestFormatLineForLogging(unittest.TestCase):
line_output = _pipe.LoggerPipe._format_line_for_logging(line)
self.assertEqual(2, len(line_output))
if __name__ == "__main__":
unittest.main()

View File

@ -20,3 +20,7 @@ class ResmokeProgramsTestCase(unittest.TestCase):
'dummy_key["a"]["b"] = "c"',
]
self.assertEqual(string_builder, expected)
if __name__ == "__main__":
unittest.main()

View File

@ -55,3 +55,7 @@ class TestStdoutRedirect(unittest.TestCase):
print("not to be captured")
self.assertEqual(string + "\n", acc.getvalue().decode("utf-8"))
if __name__ == "__main__":
unittest.main()

View File

@ -30,3 +30,7 @@ class TestTestDiscoverySubCommand(unittest.TestCase):
for i in range(6):
self.assertIn(f"test_{i}.js", tests.tests)
if __name__ == "__main__":
unittest.main()

View File

@ -388,3 +388,7 @@ class TestIsEnterpriseParamAvailable(unittest.TestCase):
def test_modules_with_enterprise_enterprise_param(self):
with mock.patch.object(config, "MODULES", ["enterprise"]):
self.assertTrue(is_enterprise_param_available({"enterprise_only": True}))
if __name__ == "__main__":
unittest.main()

View File

@ -135,3 +135,7 @@ class TestGetProcesses(unittest.TestCase):
Pinfo(name="mongod", pidv=[4, 5]),
],
)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,25 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_handlers",
srcs = [
"__init__.py",
"test_handlers.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_loggers",
srcs = [
"__init__.py",
"test_loggers.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)

View File

@ -190,3 +190,7 @@ class TestBufferedFileHandler(unittest.TestCase):
flush_t.join(timeout=5)
self.assertFalse(flush_t.is_alive(), "Flush thread did not finish in time")
self.assertEqual(errors, [], f"Race condition caused errors: {errors}")
if __name__ == "__main__":
unittest.main()

View File

@ -73,3 +73,7 @@ class TestLoggers(unittest.TestCase):
for full_name, expected_short_name in transform:
short_name = loggers._shorten(full_name)
self.assertEqual(short_name, expected_short_name)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,13 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_multiversion_service",
srcs = [
"__init__.py",
"test_multiversion_service.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)

View File

@ -1,5 +1,6 @@
"""Unit tests for multiversion_service.py."""
import unittest
from unittest import TestCase
from packaging.version import Version
@ -156,3 +157,7 @@ class TestCalculateFcvConstants(TestCase):
]
],
)
if __name__ == "__main__":
unittest.main()

View File

@ -439,3 +439,7 @@ class RemoteOperation(RemoteOperationsTestCase):
def runTest(self):
# Invalid operation
self.assertRaises(ValueError, lambda: self.rop.operation("invalid", None))
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,54 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_auto_kill_rogue_process",
srcs = [
"__init__.py",
"test_auto_kill_rogue_process.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_generate_multiversion_exclude_tags",
srcs = [
"__init__.py",
"test_generate_multiversion_exclude_tags.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_list_tags",
srcs = [
"__init__.py",
"test_list_tags.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_shuffle_tests",
srcs = [
"__init__.py",
"test_shuffle_tests.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)

View File

@ -121,3 +121,7 @@ class TestDetectRogueProcess(unittest.TestCase):
self.fail("Process was killed when it should not have been.")
proc.wait()
if __name__ == "__main__":
unittest.main()

View File

@ -338,3 +338,7 @@ class TestGenerateExcludeYaml(unittest.TestCase):
self.patch_and_run(latest_yaml, old_yaml, MultiversionOptions.LAST_LTS)
self.assert_contents(expected)
if __name__ == "__main__":
unittest.main()

View File

@ -249,3 +249,7 @@ class TestGetTagDoc(unittest.TestCase):
)
result = list_tags.get_tag_doc(tag_block)
self.assertEqual(expected, result)
if __name__ == "__main__":
unittest.main()

View File

@ -79,3 +79,7 @@ class TestShuffle(unittest.TestCase):
expected = ["c", "a", "b", "d"]
actual = TestRunner.LongestFirstPartialShuffle(history).shuffle(tests)
self.assertListEqual(actual, expected)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,21 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_setup_multiversion",
srcs = [
"__init__.py",
"test_setup_multiversion.py",
],
data = [
"//buildscripts/resmokeconfig:setup_multiversion/setup_multiversion_config.yml",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)

View File

@ -374,3 +374,7 @@ class TestSetupMultiversionGetUrls(TestSetupMultiversionBase):
urlinfo = self.setup_multiversion.get_urls("4.4.1")
self.assertEqual(urlinfo.urls, {})
self.assertEqual(urlinfo.evg_version_id, None)
if __name__ == "__main__":
unittest.main()

View File

@ -26,3 +26,7 @@ class TestMultiversionconstantsLocation(unittest.TestCase):
f" uses this constant. If the module was changed, one-click repro tool"
f" should also be updated. Please reach out in #server-testing slack channel.",
)
if __name__ == "__main__":
unittest.main()

View File

@ -424,3 +424,7 @@ class TestParseCommandLine(unittest.TestCase):
with self.assertRaises(SystemExit) as cm:
parse_command_line(["run", "nonexistent_file.js"], should_configure_otel=False)
self.assertEqual(cm.exception.code, 2)
if __name__ == "__main__":
unittest.main()

View File

@ -738,3 +738,7 @@ class TestFilterTests(unittest.TestCase):
selected, excluded = selector.filter_tests("db_test", config, self.test_file_explorer)
self.assertEqual(["dbtestB"], selected)
self.assertEqual(["dbtestA", "dbtestC"], excluded)
if __name__ == "__main__":
unittest.main()

View File

@ -222,3 +222,7 @@ class TestSuiteHierarchy(unittest.TestCase):
full_union,
f"Min set union\n{min_set_union}\n != full union\n{full_union}",
)
if __name__ == "__main__":
unittest.main()

View File

@ -49,3 +49,7 @@ class TestSuitesConfig(unittest.TestCase):
test_kind=("fsm_workload_test", "js_test")
)
self.assertEqual(membership_map, dict(test1=all_suites, test2=all_suites))
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,93 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_executor",
srcs = [
"__init__.py",
"test_executor.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_job",
srcs = [
"__init__.py",
"test_job.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_queue_element",
srcs = [
"__init__.py",
"test_queue_element.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_suite",
srcs = [
"__init__.py",
"test_suite.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_symbolizer_service",
srcs = [
"__init__.py",
"test_symbolizer_service.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_tags",
srcs = [
"__init__.py",
"test_tags.py",
],
data = [
"//buildscripts/tests/resmokelib/testing:tags.yml",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)

View File

@ -318,3 +318,7 @@ class TestMakeFixtureIFRExclusion(unittest.TestCase):
enable_feature_flags=False,
)
self.assertNotIn(ifr_flag, mongod.mongod_options[SET_PARAMS])
if __name__ == "__main__":
unittest.main()

View File

@ -76,3 +76,7 @@ class TestMergeMongoOptionDicts(unittest.TestCase):
}
self.assertDictEqual(original, expected)
if __name__ == "__main__":
unittest.main()

View File

@ -55,3 +55,7 @@ class UnitTestFixture(interface.Fixture):
def _do_teardown(self, finished=False, mode=None):
if self._should_raise:
raise errors.ServerFailure(self.ERROR_MESSAGE)
if __name__ == "__main__":
unittest.main()

View File

@ -848,3 +848,7 @@ class TestCheckPerfResultTestCase(unittest.TestCase):
with self.assertRaisesRegex(ServerFailure, "threshold check"):
test_case.run_test()
if __name__ == "__main__":
unittest.main()

View File

@ -135,3 +135,7 @@ class TestFileBasedThreadLifecycle(unittest.TestCase):
self.assertFalse(lifecycle.wait_for_action_permitted())
self.assertTrue(cond.wait.called)
if __name__ == "__main__":
unittest.main()

View File

@ -144,3 +144,7 @@ class TestRuntimeFuzzGeneration(unittest.TestCase):
_runtime_fuzzer.validate_runtime_parameter_spec(bad_spec_value_no_period)
# No exception for good dict
_runtime_fuzzer.validate_runtime_parameter_spec(good_spec)
if __name__ == "__main__":
unittest.main()

View File

@ -46,3 +46,7 @@ class TestStepdownThread(unittest.TestCase):
shardcluster_fixture.mongos.is_running.return_value = False
with self.assertRaises(errors.ServerFailure):
stepdown_thread.pause()
if __name__ == "__main__":
unittest.main()

View File

@ -128,3 +128,7 @@ class TestTestQueueAddTestCases(unittest.TestCase):
while not test_queue.empty():
element = test_queue.get()
self.assertIn(element, self.test_cases)
if __name__ == "__main__":
unittest.main()

View File

@ -330,3 +330,7 @@ class TestNoOpFixtureSetupAndTeardown(unittest.TestCase):
def test_teardown_called_for_noop_fixture(self):
self.assertTrue(self.__job_object.manager.teardown_fixture(self.logger))
self.__noop_fixture.teardown.assert_called_once_with(finished=True)
if __name__ == "__main__":
unittest.main()

View File

@ -90,3 +90,7 @@ class TestQueueElemRepeatTime(unittest.TestCase):
queue_elem = queue_element.QueueElemRepeatTime(None, None, suite_options)
job_time = 1
self.assert_elem_queues_n_times(queue_elem, job_time, 2)
if __name__ == "__main__":
unittest.main()

View File

@ -238,3 +238,7 @@ class TestGetTestsForKind(unittest.TestCase):
self.assertEqual(set(shard1), set(["1.js", "3.js"]))
self.assertEqual(set(shard2), set(["2.js", "4.js"]))
if __name__ == "__main__":
unittest.main()

View File

@ -233,3 +233,7 @@ class TestFileService(unittest.TestCase):
self.file_service.add_to_processed_files(processed_files)
filtered = self.file_service.filter_out_already_processed_files(files)
self.assertTrue(all(file not in processed_files for file in filtered))
if __name__ == "__main__":
unittest.main()

View File

@ -120,3 +120,7 @@ class TestTagsConfig(unittest.TestCase):
conf.add_tag(test_kind, test_pattern, "tag1|aaa")
tags = conf.get_tags(test_kind, test_pattern)
self.assertEqual(["ta|g2", "tag1", "tag1|aaa", "tag2", "tag3"], tags)
if __name__ == "__main__":
unittest.main()

View File

@ -59,3 +59,7 @@ class TestPyTestCase(unittest.TestCase):
self.assertIn(" -m unittest", proc.as_command())
self.assertIn(pytest_case.test_name, proc.as_command())
self.assertEqual(proc.logger, logger)
if __name__ == "__main__":
unittest.main()

View File

@ -235,3 +235,7 @@ class TestTimeouts(unittest.TestCase):
timer.cancel()
self.assertTrue(testcase.timed_out.is_set())
self.assertTrue(testcase.timed_out_processed.is_set())
if __name__ == "__main__":
unittest.main()

View File

@ -1,4 +1,5 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
@ -6,3 +7,55 @@ py_library(
srcs = glob(["*.py"]),
visibility = ["//visibility:public"],
)
py_test(
name = "test_evergreen_conn",
srcs = [
"__init__.py",
"test_evergreen_conn.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_history",
srcs = [
"__init__.py",
"test_history.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_scheduler",
srcs = [
"__init__.py",
"test_scheduler.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)
py_test(
name = "test_version_comparison",
srcs = [
"__init__.py",
"test_version_comparison.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmokelib",
],
)

View File

@ -245,3 +245,7 @@ class DirectoryArchivalTests(unittest.TestCase):
expected = os.path.join(self.temp_dir, archive_name)
self.assertTrue(os.path.exists(expected), f"Expected archive does not exist: {expected}")
self.assertEqual(0, status, message)
if __name__ == "__main__":
unittest.main()

View File

@ -303,3 +303,7 @@ class TestGetCompileArtifactUrls(unittest.TestCase):
urls = evergreen_conn.get_compile_artifact_urls(mock_evg_api, mock_version, "test")
self.assertEqual(urls, {})
if __name__ == "__main__":
unittest.main()

View File

@ -250,3 +250,7 @@ History:
notify_calls,
"copy() must not call notify_subscriber_write() during construction",
)
if __name__ == "__main__":
unittest.main()

View File

@ -29,3 +29,7 @@ class TestBuiltinScheduler(unittest.TestCase):
self.__scheduler.cancel(event2)
self.assertEqual(self.__scheduler.queue, [])
if __name__ == "__main__":
unittest.main()

View File

@ -56,3 +56,7 @@ class TestCompareBinVersions(unittest.TestCase):
self.assertGreaterEqual(version_comparison.compare_bin_versions("8.3.0", "8.3"), 0)
self.assertLess(version_comparison.compare_bin_versions("8.2", "8.3"), 0)
self.assertGreater(version_comparison.compare_bin_versions("8.4", "8.3"), 0)
if __name__ == "__main__":
unittest.main()

View File

@ -141,3 +141,7 @@ class TestSbom(unittest.TestCase):
if not error_manager.zero_error():
error_manager.print_errors()
self.assertTrue(error_manager.zero_error())
if __name__ == "__main__":
unittest.main()

View File

@ -176,3 +176,7 @@ class TestActivateTask(unittest.TestCase):
"Could not determine the build variant for patch activation from build build_id",
):
under_test.main("archive_dist_test_debug")
if __name__ == "__main__":
unittest.main()

View File

@ -120,3 +120,7 @@ class TestGetBinVersion(TestCmdOutputExtractor):
bin_version_output = self.cmd_output_extractor.get_bin_version("path/to/bin")
self.assertIsNone(bin_version_output.mongodb_version)
self.assertEqual(bin_version_output.cmd_output, version_cmd_output)
if __name__ == "__main__":
unittest.main()

View File

@ -67,3 +67,7 @@ class TestErrorcodes(unittest.TestCase):
self.assertEqual(1234, errorcodes.coerce_to_number("server-1234"))
self.assertEqual(1234, errorcodes.coerce_to_number("SERVER-1234"))
self.assertEqual(-1, errorcodes.coerce_to_number("not a ticket"))
if __name__ == "__main__":
unittest.main()

View File

@ -144,3 +144,7 @@ class DetermineJobsTest(unittest.TestCase):
job_count_matching = under_test.determine_jobs(task, variant, distro, jobs_max=jobs_default)
self.assertEqual(jobs_default, job_count_matching)
if __name__ == "__main__":
unittest.main()

View File

@ -126,3 +126,7 @@ class TestGetAllTasks(unittest.TestCase):
task_list = ett.get_all_tasks(evg_config, variant)
self.assertEqual(evg_config.get_variant.return_value.task_names, task_list)
evg_config.get_variant.assert_called_with(variant)
if __name__ == "__main__":
unittest.main()

View File

@ -431,3 +431,7 @@ class TestDetermineIdleTimeout(unittest.TestCase):
timeout_override=3,
expected_timeout=timedelta(minutes=3),
)
if __name__ == "__main__":
unittest.main()

View File

@ -251,3 +251,7 @@ class TestExceptionExtractor(unittest.TestCase):
assert extractor.active is True
assert extractor.exception_detected is False
assert extractor.get_exception() == []
if __name__ == "__main__":
unittest.main()

View File

@ -35,3 +35,7 @@ class TestFindTestsInGitDiff(unittest.TestCase):
tests = ["some/non/existent/jstest_file.js"]
result = feature_flag_tags_check.get_tests_missing_fcv_tag(tests)
self.assertCountEqual([], result)
if __name__ == "__main__":
unittest.main()

View File

@ -22,3 +22,7 @@ class TestFeatureFlags(unittest.TestCase):
fully_disabled_flags,
f"Feature flag {flag} defaults to true but is listed as fully disabled.",
)
if __name__ == "__main__":
unittest.main()

View File

@ -202,3 +202,7 @@ Everything looks good! ヽ(‘ー`)
self.assertEqual(result.exit_code, 1)
else:
self.assertEqual(result.exit_code, 0)
if __name__ == "__main__":
unittest.main()

View File

@ -66,3 +66,7 @@ class TestCheckFileForLegacyType(unittest.TestCase):
modified_lines = [(0, ""), (1, "class AddShardCmd : public CommandInvocationHooks")]
self.assertEqual(check_file_for_legacy_type(modified_lines), False)
if __name__ == "__main__":
unittest.main()

View File

@ -66,3 +66,7 @@ class TestHasHighNotFoundPathsRatio(unittest.TestCase):
frames = []
ret = under_test.has_high_not_found_paths_ratio(frames)
self.assertEqual(ret, False)
if __name__ == "__main__":
unittest.main()

View File

@ -1,5 +1,6 @@
"""Unit tests for the packager script."""
import unittest
from dataclasses import dataclass
from unittest import TestCase
@ -89,3 +90,7 @@ class TestPackager(TestCase):
with self.subTest(name=case.name):
spec = Spec(ver=case.version)
self.assertEqual(spec.suffix(), case.want)
if __name__ == "__main__":
unittest.main()

View File

@ -58,3 +58,7 @@ class TestWatchTasks(unittest.TestCase):
)
long_running_task_ids = watch_tasks(task_ids, evg_api, 0)
self.assertEqual([task_2.task_id], long_running_task_ids)
if __name__ == "__main__":
unittest.main()

View File

@ -54,3 +54,7 @@ class TestSimpleReport(unittest.TestCase):
self.assertEqual(results[0]["status"], "fail")
self.assertEqual(report["failures"], 1)
self.assertEqual(result.exit_code, 0)
if __name__ == "__main__":
unittest.main()

View File

@ -262,3 +262,7 @@ class TestWalkFs(unittest.TestCase):
under_test.walk_fs(tmpdir, visit_file)
self.assertDictEqual(expected_files, seen_files)
if __name__ == "__main__":
unittest.main()

View File

@ -67,3 +67,7 @@ class TestLintFiles(unittest.TestCase):
under_test._lint_files(["buildscripts/todo_linter.py"])
self.assertEqual(context.exception.code, 1)
if __name__ == "__main__":
unittest.main()

View File

@ -234,3 +234,7 @@ class ValidateCommitMessageTest(unittest.TestCase):
commits[0].message,
"SERVER-1234 Add a ton of great support (#32823)\nThis PR adds back support for a lot of things\nMany great things!",
)
if __name__ == "__main__":
unittest.main()

View File

@ -66,3 +66,6 @@ class TestMessagesToReport(unittest.TestCase):
# 'foo' optional comma + whitespace
if __name__ == "__main__":
unittest.main()

View File

@ -59,3 +59,7 @@ class TestReadVariableFromYml(unittest.TestCase):
yaml_mock.safe_load.return_value = mock_nodes
self.assertEqual(expected_value, under_test.read_variable_from_yml("filename", search_key))
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,32 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_timeout",
srcs = [
"__init__.py",
"test_timeout.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/timeouts:timeout",
],
)
py_test(
name = "test_timeout_service",
srcs = [
"__init__.py",
"test_timeout_service.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/resmoke_proxy",
"//buildscripts/timeouts:timeout_service",
"//buildscripts/util",
dependency(
"requests",
group = "core",
),
],
)

View File

@ -109,3 +109,7 @@ class TestTimeoutInfo(unittest.TestCase):
def test_override_with_no_values(self):
with self.assertRaises(ValueError):
under_test.TimeoutInfo.overridden()
if __name__ == "__main__":
unittest.main()

View File

@ -391,3 +391,7 @@ class TestHaveEnoughHistoricStats(unittest.TestCase):
timeout_service._have_enough_historic_stats(num_tests=-1, num_tests_missing_data=0)
with self.assertRaises(ValueError):
timeout_service._have_enough_historic_stats(num_tests=-100, num_tests_missing_data=0)
if __name__ == "__main__":
unittest.main()

View File

@ -1,8 +1,86 @@
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
load("@poetry//:dependencies.bzl", "dependency")
load("@rules_python//python:defs.bzl", "py_test")
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
py_library(
name = "all_python_files",
srcs = glob(["*.py"]),
py_test(
name = "test_fileops",
srcs = [
"__init__.py",
"test_fileops.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
],
)
py_test(
name = "test_read_config",
srcs = [
"__init__.py",
"test_read_config.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
dependency(
"mock",
group = "testing",
),
],
)
py_test(
name = "test_taskname",
srcs = [
"__init__.py",
"test_taskname.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
],
)
py_test(
name = "test_testname",
srcs = [
"__init__.py",
"test_testname.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
],
)
py_test(
name = "test_teststats",
srcs = [
"__init__.py",
"test_teststats.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
dependency(
"mock",
group = "testing",
),
dependency(
"requests",
group = "core",
),
],
)
py_test(
name = "test_time",
srcs = [
"__init__.py",
"test_time.py",
],
visibility = ["//visibility:public"],
deps = [
"//buildscripts/util",
],
)

View File

@ -25,3 +25,7 @@ class TestWriteFileToDir(unittest.TestCase):
under_test.write_file_to_dir("dir", "file", "contents", overwrite=False)
mock_write_file.assert_not_called()
if __name__ == "__main__":
unittest.main()

View File

@ -35,3 +35,7 @@ class TestGetConfigValue(unittest.TestCase):
)
self.assertEqual("cmdline value", value)
if __name__ == "__main__":
unittest.main()

View File

@ -50,3 +50,7 @@ class TestDetermineTaskBaseName(unittest.TestCase):
base_task_name = under_test.determine_task_base_name(task_name, bv)
self.assertEqual("auth", base_task_name)
if __name__ == "__main__":
unittest.main()

View File

@ -80,3 +80,7 @@ class DenormalizeTestFileTest(unittest.TestCase):
unix_file = "test/found/under/unix.sh"
expected = [unix_file, "test\\found\\under\\unix.sh"]
self.assertEqual(expected, testname_utils.denormalize_test_file(unix_file))
if __name__ == "__main__":
unittest.main()

View File

@ -199,3 +199,7 @@ class TestHistoricTaskData(unittest.TestCase):
result = under_test.HistoricTaskData.get_stats_from_s3("project", "task", "variant")
self.assertEqual(result, [])
if __name__ == "__main__":
unittest.main()

Some files were not shown because too many files have changed in this diff Show More