SERVER-123027 Auto-derive resmoke_suite_test srcs from suite YAML selectors (#50756)
GitOrigin-RevId: 0037d1f07f298000bd55d5c1163885c6de6c1b5b
This commit is contained in:
parent
82f724418a
commit
15f003a189
1
.gitignore
vendored
1
.gitignore
vendored
@ -317,6 +317,7 @@ src/mongo/db/modules/enterprise/autogenerated_targets/BUILD.bazel
|
||||
**/MODULE.bazel.lock
|
||||
!/MODULE.bazel.lock
|
||||
.auto_header
|
||||
.resmoke_suites_derived.bzl
|
||||
|
||||
# generated configs for external fixture suites
|
||||
docker_compose/
|
||||
|
||||
@ -6,19 +6,17 @@ Rules for running resmoke test suites in Bazel.
|
||||
|
||||
Runs a resmoke test suite in Bazel.
|
||||
|
||||
This rule generates a resmoke configuration file based on the provided test sources and base config,
|
||||
then executes the tests using the resmoke.py test runner.
|
||||
|
||||
**EXAMPLE**
|
||||
|
||||
```bzl
|
||||
load("//bazel/resmoke:resmoke.bzl", "resmoke_suite_test")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "jscore",
|
||||
config = "//buildscripts/resmokeconfig/suites:core.yml",
|
||||
srcs = ["//jstests/core:all_subpackage_javascript_files"],
|
||||
exclude_with_any_tags = ["requires_sharding"],
|
||||
name = "core",
|
||||
config = "//buildscripts/resmokeconfig:suites/core.yml",
|
||||
data = [
|
||||
"//jstests/libs:all_subpackage_javascript_files",
|
||||
],
|
||||
deps = [
|
||||
"//src/mongo/db:mongod",
|
||||
"//src/mongo/shell:mongo",
|
||||
@ -28,20 +26,15 @@ resmoke_suite_test(
|
||||
|
||||
**ATTRIBUTES**
|
||||
|
||||
| Name | Description | Type | Mandatory | Default |
|
||||
| :--------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------ | :-------- | :------ |
|
||||
| name | A unique name for this test target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
|
||||
| config | The base resmoke YAML configuration file for the suite. This provides the default configuration that will be augmented with the selected tests. | <a href="https://bazel.build/concepts/labels">Label</a> | required | |
|
||||
| srcs | Test files to include in the suite. These files are written as the 'roots' of the test selector in the generated configuration. Typically JavaScript test files for jstest suites. | <a href="https://bazel.build/concepts/labels">List of labels</a> | required | |
|
||||
| data | Additional files required by the tests during runtime. Typically JavaScript files from jstests/libs. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
|
||||
| deps | MongoDB binaries and other executables that the tests depend on (e.g., mongod, mongos). These are placed on the PATH when running the test suite. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
|
||||
| exclude_files | Test files to explicitly exclude from the suite, even if they appear in srcs. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
|
||||
| exclude_with_any_tags | List of test tags. Tests with any of these tags will be excluded from the suite. | List of strings | optional | `[]` |
|
||||
| include_with_any_tags | List of test tags. Only tests with at least one of these tags will be included in the suite. | List of strings | optional | `[]` |
|
||||
| resmoke_args | Additional command-line arguments to pass to the resmoke runner. | List of strings | optional | `[]` |
|
||||
| shard_count | The number of parallel shards to split the test suite across. Each shard runs a subset of the tests. See the Test Sharding section below for details. | Integer | optional | `None` |
|
||||
| group_size | Number of tests to run in each group. Only applicable for `test_kind: parallel_fsm_workload_test` suites. | Integer | optional | `None` |
|
||||
| group_count_multiplier | Multiplier for the number of groups. Only applicable for `test_kind: parallel_fsm_workload_test` suites. Should be a float value passed as a string (e.g., `"2.5"`). | String | optional | `""` |
|
||||
| Name | Description | Type | Mandatory | Default |
|
||||
| :----------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------ | :-------- | :------ |
|
||||
| name | A unique name for this test target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
|
||||
| config | The resmoke YAML configuration file for the suite. Must have a `selector.roots` field. Passed directly to resmoke at runtime. | <a href="https://bazel.build/concepts/labels">Label</a> | required | |
|
||||
| srcs | Override for test source files. If empty (default), automatically derived from the suite YAML's `selector.roots` via the pre-build generator. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
|
||||
| data | Additional files required by the tests during runtime. Typically JavaScript library files from jstests/libs. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
|
||||
| deps | MongoDB binaries and other executables that the tests depend on (e.g., mongod, mongos). These are placed on the PATH when running the test suite. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
|
||||
| resmoke_args | Additional command-line arguments to pass to the resmoke runner. | List of strings | optional | `[]` |
|
||||
| shard_count | The number of parallel shards to split the test suite across. Each shard runs a subset of the tests. See the Test Sharding section below for details. | Integer | optional | `None` |
|
||||
|
||||
### Test Sharding
|
||||
|
||||
@ -58,10 +51,10 @@ Note: sharding is an alternative to the resmoke `--jobs` flag, which should not
|
||||
|
||||
Bazel creates a dedicated output directory for each test run under the `bazel-testlogs` symlink in your workspace root.
|
||||
|
||||
For a test target `//buildscripts/resmokeconfig:core`, the outputs are like:
|
||||
For a test target `//jstests/suites/query-execution:core`, the outputs are like:
|
||||
|
||||
```
|
||||
bazel-testlogs/buildscripts/resmokeconfig/core/
|
||||
bazel-testlogs/jstests/suites/query-execution/core/
|
||||
├── test.log # Primary test output log. Contains the output of resmoke.py
|
||||
├── test.outputs/
|
||||
│ ├── report.json # Test results in JSON format
|
||||
@ -80,7 +73,7 @@ bazel-testlogs/buildscripts/resmokeconfig/core/
|
||||
#### Run a single test from a suite:
|
||||
|
||||
```
|
||||
bazel test //buildscripts/resmokeconfig:core --test_sharding_strategy=disabled --test_arg=jstests/core/js/jssymbol.js
|
||||
bazel test //jstests/suites/query-execution:core --test_sharding_strategy=disabled --test_arg=jstests/core/js/jssymbol.js
|
||||
```
|
||||
|
||||
#### Run with additional resmoke flags:
|
||||
@ -90,19 +83,10 @@ Any `--test_arg` in the bazel command will be propagated as a flag to resmoke.py
|
||||
```
|
||||
# Runs all tests from the core suite with timeseries in their name, twice, with all feature flags enabled.
|
||||
|
||||
bazel test //buildscripts/resmokeconfig:core \
|
||||
bazel test //jstests/suites/query-execution:core \
|
||||
--test_sharding_strategy=disabled \
|
||||
--test_arg=--repeatTests=2 \
|
||||
--test_arg=--runAllFeatureFlagTests \
|
||||
--test_arg=--skipExcludedTests \
|
||||
`fdfind -t f --full-path ".timeseries\.js$" jstests/core | awk '{print "--test_arg=" $0}'`
|
||||
```
|
||||
|
||||
#### Run resmoke.py outside of bazel with the suite's config:
|
||||
|
||||
```
|
||||
# Build binaries and the suite's config (the *_config target)
|
||||
bazel build install-dist-test //buildscripts/resmokeconfig:core_config
|
||||
|
||||
python buildscripts/resmoke.py run --suite bazel-bin/buildscripts/resmokeconfig/core.yml
|
||||
```
|
||||
|
||||
289
bazel/resmoke/derive_suite_selectors.py
Normal file
289
bazel/resmoke/derive_suite_selectors.py
Normal file
@ -0,0 +1,289 @@
|
||||
"""Pre-build generator that derives Bazel labels from resmoke suite YAML selectors.
|
||||
|
||||
Parses all suite YAML configs, extracts the selector.roots globs, maps them to
|
||||
Bazel labels, and writes a .bzl file that resmoke.bzl can load to automatically
|
||||
populate resmoke_suite_test srcs.
|
||||
|
||||
This runs during the wrapper_hook pre-build phase, before Bazel's analysis.
|
||||
"""
|
||||
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
try:
|
||||
from yaml import CSafeLoader as _YamlLoader
|
||||
except ImportError:
|
||||
from yaml import SafeLoader as _YamlLoader
|
||||
|
||||
# Matches the top-level "selector:" block and its indented body.
|
||||
_SELECTOR_RE = re.compile(r"^selector:\s*\n((?:[ \t]+.*\n)*)", re.MULTILINE)
|
||||
|
||||
OUTPUT_FILE = Path("bazel/resmoke/.resmoke_suites_derived.bzl")
|
||||
RESMOKE_MODULES_FILE = Path("buildscripts/resmokeconfig/resmoke_modules.yml")
|
||||
|
||||
# Fixed suite directories (relative to repo root).
|
||||
# Each entry is (suite_dir, bazel_package, target_prefix) where:
|
||||
# - suite_dir: filesystem path to the directory
|
||||
# - bazel_package: the Bazel package that exports these files
|
||||
# - target_prefix: path prefix within the package (for the label key)
|
||||
_FIXED_SUITE_DIRS = [
|
||||
(
|
||||
Path("buildscripts/resmokeconfig/suites"),
|
||||
"buildscripts/resmokeconfig",
|
||||
"suites",
|
||||
),
|
||||
(
|
||||
Path("buildscripts/resmokeconfig/matrix_suites/generated_suites"),
|
||||
"buildscripts/resmokeconfig",
|
||||
"matrix_suites/generated_suites",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def _discover_suite_dirs(repo_root: Path) -> list[tuple[Path, str, str]]:
|
||||
"""Discover all suite directories including modules.
|
||||
|
||||
Returns list of (suite_dir, bazel_package, target_prefix) tuples.
|
||||
"""
|
||||
dirs = list(_FIXED_SUITE_DIRS)
|
||||
|
||||
# Read resmoke_modules.yml to discover module suite dirs
|
||||
modules_file = repo_root / RESMOKE_MODULES_FILE
|
||||
if modules_file.exists():
|
||||
try:
|
||||
with open(modules_file) as fh:
|
||||
modules_cfg = yaml.load(fh, Loader=_YamlLoader)
|
||||
if modules_cfg and isinstance(modules_cfg, dict):
|
||||
for module_cfg in modules_cfg.values():
|
||||
if not isinstance(module_cfg, dict):
|
||||
continue
|
||||
|
||||
# Module suite_dirs
|
||||
for suite_dir in module_cfg.get("suite_dirs", []):
|
||||
p = Path(suite_dir)
|
||||
# Derive bazel package from parent dir
|
||||
bazel_pkg = str(p.parent)
|
||||
target_prefix = p.name
|
||||
dirs.append((p, bazel_pkg, target_prefix))
|
||||
|
||||
# Module matrix_suite_dirs (use generated_suites subdir)
|
||||
for matrix_dir in module_cfg.get("matrix_suite_dirs", []):
|
||||
p = Path(matrix_dir) / "generated_suites"
|
||||
bazel_pkg = str(Path(matrix_dir).parent)
|
||||
target_prefix = f"{Path(matrix_dir).name}/generated_suites"
|
||||
dirs.append((p, bazel_pkg, target_prefix))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return dirs
|
||||
|
||||
|
||||
def _has_build_file(dir_path: Path) -> bool:
|
||||
"""Check if a directory contains a BUILD or BUILD.bazel file."""
|
||||
return (dir_path / "BUILD.bazel").exists() or (dir_path / "BUILD").exists()
|
||||
|
||||
|
||||
def _glob_to_labels(pattern: str, repo_root: Path) -> list[str]:
|
||||
"""Convert a resmoke glob pattern to Bazel labels.
|
||||
|
||||
Handles:
|
||||
- dir/*.js -> //dir:all_javascript_files
|
||||
- dir/**/*.js -> //dir:all_subpackage_javascript_files
|
||||
- dir/file.js -> //dir:file.js
|
||||
- src/mongo/db/modules/*/path -> expand * against filesystem
|
||||
- Complex patterns (test_*.py, *[aA]uth*.js) -> expand via glob
|
||||
"""
|
||||
# Handle module wildcards by expanding against filesystem first
|
||||
if "modules/*/" in pattern:
|
||||
expanded: list[str] = []
|
||||
module_base = pattern.split("modules/*/")[0] + "modules/"
|
||||
module_path = repo_root / module_base
|
||||
if module_path.is_dir():
|
||||
module_dirs = sorted(
|
||||
d for d in module_path.iterdir() if d.is_dir() and not d.name.startswith(".")
|
||||
)
|
||||
for mod_dir in module_dirs:
|
||||
expanded_pattern = pattern.replace("modules/*/", f"modules/{mod_dir.name}/")
|
||||
expanded.extend(_glob_to_labels(expanded_pattern, repo_root))
|
||||
return expanded
|
||||
|
||||
# Standard patterns: dir/*.ext
|
||||
if not _has_complex_wildcards(pattern):
|
||||
# dir/*.js
|
||||
if pattern.endswith("/*.js") and "**" not in pattern:
|
||||
dir_path = str(Path(pattern).parent)
|
||||
if _has_build_file(repo_root / dir_path):
|
||||
return [f"//{dir_path}:all_javascript_files"]
|
||||
return []
|
||||
|
||||
# dir/**/*.js
|
||||
if pattern.endswith("**/*.js"):
|
||||
base_dir = pattern[: pattern.index("**")].rstrip("/")
|
||||
if base_dir and _has_build_file(repo_root / base_dir):
|
||||
return [f"//{base_dir}:all_subpackage_javascript_files"]
|
||||
return []
|
||||
|
||||
# Literal file path (no wildcards at all)
|
||||
if "*" not in pattern and "[" not in pattern and "?" not in pattern:
|
||||
p = Path(pattern)
|
||||
if _has_build_file(repo_root / p.parent):
|
||||
return [f"//{p.parent}:{p.name}"]
|
||||
return []
|
||||
|
||||
# Complex or non-standard patterns: expand via filesystem glob
|
||||
full_pattern = str(repo_root / pattern)
|
||||
matches = sorted(glob.glob(full_pattern, recursive=True))
|
||||
labels: list[str] = []
|
||||
for match in matches:
|
||||
rel = os.path.relpath(match, repo_root)
|
||||
p = Path(rel)
|
||||
if p.is_file():
|
||||
labels.append(f"//{p.parent}:{p.name}")
|
||||
elif p.is_dir():
|
||||
labels.append(f"//{p}")
|
||||
return labels
|
||||
|
||||
|
||||
def _has_complex_wildcards(pattern: str) -> bool:
|
||||
"""Check if a pattern has complex wildcards beyond simple dir/*.ext or dir/**/*.ext."""
|
||||
if "[" in pattern:
|
||||
return True
|
||||
filename = Path(pattern).name
|
||||
if filename.count("*") > 1:
|
||||
return True
|
||||
if "*" in filename and filename not in ("*.js", "*.py", "*.json"):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def _render_bzl(selectors: dict[str, list[str]]) -> str:
|
||||
"""Render the selectors dict as a Starlark .bzl file."""
|
||||
lines = [
|
||||
'"""Auto-generated suite selector data. DO NOT EDIT.',
|
||||
"",
|
||||
"Generated by bazel/resmoke/derive_suite_selectors.py",
|
||||
'"""',
|
||||
"",
|
||||
"SUITE_SELECTORS = {",
|
||||
]
|
||||
for key in sorted(selectors.keys()):
|
||||
srcs = selectors[key]
|
||||
lines.append(f' "{key}": [')
|
||||
for src in srcs:
|
||||
lines.append(f' "{src}",')
|
||||
lines.append(" ],")
|
||||
lines.append("}")
|
||||
lines.append("")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def gen_suite_selectors(repo_root: Path) -> dict[str, object]:
|
||||
"""Main entry point. Parses suite YAMLs and generates the .bzl file.
|
||||
|
||||
Returns a dict with keys: ok (bool), wrote (bool), err (str|None), count (int), warnings (list[str]).
|
||||
"""
|
||||
try:
|
||||
output_file = repo_root / OUTPUT_FILE
|
||||
|
||||
suite_dirs = _discover_suite_dirs(repo_root)
|
||||
|
||||
selectors: dict[str, list[str]] = {}
|
||||
warnings: list[str] = []
|
||||
|
||||
for suite_dir, bazel_package, target_prefix in suite_dirs:
|
||||
abs_dir = repo_root / suite_dir
|
||||
if not abs_dir.is_dir():
|
||||
continue
|
||||
|
||||
for yml_path in sorted(abs_dir.glob("*.yml")):
|
||||
try:
|
||||
text = yml_path.read_text()
|
||||
except Exception as e:
|
||||
warnings.append(f"failed to read {yml_path}: {e}")
|
||||
continue
|
||||
|
||||
# Extract and parse only the selector block for speed.
|
||||
m = _SELECTOR_RE.search(text)
|
||||
if not m:
|
||||
continue
|
||||
try:
|
||||
cfg = yaml.load("selector:\n" + m.group(1), Loader=_YamlLoader)
|
||||
except yaml.YAMLError as e:
|
||||
warnings.append(f"failed to parse selector in {yml_path}: {e}")
|
||||
continue
|
||||
|
||||
selector = cfg.get("selector")
|
||||
if not selector or not isinstance(selector, dict):
|
||||
# Warn if the file looks like it should have a selector but we
|
||||
# couldn't parse one — likely a YAML indentation error.
|
||||
if "roots:" in text or "from_target:" in text:
|
||||
warnings.append(
|
||||
f"suite {yml_path.name} has selector/roots in text but "
|
||||
f"failed to parse — check YAML indentation"
|
||||
)
|
||||
continue
|
||||
|
||||
# Skip suites that use from_target
|
||||
if "from_target" in selector:
|
||||
continue
|
||||
|
||||
roots = selector.get("roots")
|
||||
if not roots or not isinstance(roots, list):
|
||||
continue
|
||||
|
||||
# Map each root glob to Bazel labels
|
||||
srcs: list[str] = []
|
||||
for root in roots:
|
||||
if not isinstance(root, str):
|
||||
continue
|
||||
labels = _glob_to_labels(root, repo_root)
|
||||
srcs.extend(labels)
|
||||
|
||||
if srcs:
|
||||
# Key format: "bazel_package:target_prefix/name.yml"
|
||||
key = f"//{bazel_package}:{target_prefix}/{yml_path.name}"
|
||||
selectors[key] = srcs
|
||||
|
||||
# Write the .bzl file
|
||||
content = _render_bzl(selectors)
|
||||
output_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Only write if content changed
|
||||
wrote = False
|
||||
if not output_file.exists() or output_file.read_text() != content:
|
||||
output_file.write_text(content)
|
||||
wrote = True
|
||||
|
||||
return {
|
||||
"ok": True,
|
||||
"wrote": wrote,
|
||||
"err": None,
|
||||
"count": len(selectors),
|
||||
"warnings": warnings,
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
return {"ok": False, "wrote": False, "err": str(e), "count": 0, "warnings": []}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
import time
|
||||
|
||||
repo_root = Path(__file__).parent.parent.parent
|
||||
start = time.perf_counter()
|
||||
result = gen_suite_selectors(repo_root)
|
||||
elapsed = time.perf_counter() - start
|
||||
|
||||
if result["ok"]:
|
||||
action = "wrote" if result["wrote"] else "no change"
|
||||
print(
|
||||
f"Generated suite selectors for {result['count']} suites ({action}) in {elapsed*1000:.1f}ms"
|
||||
)
|
||||
else:
|
||||
print(f"ERROR: {result['err']}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
@ -1,4 +1,5 @@
|
||||
load("//bazel:test_exec_properties.bzl", "test_exec_properties")
|
||||
load("//bazel/resmoke:.resmoke_suites_derived.bzl", "SUITE_SELECTORS")
|
||||
load("@rules_python//python:defs.bzl", "py_test")
|
||||
|
||||
def _collect_python_imports_impl(ctx):
|
||||
@ -32,94 +33,148 @@ _collect_python_imports = rule(
|
||||
doc = "Helper rule to collect Python imports from data dependencies",
|
||||
)
|
||||
|
||||
def resmoke_config_impl(ctx):
|
||||
def _resmoke_config_impl(ctx):
|
||||
"""Produces a resmoke config YAML for a suite.
|
||||
|
||||
In passthrough mode, copies the base config verbatim.
|
||||
Otherwise, generates a config by replacing roots with resolved srcs.
|
||||
"""
|
||||
base_name = ctx.label.name.removesuffix("_config")
|
||||
test_list_file = ctx.actions.declare_file(base_name + ".txt")
|
||||
generated_config_file = ctx.actions.declare_file(base_name + ".yml")
|
||||
base_config_file = ctx.files.base_config[0]
|
||||
|
||||
python = ctx.toolchains["@rules_python//python:toolchain_type"].py3_runtime
|
||||
python_path = []
|
||||
for path in ctx.attr.generator[PyInfo].imports.to_list():
|
||||
if path not in python_path:
|
||||
python_path.append(ctx.expand_make_variables("python_library_imports", "$(BINDIR)/external/" + path, ctx.var))
|
||||
generator_deps = [ctx.attr.generator[PyInfo].transitive_sources]
|
||||
if ctx.attr.passthrough:
|
||||
# Copy the original config as-is.
|
||||
ctx.actions.symlink(
|
||||
output = generated_config_file,
|
||||
target_file = base_config_file,
|
||||
)
|
||||
else:
|
||||
# Generate a config with resolved roots from srcs.
|
||||
test_list_file = ctx.actions.declare_file(base_name + ".txt")
|
||||
|
||||
test_list = [test.short_path for test in ctx.files.srcs]
|
||||
for exclude in [test.short_path for test in ctx.files.exclude_files]:
|
||||
if exclude in test_list:
|
||||
test_list.remove(exclude)
|
||||
ctx.actions.write(test_list_file, "\n".join(test_list))
|
||||
python = ctx.toolchains["@rules_python//python:toolchain_type"].py3_runtime
|
||||
python_path = []
|
||||
for path in ctx.attr.generator[PyInfo].imports.to_list():
|
||||
if path not in python_path:
|
||||
python_path.append(ctx.expand_make_variables("python_library_imports", "$(BINDIR)/external/" + path, ctx.var))
|
||||
generator_deps = [ctx.attr.generator[PyInfo].transitive_sources]
|
||||
|
||||
deps = depset([test_list_file, base_config_file] + ctx.files.srcs, transitive = [python.files] + generator_deps)
|
||||
test_list = [test.short_path for test in ctx.files.srcs]
|
||||
ctx.actions.write(test_list_file, "\n".join(test_list))
|
||||
|
||||
args = [
|
||||
"bazel/resmoke/resmoke_config_generator.py",
|
||||
"--output",
|
||||
generated_config_file.path,
|
||||
"--test-list",
|
||||
test_list_file.path,
|
||||
"--base-config",
|
||||
base_config_file.path,
|
||||
"--exclude-with-any-tags",
|
||||
",".join(ctx.attr.exclude_with_any_tags),
|
||||
"--include-with-any-tags",
|
||||
",".join(ctx.attr.include_with_any_tags),
|
||||
]
|
||||
if ctx.attr.group_size > 0:
|
||||
args.extend(["--group-size", str(ctx.attr.group_size)])
|
||||
if ctx.attr.group_count_multiplier != "":
|
||||
args.extend(["--group-count-multiplier", ctx.attr.group_count_multiplier])
|
||||
deps = depset([test_list_file, base_config_file] + ctx.files.srcs, transitive = [python.files] + generator_deps)
|
||||
|
||||
ctx.actions.run(
|
||||
executable = python.interpreter.path,
|
||||
inputs = deps,
|
||||
outputs = [generated_config_file],
|
||||
arguments = args,
|
||||
env = {"PYTHONPATH": ctx.configuration.host_path_separator.join(python_path)},
|
||||
)
|
||||
args = [
|
||||
"bazel/resmoke/resmoke_config_generator.py",
|
||||
"--output",
|
||||
generated_config_file.path,
|
||||
"--test-list",
|
||||
test_list_file.path,
|
||||
"--base-config",
|
||||
base_config_file.path,
|
||||
]
|
||||
|
||||
ctx.actions.run(
|
||||
executable = python.interpreter.path,
|
||||
inputs = deps,
|
||||
outputs = [generated_config_file],
|
||||
arguments = args,
|
||||
env = {"PYTHONPATH": ctx.configuration.host_path_separator.join(python_path)},
|
||||
)
|
||||
|
||||
return [DefaultInfo(files = depset([generated_config_file]))]
|
||||
|
||||
resmoke_config = rule(
|
||||
resmoke_config_impl,
|
||||
_resmoke_config_impl,
|
||||
attrs = {
|
||||
"generator": attr.label(
|
||||
doc = "The config generator to use.",
|
||||
default = "//bazel/resmoke:resmoke_config_generator",
|
||||
),
|
||||
"srcs": attr.label_list(allow_files = True, doc = "Tests to write as the 'roots' of the selector"),
|
||||
"exclude_files": attr.label_list(allow_files = True),
|
||||
"exclude_with_any_tags": attr.string_list(),
|
||||
"include_with_any_tags": attr.string_list(),
|
||||
"group_size": attr.int(default = 0, doc = "Number of tests to run in each group (for test_kind: parallel_fsm_workload_test)"),
|
||||
"group_count_multiplier": attr.string(default = "", doc = "Multiplier for the number of groups (for test_kind: parallel_fsm_workload_test)"),
|
||||
"passthrough": attr.bool(default = False, doc = "If true, copy the base config verbatim instead of generating."),
|
||||
"base_config": attr.label(
|
||||
allow_files = True,
|
||||
doc = "The base resmoke YAML config for the suite",
|
||||
),
|
||||
},
|
||||
doc = "Generates a resmoke config YAML",
|
||||
doc = "Produces a resmoke config YAML. In passthrough mode, copies the base config verbatim. Otherwise, replaces roots with resolved srcs.",
|
||||
toolchains = ["@rules_python//python:toolchain_type"],
|
||||
)
|
||||
|
||||
def _resolve_suite_srcs(config):
|
||||
"""Resolve srcs for a suite from the auto-generated selector data.
|
||||
|
||||
Extracts the config label's target path and looks it up in SUITE_SELECTORS.
|
||||
Returns the list of srcs labels, or an empty list if not found.
|
||||
"""
|
||||
config_str = str(config)
|
||||
|
||||
# Try direct lookup first (config is already a full label like
|
||||
# "//buildscripts/resmokeconfig:suites/auth.yml")
|
||||
if config_str in SUITE_SELECTORS:
|
||||
return SUITE_SELECTORS[config_str]
|
||||
|
||||
# Handle Label objects: convert to string "//pkg:target"
|
||||
if hasattr(config, "package") and hasattr(config, "name"):
|
||||
label_str = "//%s:%s" % (config.package, config.name)
|
||||
if label_str in SUITE_SELECTORS:
|
||||
return SUITE_SELECTORS[label_str]
|
||||
|
||||
return []
|
||||
|
||||
def resmoke_suite_test(
|
||||
name,
|
||||
config,
|
||||
data = [],
|
||||
deps = [],
|
||||
exclude_files = [],
|
||||
exclude_with_any_tags = [],
|
||||
include_with_any_tags = [],
|
||||
resmoke_args = [],
|
||||
size = "small",
|
||||
srcs = [],
|
||||
tags = [],
|
||||
timeout = "eternal",
|
||||
exec_properties = {},
|
||||
group_size = 0,
|
||||
group_count_multiplier = "",
|
||||
**kwargs):
|
||||
"""Creates a Bazel test target for a resmoke suite.
|
||||
|
||||
The suite's test files (srcs) are automatically derived from the YAML
|
||||
config's selector.roots field via pre-build generation. When srcs are
|
||||
auto-derived, the original YAML config is passed directly to resmoke.
|
||||
When explicit srcs are provided, a generated config with resolved roots
|
||||
is created instead.
|
||||
|
||||
Args:
|
||||
name: Target name.
|
||||
config: Label of the resmoke suite YAML config file.
|
||||
data: Additional data dependencies (JS libraries, certs, etc.).
|
||||
deps: Binary dependencies (mongod, mongos, etc.).
|
||||
resmoke_args: Additional command-line arguments for resmoke.
|
||||
size: Bazel test size.
|
||||
srcs: Override for test source files. If empty, auto-derived from config.
|
||||
tags: Bazel tags.
|
||||
timeout: Bazel test timeout.
|
||||
exec_properties: Execution properties for remote execution.
|
||||
**kwargs: Additional arguments passed to py_test (e.g., shard_count).
|
||||
"""
|
||||
|
||||
# Auto-derive srcs from the suite YAML if not explicitly provided.
|
||||
passthrough = not srcs
|
||||
if not srcs:
|
||||
srcs = _resolve_suite_srcs(config)
|
||||
if not srcs:
|
||||
fail("resmoke_suite_test '%s': no srcs provided and config '%s' not found in SUITE_SELECTORS. " +
|
||||
"Either provide explicit srcs or ensure the suite YAML has selector.roots." % (name, config))
|
||||
|
||||
generated_config = name + "_config"
|
||||
resmoke_config(
|
||||
name = generated_config,
|
||||
srcs = srcs,
|
||||
base_config = config,
|
||||
passthrough = passthrough,
|
||||
tags = ["resmoke_config"],
|
||||
)
|
||||
|
||||
historic_runtimes = name + "_historic_runtimes"
|
||||
native.genrule(
|
||||
name = historic_runtimes,
|
||||
@ -131,19 +186,6 @@ def resmoke_suite_test(
|
||||
tags = ["no-remote", "external", "no-cache"],
|
||||
)
|
||||
|
||||
generated_config = name + "_config"
|
||||
resmoke_config(
|
||||
name = generated_config,
|
||||
srcs = srcs,
|
||||
exclude_files = exclude_files,
|
||||
base_config = config,
|
||||
exclude_with_any_tags = exclude_with_any_tags,
|
||||
include_with_any_tags = include_with_any_tags,
|
||||
group_size = group_size,
|
||||
group_count_multiplier = group_count_multiplier,
|
||||
tags = ["resmoke_config"],
|
||||
)
|
||||
|
||||
# Collect Python imports from data dependencies
|
||||
python_imports_target = name + "_python_imports"
|
||||
_collect_python_imports(
|
||||
@ -207,8 +249,6 @@ def resmoke_suite_test(
|
||||
|
||||
py_test(
|
||||
name = name,
|
||||
# To a user of resmoke_suite_test, the `srcs` is the list of tests to select. However, to the py_test rule,
|
||||
# the `srcs` are expected to be Python files only.
|
||||
srcs = [resmoke_shim],
|
||||
data = merged_data + select({
|
||||
"//bazel/resmoke:installed_dist_test_enabled": ["//:installed-dist-test", "//:.resmoke_mongo_version.yml"],
|
||||
|
||||
@ -9,59 +9,21 @@ def main(
|
||||
output: Annotated[Path, typer.Option()],
|
||||
test_list: Annotated[Path, typer.Option()],
|
||||
base_config: Annotated[Path, typer.Option()],
|
||||
exclude_with_any_tags: Annotated[str, typer.Option()] = "",
|
||||
include_with_any_tags: Annotated[str, typer.Option()] = "",
|
||||
group_size: Annotated[
|
||||
int | None,
|
||||
typer.Option(
|
||||
help="Number of tests to run in each group (for test_kind: parallel_fsm_workload_test)"
|
||||
),
|
||||
] = None,
|
||||
group_count_multiplier: Annotated[
|
||||
str,
|
||||
typer.Option(
|
||||
help="Multiplier for the number of groups (for test_kind: parallel_fsm_workload_test)"
|
||||
),
|
||||
] = "",
|
||||
):
|
||||
with open(test_list, "rt") as fh:
|
||||
tests = [line.rstrip("\n") for line in fh]
|
||||
tests = [line.rstrip("\n") for line in fh if line.strip()]
|
||||
|
||||
with open(base_config, "rt") as fh:
|
||||
base_config_content = yaml.safe_load(fh)
|
||||
if "selector" in base_config_content:
|
||||
for x in [
|
||||
"roots",
|
||||
"exclude_files",
|
||||
"exclude_with_any_tags",
|
||||
"include_with_any_tags",
|
||||
"group_size",
|
||||
"group_count_multiplier",
|
||||
]:
|
||||
base_config_content["selector"].pop(x, None)
|
||||
content = yaml.safe_load(fh)
|
||||
|
||||
# Validate that group_size and group_count_multiplier are only used with parallel_fsm_workload_test
|
||||
if group_size is not None or group_count_multiplier != "":
|
||||
test_kind = base_config_content.get("test_kind")
|
||||
if test_kind != "parallel_fsm_workload_test":
|
||||
raise ValueError(
|
||||
f"group_size and group_count_multiplier can only be used with test_kind: parallel_fsm_workload_test, "
|
||||
f"but this config has test_kind: {test_kind}"
|
||||
)
|
||||
|
||||
content = base_config_content
|
||||
content["selector"] = {}
|
||||
# Replace only roots (and from_target) with the resolved file list.
|
||||
# All other selector fields (exclude_files, exclude_with_any_tags, etc.)
|
||||
# are preserved from the original YAML.
|
||||
if "selector" not in content:
|
||||
content["selector"] = {}
|
||||
content["selector"].pop("roots", None)
|
||||
content["selector"]["roots"] = tests
|
||||
|
||||
if exclude_with_any_tags != "":
|
||||
content["selector"]["exclude_with_any_tags"] = exclude_with_any_tags.split(",")
|
||||
if include_with_any_tags != "":
|
||||
content["selector"]["include_with_any_tags"] = include_with_any_tags.split(",")
|
||||
if group_size is not None:
|
||||
content["selector"]["group_size"] = group_size
|
||||
if group_count_multiplier != "":
|
||||
content["selector"]["group_count_multiplier"] = float(group_count_multiplier)
|
||||
|
||||
with open(output, "wt") as fh:
|
||||
yaml.dump(content, fh)
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
@ -84,6 +85,7 @@ def main():
|
||||
|
||||
from bazel.auto_header.auto_header import gen_auto_headers
|
||||
from bazel.auto_header.gen_all_headers import spawn_all_headers_thread
|
||||
from bazel.resmoke.derive_suite_selectors import gen_suite_selectors
|
||||
from bazel.wrapper_hook.autogenerated_targets import autogenerate_targets
|
||||
from bazel.wrapper_hook.check_resources import check_resource
|
||||
from bazel.wrapper_hook.engflow_check import engflow_auth
|
||||
@ -96,10 +98,20 @@ def main():
|
||||
|
||||
th_all_header, hdr_state_all_header = spawn_all_headers_thread(REPO_ROOT)
|
||||
|
||||
# Join the header generator before finalizing args.
|
||||
# Run resmoke suite selector generation in parallel with auto header generation
|
||||
suite_sel_state_container = {}
|
||||
|
||||
def _run_suite_selectors():
|
||||
suite_sel_state_container["result"] = gen_suite_selectors(REPO_ROOT)
|
||||
|
||||
th_suite_selectors = threading.Thread(target=_run_suite_selectors, daemon=True)
|
||||
th_suite_selectors.start()
|
||||
|
||||
start = time.perf_counter()
|
||||
auto_hdr_state = gen_auto_headers(REPO_ROOT)
|
||||
th_all_header.join()
|
||||
th_suite_selectors.join()
|
||||
|
||||
if hdr_state_all_header["ok"]:
|
||||
wrapper_debug(f'({"wrote" if hdr_state_all_header["wrote"] else "nochange"})')
|
||||
else:
|
||||
@ -109,9 +121,21 @@ def main():
|
||||
wrapper_debug(f'({"wrote" if auto_hdr_state["wrote"] else "nochange"})')
|
||||
else:
|
||||
print(f'[auto_headers] failed: {auto_hdr_state["err"]!r}')
|
||||
t_total_s = time.perf_counter() - start
|
||||
|
||||
_info(f"auto_header build generated: {_fmt_duration(t_total_s)}")
|
||||
suite_sel_state = suite_sel_state_container.get(
|
||||
"result", {"ok": False, "wrote": False, "err": "thread failed", "count": 0, "warnings": []}
|
||||
)
|
||||
if suite_sel_state["ok"]:
|
||||
wrapper_debug(
|
||||
f'suite_selectors: ({"wrote" if suite_sel_state["wrote"] else "nochange"}, {suite_sel_state["count"]} suites)'
|
||||
)
|
||||
for warning in suite_sel_state.get("warnings", []):
|
||||
_info(f"suite_selectors WARNING: {warning}")
|
||||
else:
|
||||
print(f'[suite_selectors] failed: {suite_sel_state["err"]!r}')
|
||||
|
||||
t_total_s = time.perf_counter() - start
|
||||
_info(f"pre-build generation: {_fmt_duration(t_total_s)}")
|
||||
|
||||
# This is used to autogenerate a BUILD.bazel that creates
|
||||
# Filegroups for select tags - used to group targets for installing
|
||||
|
||||
@ -132,6 +132,19 @@ def create_burn_in_target(target_original: str, target_burn_in: str, test: str):
|
||||
buildozer.bd_set([target_burn_in], "resmoke_args", resmoke_args_str)
|
||||
|
||||
|
||||
def _test_matches_roots(test_path: str, roots: list[str]) -> bool:
|
||||
"""Check if a test file path matches any of the selector roots patterns."""
|
||||
from pathlib import PurePosixPath
|
||||
|
||||
for root in roots:
|
||||
if root == test_path:
|
||||
return True
|
||||
if "*" in root or "?" in root or "[" in root:
|
||||
if PurePosixPath(test_path).match(root):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class BurnInTargetInfo(NamedTuple):
|
||||
burn_in_target: str
|
||||
original_target: str
|
||||
@ -173,7 +186,7 @@ def query_targets_to_burn_in(
|
||||
for test in tests_changed:
|
||||
if test in exclusions["selector"].get(test_kind, {}).get("exclude_tests", []):
|
||||
continue
|
||||
if test not in config["selector"].get("roots"):
|
||||
if not _test_matches_roots(test, config["selector"].get("roots", [])):
|
||||
continue
|
||||
|
||||
burn_in_target = (
|
||||
|
||||
@ -36,8 +36,8 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/accumulators/accumulator_js_size_limits.js
|
||||
- jstests/aggregation/exec/query_limits_test.js
|
||||
- jstests/aggregation/sources/geonear/geonear_hint.js
|
||||
|
||||
@ -39,8 +39,8 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/accumulators/accumulator_js_size_limits.js
|
||||
- jstests/aggregation/exec/query_limits_test.js
|
||||
- jstests/aggregation/sources/geonear/geonear_hint.js
|
||||
|
||||
@ -27,19 +27,12 @@ executor:
|
||||
mongod_options:
|
||||
set_parameters:
|
||||
enableTestCommands: 1
|
||||
internalQueryStatsErrorsAreCommandFatal: true
|
||||
internalQueryStatsRateLimit: -1
|
||||
internalQueryStatsWriteCmdSampleRate: 1
|
||||
mongos_options:
|
||||
set_parameters:
|
||||
enableTestCommands: 1
|
||||
internalQueryStatsErrorsAreCommandFatal: true
|
||||
internalQueryStatsRateLimit: -1
|
||||
internalQueryStatsWriteCmdSampleRate: 1
|
||||
num_mongos: 1
|
||||
num_shards: 2
|
||||
hooks:
|
||||
- class: RunQueryStats
|
||||
- class: CheckReplDBHash
|
||||
- class: CheckMetadataConsistencyInBackground
|
||||
- class: ValidateCollections
|
||||
@ -49,15 +42,15 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/exec/spill_to_disk.js
|
||||
- jstests/aggregation/optimization/match_swapping_renamed_fields.js
|
||||
- jstests/aggregation/optimization/use_query_sort.js
|
||||
- jstests/aggregation/optimization/use_query_project_and_sort.js
|
||||
- jstests/aggregation/optimization/use_query_projection.js
|
||||
- jstests/aggregation/sources/graphLookup/variables.js
|
||||
- jstests/aggregation/optimization/use_query_sort.js
|
||||
- jstests/aggregation/sources/group/groupMissing.js
|
||||
- jstests/aggregation/sources/graphLookup/variables.js
|
||||
- jstests/aggregation/accumulators/accumulator_js_size_limits.js
|
||||
- jstests/aggregation/exec/query_limits_test.js
|
||||
- jstests/aggregation/sources/geonear/geonear_hint.js
|
||||
|
||||
@ -29,19 +29,12 @@ executor:
|
||||
mongod_options:
|
||||
set_parameters:
|
||||
enableTestCommands: 1
|
||||
internalQueryStatsErrorsAreCommandFatal: true
|
||||
internalQueryStatsRateLimit: -1
|
||||
internalQueryStatsWriteCmdSampleRate: 1
|
||||
mongos_options:
|
||||
set_parameters:
|
||||
enableTestCommands: 1
|
||||
internalQueryStatsErrorsAreCommandFatal: true
|
||||
internalQueryStatsRateLimit: -1
|
||||
internalQueryStatsWriteCmdSampleRate: 1
|
||||
num_mongos: 3
|
||||
num_shards: 2
|
||||
hooks:
|
||||
- class: RunQueryStats
|
||||
- class: CheckReplDBHash
|
||||
- class: CheckMetadataConsistencyInBackground
|
||||
- class: ValidateCollections
|
||||
@ -51,15 +44,15 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/exec/spill_to_disk.js
|
||||
- jstests/aggregation/optimization/match_swapping_renamed_fields.js
|
||||
- jstests/aggregation/optimization/use_query_sort.js
|
||||
- jstests/aggregation/optimization/use_query_project_and_sort.js
|
||||
- jstests/aggregation/optimization/use_query_projection.js
|
||||
- jstests/aggregation/sources/graphLookup/variables.js
|
||||
- jstests/aggregation/optimization/use_query_sort.js
|
||||
- jstests/aggregation/sources/group/groupMissing.js
|
||||
- jstests/aggregation/sources/graphLookup/variables.js
|
||||
- jstests/aggregation/accumulators/accumulator_js_size_limits.js
|
||||
- jstests/aggregation/exec/query_limits_test.js
|
||||
- jstests/aggregation/sources/geonear/geonear_hint.js
|
||||
|
||||
@ -43,8 +43,8 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/sources/geonear/geonear_hint.js
|
||||
- jstests/aggregation/sources/lookup/lookup_query_stats.js
|
||||
- jstests/aggregation/sources/unionWith/unionWith_query_stats.js
|
||||
|
||||
@ -43,8 +43,8 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
- jstests/aggregation/sources/geonear/geonear_hint.js
|
||||
- jstests/aggregation/sources/lookup/lookup_query_stats.js
|
||||
- jstests/aggregation/sources/unionWith/unionWith_query_stats.js
|
||||
|
||||
@ -34,9 +34,9 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_with_any_tags: []
|
||||
roots:
|
||||
- jstests/core/**/*.js
|
||||
|
||||
@ -33,9 +33,9 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
- jstests/core/txns/**/*.js
|
||||
roots:
|
||||
- jstests/core/**/*.js
|
||||
- jstests/core_standalone/**/*.js
|
||||
|
||||
@ -43,9 +43,9 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/**/express.js
|
||||
- jstests/core/query/sort/sortk.js
|
||||
- jstests/core/query/sort/sorth.js
|
||||
|
||||
@ -32,9 +32,9 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/**/express.js
|
||||
- jstests/core/query/sort/sortk.js
|
||||
- jstests/core/query/sort/sorth.js
|
||||
|
||||
@ -33,9 +33,9 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_with_any_tags:
|
||||
- does_not_support_repeated_reads
|
||||
- requires_profiling
|
||||
|
||||
@ -35,9 +35,9 @@ executor:
|
||||
matrix_suite: true
|
||||
selector:
|
||||
exclude_files:
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
- jstests/core/txns/**/*.js
|
||||
- jstests/core/query/plan_cache/**/*.js
|
||||
- jstests/core/query/cbr_plan_in_cache_cbr_disabled.js
|
||||
exclude_with_any_tags:
|
||||
|
||||
@ -3,7 +3,11 @@ description: |
|
||||
This suite runs the tests in the aggregation sub-directory against a standalone mongod fixture.
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query:aggregation
|
||||
roots:
|
||||
- jstests/aggregation/**/*.js
|
||||
exclude_files:
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -11,7 +11,11 @@ config_variables:
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query:aggregation_auth
|
||||
roots:
|
||||
- jstests/aggregation/**/*.js
|
||||
exclude_files:
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
|
||||
executor:
|
||||
config:
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query-optimization:aggregation_disabled_optimization
|
||||
roots:
|
||||
- jstests/aggregation/**/*.js
|
||||
exclude_files:
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
exclude_with_any_tags:
|
||||
- requires_pipeline_optimization
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,28 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query:aggregation_read_concern_majority_passthrough
|
||||
roots:
|
||||
- jstests/aggregation/**/*.js
|
||||
exclude_files:
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
# This test specifies a $out stage not as the last stage in the aggregation pipeline, causing a
|
||||
# non-local readConcern to erroneously be sent with the command.
|
||||
- jstests/aggregation/sources/out/required_last_position.js
|
||||
# These tests fail due to the inability to specify a writeConcern when secondaryThrottle is not
|
||||
# set as part of the moveChunk command.
|
||||
- jstests/aggregation/sources/facet/use_cases.js
|
||||
exclude_with_any_tags:
|
||||
##
|
||||
# The next three tags correspond to the special errors thrown by the
|
||||
# set_read_and_write_concerns.js override when it refuses to replace the readConcern or
|
||||
# writeConcern of a particular command. Above each tag are the message(s) that cause the tag to be
|
||||
# warranted.
|
||||
##
|
||||
# "Cowardly refusing to override read concern of command: ..."
|
||||
- assumes_read_concern_unchanged
|
||||
# "Cowardly refusing to override write concern of command: ..."
|
||||
- assumes_write_concern_unchanged
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,34 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query:aggregation_sharded_collections_passthrough
|
||||
roots:
|
||||
- jstests/aggregation/**/*.js
|
||||
exclude_files:
|
||||
- jstests/aggregation/extras/*.js
|
||||
- jstests/aggregation/data/*.js
|
||||
# This test makes assertions about whether aggregations will need to spill to disk, which assumes
|
||||
# all the data is located on a single shard.
|
||||
- jstests/aggregation/exec/spill_to_disk.js
|
||||
# TODO SERVER-32311: These tests use getAggPlanStage(), which can't handle sharded explain output.
|
||||
- jstests/aggregation/optimization/match_swapping_renamed_fields.js
|
||||
- jstests/aggregation/optimization/use_query_project_and_sort.js
|
||||
- jstests/aggregation/optimization/use_query_projection.js
|
||||
- jstests/aggregation/optimization/use_query_sort.js
|
||||
# TODO: Remove when SERVER-23229 is fixed.
|
||||
- jstests/aggregation/sources/group/groupMissing.js
|
||||
- jstests/aggregation/sources/graphLookup/variables.js
|
||||
exclude_with_any_tags:
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
- assumes_no_implicit_collection_creation_on_get_collection
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
- assumes_against_mongod_not_mongos
|
||||
- assumes_no_implicit_collection_creation_after_drop
|
||||
- assumes_no_implicit_index_creation
|
||||
- assumes_unsharded_collection
|
||||
- cannot_create_unique_index_when_using_hashed_shard_key
|
||||
- requires_sharding
|
||||
- requires_profiling
|
||||
|
||||
executor:
|
||||
archive:
|
||||
@ -13,9 +40,6 @@ executor:
|
||||
shell_options:
|
||||
eval: await import("jstests/libs/override_methods/implicitly_shard_accessed_collections.js")
|
||||
hooks:
|
||||
# Be sure to run the hooks which depend on the fixture being alive before the CleanEveryN hook.
|
||||
# That way the fixture restart can't cause any trouble for the other hooks.
|
||||
- class: RunQueryStats
|
||||
- class: CheckReplDBHash
|
||||
- class: CheckMetadataConsistencyInBackground
|
||||
- class: ValidateCollections
|
||||
@ -29,12 +53,6 @@ executor:
|
||||
mongos_options:
|
||||
set_parameters:
|
||||
enableTestCommands: 1
|
||||
internalQueryStatsRateLimit: -1
|
||||
internalQueryStatsWriteCmdSampleRate: 1
|
||||
internalQueryStatsErrorsAreCommandFatal: true
|
||||
mongod_options:
|
||||
set_parameters:
|
||||
enableTestCommands: 1
|
||||
internalQueryStatsRateLimit: -1
|
||||
internalQueryStatsWriteCmdSampleRate: 1
|
||||
internalQueryStatsErrorsAreCommandFatal: true
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/security:auth
|
||||
roots:
|
||||
- jstests/auth/*.js
|
||||
exclude_files:
|
||||
# Skip until SERVER-25618 is resolved.
|
||||
- jstests/auth/repl.js
|
||||
|
||||
# Auth tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -4,7 +4,8 @@ description: |
|
||||
Hence, they require their own suite.
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/backup-restore:backup_restore
|
||||
roots:
|
||||
- src/mongo/db/modules/*/jstests/hot_backups/**/*.js
|
||||
|
||||
# backupRestore tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -5,7 +5,21 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:causally_consistent_jscore_txns_passthrough
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
# The following tests are excluded because they do not use the transactions shell helpers.
|
||||
- jstests/core/txns/non_transactional_operations_on_session_with_transaction.js
|
||||
# These tests rely on having read concerns that don't use afterClusterTime.
|
||||
- jstests/core/txns/timestamped_reads_wait_for_prepare_oplog_visibility.js
|
||||
# These tests rely on reads that cannot use an afterClusterTime read concern because the read
|
||||
# happens after a transaction is prepared, but before it is committed.
|
||||
- jstests/core/txns/prepare_conflict_aggregation_behavior.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- does_not_support_causal_consistency
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/security:client_encrypt
|
||||
roots:
|
||||
- jstests/client_encrypt/*.js
|
||||
|
||||
executor:
|
||||
config:
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
test_kind: fsm_workload_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query-execution:concurrency
|
||||
roots:
|
||||
- jstests/concurrency/fsm_workloads/**/*.js
|
||||
exclude_with_any_tags:
|
||||
- uses_transactions
|
||||
- requires_replication
|
||||
- requires_sharding
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,51 @@
|
||||
test_kind: fsm_workload_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:concurrency_replication_multi_stmt_txn
|
||||
roots:
|
||||
- jstests/concurrency/fsm_workloads/**/*.js
|
||||
exclude_files:
|
||||
##
|
||||
# Disabled due to MongoDB restrictions and/or workload restrictions
|
||||
##
|
||||
|
||||
# Relies on having one thread observe writes from the other threads, which won't become visible
|
||||
# once a transaction in the thread is started because it'll keep reading from the same snapshot.
|
||||
- jstests/concurrency/fsm_workloads/ddl/create_index_background/create_index_background.js
|
||||
- jstests/concurrency/fsm_workloads/ddl/create_index_background/create_index_background_partial_filter.js
|
||||
- jstests/concurrency/fsm_workloads/ddl/create_index_background/create_index_background_wildcard.js
|
||||
- jstests/concurrency/fsm_workloads/ddl/create_index_background/create_index_background_multi_doc_txn.js
|
||||
|
||||
# Expects reads to die with a particular error, but other errors are possible if the read is part
|
||||
# of a transaction (e.g. ErrorCodes.LockTimeout).
|
||||
- jstests/concurrency/fsm_workloads/query/drop_index_during_replan.js
|
||||
- jstests/concurrency/fsm_workloads/query/drop_index_during_lookup.js
|
||||
|
||||
# Performs direct writes to system.views
|
||||
- jstests/concurrency/fsm_workloads/view_catalog/view_catalog_direct_system_writes.js
|
||||
|
||||
# Extracts error code from write error, which is obscured by runInsideTransaction.
|
||||
- jstests/concurrency/fsm_workloads/access_collection_in_transaction_after_catalog_changes.js
|
||||
|
||||
# Induces non-blindly-retriable errors (see SERVER-45767).
|
||||
- jstests/concurrency/fsm_workloads/ddl/create_database.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- requires_standalone
|
||||
- requires_sharding
|
||||
# Snapshot reads in transactions are banned on capped collections.
|
||||
- requires_capped
|
||||
# Sharing cursors between state functions will fail in this suite because it will attempt to use
|
||||
# the same cursor in multiple transactions.
|
||||
- state_functions_share_cursor
|
||||
# These start a transaction in one state function and use it in other state functions. This suite
|
||||
# would instead execute each state function as its own transaction.
|
||||
- state_functions_share_transaction
|
||||
# Tests which expect commands to fail and catch the error can cause transactions to abort and
|
||||
# retry indefinitely.
|
||||
- catches_command_failures
|
||||
# time-series collections do not support write transactions
|
||||
- requires_timeseries
|
||||
- does_not_support_transactions
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,17 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query-execution:core
|
||||
roots:
|
||||
- jstests/core/**/*.js
|
||||
- jstests/core_standalone/**/*.js
|
||||
exclude_files:
|
||||
# Transactions are not supported on MongoDB standalone nodes, so we do not run these tests in the
|
||||
# 'core' suite. Instead we run them against a 1-node replica set in the 'core_txns' suite.
|
||||
- jstests/core/txns/**/*.js
|
||||
# Queryable encryption is not supported on standalone.
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
# Query settings are not supported on standalone.
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
executor:
|
||||
archive:
|
||||
hooks:
|
||||
|
||||
@ -11,7 +11,22 @@ config_variables:
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/security:core_auth
|
||||
roots:
|
||||
- jstests/core/**/*.js
|
||||
exclude_files:
|
||||
# Transactions are not supported on MongoDB standalone nodes.
|
||||
- jstests/core/txns/**/*.js
|
||||
# Skip any tests that run with auth explicitly.
|
||||
- jstests/core/**/*[aA]uth*.js
|
||||
# Commands using UUIDs are not compatible with name-based auth
|
||||
- jstests/core/**/commands_with_uuid.js
|
||||
# Queryable encryption is not supported on standalone.
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
# Query settings are not supported on standalone.
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
exclude_with_any_tags:
|
||||
# Multiple users cannot be authenticated on one connection within a session.
|
||||
- creates_and_authenticates_user
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,17 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query-execution:core
|
||||
roots:
|
||||
- jstests/core/**/*.js
|
||||
- jstests/core_standalone/**/*.js
|
||||
exclude_files:
|
||||
# Transactions are not supported on MongoDB standalone nodes, so we do not run these tests in the
|
||||
# 'core' suite. Instead we run them against a 1-node replica set in the 'core_txns' suite.
|
||||
- jstests/core/txns/**/*.js
|
||||
# Queryable encryption is not supported on standalone.
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
# Query settings are not supported on standalone.
|
||||
- jstests/core/query/query_settings/**/*.js
|
||||
executor:
|
||||
archive:
|
||||
hooks:
|
||||
|
||||
@ -7,7 +7,11 @@
|
||||
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:core_txns
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_with_any_tags:
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -8,7 +8,11 @@
|
||||
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:core_txns_large_txns_format
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_with_any_tags:
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/programmability:failpoints
|
||||
roots:
|
||||
- jstests/fail_point/*.js
|
||||
|
||||
# Failpoint tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -6,7 +6,8 @@ config_variables:
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/programmability:failpoints_auth
|
||||
roots:
|
||||
- jstests/fail_point/*.js
|
||||
|
||||
# Failpoint tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/programmability:libunwind
|
||||
roots:
|
||||
- jstests/libunwind/*.js
|
||||
|
||||
executor:
|
||||
config: {}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/security:ocsp
|
||||
roots:
|
||||
- jstests/ocsp/*.js
|
||||
|
||||
executor:
|
||||
config:
|
||||
|
||||
@ -4,7 +4,8 @@ description: |
|
||||
restored using queryable WT."
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/backup-restore:queryable_wt
|
||||
roots:
|
||||
- src/mongo/db/modules/*/jstests/queryable_wt/*.js
|
||||
|
||||
# Tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -4,7 +4,14 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:replica_sets_large_txns_format_jscore_passthrough
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
# These tests change the transactionLifetimeLimitSeconds server parameter which conflicts with how
|
||||
# the CheckReplDBHashInBackground hook doesn't want transactions to be reaped while it is running.
|
||||
- jstests/core/txns/abort_expired_transaction.js
|
||||
- jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js
|
||||
- jstests/core/txns/kill_op_on_txn_expiry.js
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query-integration-search:search_community
|
||||
roots:
|
||||
- jstests/with_mongot/search_mocked/*.js
|
||||
- jstests/with_mongot/mongotmock/*.js
|
||||
exclude_with_any_tags:
|
||||
- requires_auth
|
||||
- search_community_incompatible
|
||||
|
||||
executor:
|
||||
config:
|
||||
|
||||
@ -7,7 +7,11 @@ description: >-
|
||||
testing.
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query-integration-search:search_community_ssl
|
||||
roots:
|
||||
- jstests/with_mongot/search_mocked/ssl/*.js
|
||||
exclude_with_any_tags:
|
||||
- requires_auth
|
||||
- search_community_incompatible
|
||||
|
||||
executor:
|
||||
config:
|
||||
|
||||
@ -4,7 +4,33 @@
|
||||
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:sharded_causally_consistent_jscore_txns_passthrough
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
- jstests/core/txns/transactions_profiling.js
|
||||
- jstests/core/txns/transactions_profiling_with_drops.js
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
- jstests/core/txns/abort_expired_transaction.js
|
||||
- jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js
|
||||
- jstests/core/txns/kill_op_on_txn_expiry.js
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
- jstests/core/txns/speculative_snapshot_includes_all_writes.js
|
||||
|
||||
# Does not use the transactions shell helpers so afterClusterTime read concern is incorrectly
|
||||
# attached to statements in a transaction beyond the first one.
|
||||
- jstests/core/txns/non_transactional_operations_on_session_with_transaction.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_against_mongod_not_mongos
|
||||
- does_not_support_causal_consistency
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
# Prepare is not a command on mongos.
|
||||
- uses_prepare_transaction
|
||||
- requires_2_or_more_shards
|
||||
executor:
|
||||
archive:
|
||||
hooks:
|
||||
|
||||
@ -1,6 +1,48 @@
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:sharded_collections_causally_consistent_jscore_txns_passthrough
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
- jstests/core/txns/transactions_profiling.js
|
||||
- jstests/core/txns/transactions_profiling_with_drops.js
|
||||
|
||||
# Set the transactionLifetimeLimitSeconds parameter, which is not on mongos.
|
||||
- jstests/core/txns/abort_expired_transaction.js
|
||||
- jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js
|
||||
- jstests/core/txns/kill_op_on_txn_expiry.js
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
- jstests/core/txns/speculative_snapshot_includes_all_writes.js
|
||||
|
||||
# Does not use the transactions shell helpers so afterClusterTime read concern is incorrectly
|
||||
# attached to statements in a transaction beyond the first one.
|
||||
- jstests/core/txns/non_transactional_operations_on_session_with_transaction.js
|
||||
|
||||
# These workloads explicitly create collections inside multi-document transactions. These are
|
||||
# non-idempotent operations, and the implicit collection sharding logic upon collection access
|
||||
# results in premature collection creation, causing the workloads to fail.
|
||||
- jstests/core/txns/create_collection.js
|
||||
- jstests/core/txns/create_collection_parallel.js
|
||||
- jstests/core/txns/create_indexes.js
|
||||
- jstests/core/txns/create_indexes_parallel.js
|
||||
- jstests/core/txns/commands_in_txns_read_concern.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_against_mongod_not_mongos
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
- assumes_no_implicit_collection_creation_on_get_collection
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
- assumes_no_implicit_collection_creation_after_drop
|
||||
- assumes_no_implicit_index_creation
|
||||
- assumes_unsharded_collection
|
||||
- cannot_create_unique_index_when_using_hashed_shard_key
|
||||
- does_not_support_causal_consistency
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
# Prepare is not a command on mongos.
|
||||
- uses_prepare_transaction
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -6,7 +6,69 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/workload-resilience:sharded_collections_jscore_passthrough_rate_limited
|
||||
roots:
|
||||
- jstests/core/**/*.js
|
||||
- jstests/core_sharding/**/*.js
|
||||
- jstests/fle2/**/*.js
|
||||
- src/mongo/db/modules/*/jstests/fle2/**/*.js
|
||||
exclude_files:
|
||||
# These tests run in the jscore_txn passthrough suites.
|
||||
- jstests/core/txns/**/*.js
|
||||
|
||||
# The following tests fail because a certain command or functionality is not supported by
|
||||
# mongos. This command or functionality is placed in a comment next to the failing test.
|
||||
- jstests/core/**/apitest_db.js # serverStatus output doesn't have storageEngine.
|
||||
- jstests/core/**/awaitdata_getmore_cmd.js # capped collections.
|
||||
- jstests/core/**/bypass_doc_validation.js # sharded $out output not permitted
|
||||
- jstests/core/**/check_shard_index.js # checkShardingIndex.
|
||||
- jstests/core/**/compact_keeps_indexes.js # compact.
|
||||
- jstests/core/**/currentop.js # uses fsync.
|
||||
- jstests/core/**/dbhash.js # dbhash.
|
||||
- jstests/core/**/fsync.js # uses fsync.
|
||||
- jstests/core/**/geo_s2cursorlimitskip.js # profiling.
|
||||
- jstests/core/**/geo_update_btree2.js # notablescan.
|
||||
- jstests/core/**/queryoptimizera.js # "local" database.
|
||||
- jstests/core/**/startup_log.js # "local" database.
|
||||
- jstests/core/**/tailable_cursor_invalidation.js # capped collections.
|
||||
- jstests/core/**/tailable_getmore_batch_size.js # capped collections.
|
||||
- jstests/core/**/tailable_skip_limit.js # capped collections.
|
||||
- jstests/core/**/query/top/top.js # top.
|
||||
# The following tests fail because mongos behaves differently from mongod when testing certain
|
||||
# functionality. The differences are in a comment next to the failing test.
|
||||
- jstests/core/**/geo_2d_explain.js # executionSuccess in different spot in explain().
|
||||
- jstests/core/**/geo_s2explain.js # inputStage in different spot in explain().
|
||||
- jstests/core/**/geo_s2sparse.js # keysPerIndex in different spot in validate().
|
||||
- jstests/core/**/operation_latency_histogram.js # Stats are counted differently on mongos, SERVER-24880.
|
||||
# The following tests fail because they count indexes. These counts do not take into account the
|
||||
# additional hashed shard key indexes that are automatically added by this passthrough.
|
||||
- jstests/core/**/apitest_dbcollection.js
|
||||
- jstests/core/**/bad_index_plugin.js
|
||||
- jstests/core/**/create_indexes.js
|
||||
- jstests/core/**/list_indexes_non_existent_ns.js
|
||||
- jstests/core/**/mr_preserve_indexes.js
|
||||
# TODO: Remove after fixing SERVER-103278. executionStats.nReturned is incorrect for sharded distinct commands.
|
||||
- jstests/core/**/distinct_index1.js
|
||||
# TODO SERVER-32311: These tests use plan stage helpers which can't handle sharded explain output.
|
||||
- jstests/core/**/expr_index_use.js
|
||||
- jstests/core/**/index_multikey.js
|
||||
- jstests/core/**/query/explain/optimized_match_explain.js
|
||||
- jstests/core/**/sort_array.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_standalone_mongod
|
||||
- assumes_against_mongod_not_mongos
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
- assumes_no_implicit_collection_creation_on_get_collection
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
- assumes_no_implicit_collection_creation_after_drop
|
||||
- assumes_no_implicit_index_creation
|
||||
- assumes_unsharded_collection
|
||||
- cannot_create_unique_index_when_using_hashed_shard_key
|
||||
# system.profile collection doesn't exist on mongos.
|
||||
- requires_profiling
|
||||
# Capped collections cannot be sharded
|
||||
- requires_capped
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,6 +1,44 @@
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:sharded_collections_txns_uninitialized_fcv_jscore_passthrough
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
### Tests that are excluded because of sharding and transactions (from sharded_jscore_txns_sharded_collections.yml)
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
- jstests/core/txns/transactions_profiling.js
|
||||
- jstests/core/txns/transactions_profiling_with_drops.js
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
- jstests/core/txns/abort_expired_transaction.js
|
||||
- jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js
|
||||
- jstests/core/txns/kill_op_on_txn_expiry.js
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
- jstests/core/txns/speculative_snapshot_includes_all_writes.js
|
||||
|
||||
# These workloads explicitly create collections inside multi-document transactions. These are
|
||||
# non-idempotent operations, and the implicit collection sharding logic upon collection access
|
||||
# results in premature collection creation, causing the workloads to fail.
|
||||
- jstests/core/txns/create_collection.js
|
||||
- jstests/core/txns/create_collection_parallel.js
|
||||
- jstests/core/txns/create_indexes.js
|
||||
- jstests/core/txns/create_indexes_parallel.js
|
||||
- jstests/core/txns/commands_in_txns_read_concern.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_against_mongod_not_mongos
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
- assumes_no_implicit_collection_creation_on_get_collection
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
- assumes_no_implicit_collection_creation_after_drop
|
||||
- assumes_no_implicit_index_creation
|
||||
- assumes_unsharded_collection
|
||||
- cannot_create_unique_index_when_using_hashed_shard_key
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
# Prepare is not a command on mongos.
|
||||
- uses_prepare_transaction
|
||||
|
||||
executor:
|
||||
hooks:
|
||||
|
||||
@ -4,7 +4,28 @@
|
||||
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:sharded_jscore_txns
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
- jstests/core/txns/transactions_profiling.js
|
||||
- jstests/core/txns/transactions_profiling_with_drops.js
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
- jstests/core/txns/abort_expired_transaction.js
|
||||
- jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js
|
||||
- jstests/core/txns/kill_op_on_txn_expiry.js
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
- jstests/core/txns/speculative_snapshot_includes_all_writes.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_against_mongod_not_mongos
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
# Prepare is not a command on mongos.
|
||||
- uses_prepare_transaction
|
||||
- requires_2_or_more_shards
|
||||
executor:
|
||||
archive:
|
||||
hooks:
|
||||
|
||||
@ -1,6 +1,43 @@
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:sharded_jscore_txns_sharded_collections
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
- jstests/core/txns/transactions_profiling.js
|
||||
- jstests/core/txns/transactions_profiling_with_drops.js
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
- jstests/core/txns/abort_expired_transaction.js
|
||||
- jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js
|
||||
- jstests/core/txns/kill_op_on_txn_expiry.js
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
- jstests/core/txns/speculative_snapshot_includes_all_writes.js
|
||||
|
||||
# These workloads explicitly create collections inside multi-document transactions. These are
|
||||
# non-idempotent operations, and the implicit collection sharding logic upon collection access
|
||||
# results in premature collection creation, causing the workloads to fail.
|
||||
- jstests/core/txns/create_collection.js
|
||||
- jstests/core/txns/create_collection_parallel.js
|
||||
- jstests/core/txns/create_indexes.js
|
||||
- jstests/core/txns/create_indexes_parallel.js
|
||||
- jstests/core/txns/commands_in_txns_read_concern.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_against_mongod_not_mongos
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
- assumes_no_implicit_collection_creation_on_get_collection
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
- assumes_no_implicit_collection_creation_after_drop
|
||||
- assumes_no_implicit_index_creation
|
||||
- assumes_unsharded_collection
|
||||
- cannot_create_unique_index_when_using_hashed_shard_key
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
# Prepare is not a command on mongos.
|
||||
- uses_prepare_transaction
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -6,7 +6,69 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/workload-resilience:sharding_jscore_passthrough_with_balancer_rate_limited
|
||||
roots:
|
||||
- jstests/core/**/*.js
|
||||
- jstests/core_sharding/**/*.js
|
||||
- jstests/fle2/**/*.js
|
||||
- src/mongo/db/modules/*/jstests/fle2/**/*.js
|
||||
exclude_files:
|
||||
# These tests use chunk migration, and they expect the balancer to be disabled.
|
||||
- jstests/core_sharding/chunk_migration/*.js
|
||||
# These tests are run in sharded_jscore_txns.
|
||||
- jstests/core/txns/**/*.js
|
||||
# TODO SERVER-87108 re-enable all map reduce tests
|
||||
- jstests/core/query/map_reduce/*.js
|
||||
# The following tests fail because a certain command or functionality is not supported on
|
||||
# mongos. This command or functionality is placed in a comment next to the failing test.
|
||||
- jstests/core/**/apitest_db.js # serverStatus output doesn't have storageEngine.
|
||||
- jstests/core/**/check_shard_index.js # checkShardingIndex.
|
||||
- jstests/core/**/compact_keeps_indexes.js # compact.
|
||||
- jstests/core/**/currentop.js # uses fsync.
|
||||
- jstests/core/**/dbhash.js # dbhash.
|
||||
- jstests/core/**/fsync.js # uses fsync.
|
||||
- jstests/core/**/geo_s2cursorlimitskip.js # profiling.
|
||||
- jstests/core/**/geo_update_btree2.js # notablescan.
|
||||
- jstests/core/**/queryoptimizera.js # "local" database.
|
||||
- jstests/core/**/startup_log.js # "local" database.
|
||||
- jstests/core/**/query/top/top.js # top.
|
||||
# The following tests fail because mongos behaves differently from mongod when testing certain
|
||||
# functionality. The differences are in a comment next to the failing test.
|
||||
- jstests/core/**/geo_2d_explain.js # executionSuccess in different spot in explain().
|
||||
- jstests/core/**/geo_s2explain.js # inputStage in different spot in explain().
|
||||
- jstests/core/**/geo_s2sparse.js # keysPerIndex in different spot in validate().
|
||||
- jstests/core/**/operation_latency_histogram.js # Stats are counted differently on mongos, SERVER-24880.
|
||||
# override library is not able to intercept createIndex commands executed inside benchRun
|
||||
- jstests/core/**/bench_test1.js
|
||||
# moveCollection will drop indexes which will reset index statistics this test asserts on.
|
||||
- jstests/core/index/index_stats.js
|
||||
# moveCollection and the many deleteMany commands in this test block each other and can easily cause the test to time out.
|
||||
# This is caused by the pauseMigrationsDuringMultiUpdates cluster parameter and the random migrations failpoint both being enabled for this suite.
|
||||
# TODO SERVER-91655: re-enable this test in this suite or potentially in a noPassthrough suite.
|
||||
- jstests/core/timeseries/query/timeseries_predicates.js
|
||||
# moveCollection and the many multi updates in this test block each other and can easily cause the test to time out.
|
||||
# This is caused by the pauseMigrationsDuringMultiUpdates cluster parameter and the random migrations failpoint both being enabled for this suite.
|
||||
# TODO SERVER-91722: re-enable this test in this suite or potentially in a noPassthrough suite.
|
||||
- jstests/core/index/geo/geo_update_btree.js
|
||||
# TODO SERVER-88275: A moveCollection command changes the UUID of the targeted collection.
|
||||
# Any query using an auto yielding policy will likely return a QueryPlanKilled error if a moveCollection commit happens during the query execution.
|
||||
- jstests/core/timeseries/geo/timeseries_geonear_random_measurements.js
|
||||
- jstests/core/timeseries/query/timeseries_homogeneous_top_bottom.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_standalone_mongod
|
||||
- assumes_against_mongod_not_mongos
|
||||
# system.profile collection doesn't exist on mongos.
|
||||
- requires_profiling
|
||||
- assumes_balancer_off
|
||||
# fsync lock is not compatible with migrations since it
|
||||
# can't be executed while DDL lock is being held.
|
||||
- requires_fsync
|
||||
# This suite performs balancing of unsharded collection in background
|
||||
# using moveCollection that changes collections UUID
|
||||
- assumes_stable_collection_uuid
|
||||
# implicitly_retry_on_migration_in_progress.js alters find/aggregate commands
|
||||
# so that the whole result set is returned through a single batch
|
||||
- assumes_no_implicit_cursor_exhaustion
|
||||
|
||||
executor:
|
||||
archive:
|
||||
|
||||
@ -1,6 +1,27 @@
|
||||
test_kind: js_test
|
||||
selector:
|
||||
from_target: //jstests/suites/transactions:sharding_txns_uninitialized_fcv_jscore_passthrough
|
||||
roots:
|
||||
- jstests/core/txns/**/*.js
|
||||
exclude_files:
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
- jstests/core/txns/transactions_profiling.js
|
||||
- jstests/core/txns/transactions_profiling_with_drops.js
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
- jstests/core/txns/abort_expired_transaction.js
|
||||
- jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js
|
||||
- jstests/core/txns/kill_op_on_txn_expiry.js
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
- jstests/core/txns/speculative_snapshot_includes_all_writes.js
|
||||
|
||||
exclude_with_any_tags:
|
||||
- assumes_against_mongod_not_mongos
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
- requires_capped
|
||||
# Prepare is not a command on mongos.
|
||||
- uses_prepare_transaction
|
||||
- requires_2_or_more_shards
|
||||
executor:
|
||||
hooks:
|
||||
- class: CleanEveryN
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/security:ssl
|
||||
roots:
|
||||
- jstests/ssl/*.js
|
||||
- src/mongo/db/modules/*/jstests/fips/*.js
|
||||
|
||||
# ssl tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -3,7 +3,8 @@ test_kind: js_test
|
||||
# Similar to the `ssl` suite, but configured by evergreen to run sequentially, so that the
|
||||
# contents of the Windows system certificate store are only affected by one test at a time.
|
||||
selector:
|
||||
from_target: //jstests/suites/security:ssl_linear
|
||||
roots:
|
||||
- jstests/ssl_linear/*.js
|
||||
|
||||
# ssl tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/security:ssl_special
|
||||
roots:
|
||||
- jstests/sslSpecial/*.js
|
||||
|
||||
# ssl tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/security:ssl_x509
|
||||
roots:
|
||||
- jstests/ssl_x509/*.js
|
||||
|
||||
# ssl tests start their own mongod's.
|
||||
executor:
|
||||
|
||||
@ -1,7 +1,38 @@
|
||||
test_kind: js_test
|
||||
|
||||
selector:
|
||||
from_target: //jstests/suites/query-integration-timeseries:timeseries_crud_jscore_passthrough
|
||||
roots:
|
||||
- jstests/core/query/**/*.js
|
||||
- jstests/core/write/**/*.js
|
||||
exclude_files:
|
||||
# The paths below are excluded from running in this suite because prior to moving under the
|
||||
# 'query' directory, they were not running in this suite.
|
||||
# TODO SERVER-94567 Determine if any of these tests can be enabled.
|
||||
- jstests/core/query/json_schema/**/*.js
|
||||
- jstests/core/query/doc_validation/**/*.js
|
||||
- jstests/core/query/api/**/*.js
|
||||
- jstests/core/query/queryable_encryption/**/*.js
|
||||
- jstests/core/query/sbe/**/*.js
|
||||
|
||||
# Hashed indexes.
|
||||
- jstests/core/query/internal_hash_eq/**/*.js
|
||||
|
||||
# Explain will return different plan than expected when a collection becomes a time-series
|
||||
# collection. Also, query shape will be different.
|
||||
- jstests/core/query/explain/**/*.js
|
||||
|
||||
- jstests/core/query/elemmatch/**/*.js # $elemMatch
|
||||
|
||||
# Time-series collections are views which don't support map-reduce
|
||||
- jstests/core/query/map_reduce/**/*.js
|
||||
|
||||
- jstests/core/query/js/**/*.js
|
||||
- jstests/core/query/where/**/*.js
|
||||
exclude_with_any_tags:
|
||||
- requires_sharding
|
||||
- requires_capped
|
||||
- assumes_standalone_mongod
|
||||
- exclude_from_timeseries_crud_passthrough
|
||||
executor:
|
||||
archive:
|
||||
hooks:
|
||||
|
||||
@ -5,7 +5,6 @@ py_library(
|
||||
name = "resmokelib",
|
||||
srcs = [
|
||||
"__init__.py",
|
||||
"bazel_suite_parser.py",
|
||||
"cli.py",
|
||||
"config.py",
|
||||
"configure_resmoke.py",
|
||||
|
||||
@ -1,367 +0,0 @@
|
||||
"""Parser for BUILD.bazel files to extract resmoke_suite_test configuration.
|
||||
|
||||
This module parses BUILD.bazel files without invoking bazel, supporting a simplified
|
||||
subset of Bazel syntax:
|
||||
- Simple lists of targets (no select() expressions)
|
||||
- Direct file targets (e.g., "//jstests/foo:bar.js")
|
||||
- all_javascript_files targets (globs *.js in directory)
|
||||
- all_subpackage_javascript_files targets (recursively includes all JS from subpackages)
|
||||
"""
|
||||
|
||||
import functools
|
||||
import os
|
||||
import re
|
||||
|
||||
from buildscripts.resmokelib import config
|
||||
|
||||
|
||||
class BazelParseError(Exception):
|
||||
"""Exception raised when parsing BUILD.bazel files fails."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
@functools.cache
|
||||
def parse_resmoke_suite_test(target_label: str) -> dict[str, list[str]]:
|
||||
"""Parse a resmoke_suite_test target from BUILD.bazel.
|
||||
Args:
|
||||
target_label: Bazel target label like "//buildscripts/resmokeconfig:core"
|
||||
Returns:
|
||||
Dictionary with extracted attributes:
|
||||
- srcs: List of test file labels
|
||||
- exclude_files: List of test file labels to exclude
|
||||
- exclude_with_any_tags: List of tag strings
|
||||
- include_with_any_tags: List of tag strings
|
||||
- group_size: Integer or None for number of tests per group (for test_kind: parallel_fsm_workload_test)
|
||||
- group_count_multiplier: String for group count multiplier (for test_kind: parallel_fsm_workload_test)
|
||||
Raises:
|
||||
BazelParseError: If BUILD.bazel file not found or target not found
|
||||
"""
|
||||
package, target_name = _parse_label(target_label)
|
||||
build_file = os.path.join(package, "BUILD.bazel")
|
||||
|
||||
if not os.path.exists(build_file):
|
||||
raise BazelParseError(
|
||||
f"BUILD.bazel file not found at '{build_file}' for target '{target_label}'"
|
||||
)
|
||||
with open(build_file, "r") as f:
|
||||
content = f.read()
|
||||
|
||||
# Parse load statements to build identifier -> .bzl file mapping
|
||||
identifier_to_bzl_file = _parse_load_statements(content, package)
|
||||
|
||||
# Find the resmoke_suite_test block
|
||||
# Pattern matches: resmoke_suite_test(name = "target_name", ...)
|
||||
pattern = r'resmoke_suite_test\s*\(\s*name\s*=\s*["\']' + re.escape(target_name) + r'["\']'
|
||||
match = re.search(pattern, content)
|
||||
if not match:
|
||||
raise BazelParseError(
|
||||
f"Target '{target_name}' not found in '{build_file}'. "
|
||||
f'Expected a resmoke_suite_test rule with name = "{target_name}"'
|
||||
)
|
||||
|
||||
# Extract the rule block by finding balanced parentheses
|
||||
rule_start = match.start()
|
||||
paren_start = content.index("(", rule_start)
|
||||
paren_count = 0
|
||||
rule_end = paren_start
|
||||
for i in range(paren_start, len(content)):
|
||||
if content[i] == "(":
|
||||
paren_count += 1
|
||||
elif content[i] == ")":
|
||||
paren_count -= 1
|
||||
if paren_count == 0:
|
||||
rule_end = i + 1
|
||||
break
|
||||
|
||||
if paren_count != 0:
|
||||
raise BazelParseError(
|
||||
f"Unbalanced parentheses in resmoke_suite_test definition for '{target_label}'"
|
||||
)
|
||||
rule_block = content[rule_start:rule_end]
|
||||
|
||||
return {
|
||||
"srcs": _extract_attribute(rule_block, "srcs", identifier_to_bzl_file, build_file),
|
||||
"exclude_files": _extract_attribute(
|
||||
rule_block, "exclude_files", identifier_to_bzl_file, build_file
|
||||
),
|
||||
"exclude_with_any_tags": _extract_attribute(
|
||||
rule_block, "exclude_with_any_tags", identifier_to_bzl_file, build_file
|
||||
),
|
||||
"include_with_any_tags": _extract_attribute(
|
||||
rule_block, "include_with_any_tags", identifier_to_bzl_file, build_file
|
||||
),
|
||||
"group_size": _extract_int_attribute(rule_block, "group_size"),
|
||||
"group_count_multiplier": _extract_scalar_attribute(rule_block, "group_count_multiplier"),
|
||||
}
|
||||
|
||||
|
||||
def _parse_label(target_label: str) -> tuple[str, str]:
|
||||
"""Parse a Bazel target label into package path and target name.
|
||||
Args:
|
||||
target_label: A Bazel target label like "//package/path:target_name"
|
||||
Returns:
|
||||
Tuple of (absolute_package_path, target_name) where absolute_package_path
|
||||
is the full path to the package directory (for finding BUILD.bazel files).
|
||||
Raises:
|
||||
BazelParseError: If the label format is invalid
|
||||
"""
|
||||
if not target_label.startswith("//"):
|
||||
raise BazelParseError(
|
||||
f"Unsupported Bazel target label '{target_label}': must start with '//'"
|
||||
)
|
||||
# Remove leading "//"
|
||||
label_without_prefix = target_label[2:]
|
||||
|
||||
# Split on ":"
|
||||
if ":" not in label_without_prefix:
|
||||
raise BazelParseError(
|
||||
f"Unsupported Bazel target label '{target_label}': must contain ':' separator"
|
||||
)
|
||||
package, target_name = label_without_prefix.split(":", 1)
|
||||
|
||||
# Return absolute path for finding BUILD.bazel files
|
||||
return os.path.join(config.RESMOKE_ROOT, package), target_name
|
||||
|
||||
|
||||
def _parse_load_statements(content: str, package: str) -> dict[str, str]:
|
||||
"""Parse load statements from BUILD.bazel content.
|
||||
|
||||
Extracts identifier to .bzl file mappings from load statements.
|
||||
Example: load("//path/to:file.bzl", "identifier1", "identifier2")
|
||||
|
||||
Args:
|
||||
content: The BUILD.bazel file content
|
||||
package: The package path of the BUILD.bazel file
|
||||
|
||||
Returns:
|
||||
Dictionary mapping identifier names to absolute .bzl file paths
|
||||
"""
|
||||
identifier_to_bzl_file = {}
|
||||
|
||||
# Find all load statements
|
||||
for line in content.split("\n"):
|
||||
if not line.strip().startswith("load("):
|
||||
continue
|
||||
|
||||
# Extract the full load statement (may span multiple lines)
|
||||
# Looking for load("//path/to:file.bzl", "identifier1", "identifier2", ...)
|
||||
match = re.match(r'load\s*\(\s*["\']([^"\']+)["\'](.+?)\)', line)
|
||||
if match:
|
||||
bzl_label = match.group(1)
|
||||
identifiers_str = match.group(2)
|
||||
|
||||
# Convert the .bzl label to a file path
|
||||
# Example: "//jstests/suites:selectors.bzl"
|
||||
# -> "/absolute/path/to/jstests/suites/selectors.bzl"
|
||||
if bzl_label.startswith("//"):
|
||||
# Absolute Bazel label - resolve relative to RESMOKE_ROOT
|
||||
relative_path = bzl_label[2:].replace(":", "/")
|
||||
bzl_path = os.path.normpath(os.path.join(config.RESMOKE_ROOT, relative_path))
|
||||
else:
|
||||
# Relative path - resolve relative to current package
|
||||
# Strip leading ':' if present (package-relative reference)
|
||||
relative_part = bzl_label[1:] if bzl_label.startswith(":") else bzl_label
|
||||
bzl_path = os.path.normpath(os.path.join(package, relative_part.replace(":", "/")))
|
||||
|
||||
# Extract all identifiers from the load statement
|
||||
identifier_pattern = r'["\']([^"\']+)["\']'
|
||||
identifiers = re.findall(identifier_pattern, identifiers_str)
|
||||
|
||||
# Map each identifier to the .bzl file
|
||||
for identifier in identifiers:
|
||||
identifier_to_bzl_file[identifier] = bzl_path
|
||||
|
||||
return identifier_to_bzl_file
|
||||
|
||||
|
||||
def _extract_attribute(
|
||||
block: str,
|
||||
attribute_name: str,
|
||||
identifier_to_bzl_file: dict[str, str] = None,
|
||||
build_file: str = None,
|
||||
) -> list[str]:
|
||||
"""Extract an attribute from a BUILD.bazel rule block.
|
||||
|
||||
Supports simple lists and list concatenation with identifiers:
|
||||
- Simple list: srcs = ["file1.js", "file2.js"]
|
||||
- List concatenation: srcs = ["file1.js"] + some_identifier
|
||||
|
||||
Args:
|
||||
block: The text content of a BUILD.bazel rule block
|
||||
attribute_name: The name of the attribute to extract (e.g., "srcs")
|
||||
identifier_to_bzl_file: Dictionary mapping identifier names to .bzl file paths
|
||||
build_file: Path to the BUILD.bazel file for resolving local identifiers
|
||||
Returns:
|
||||
List of string values from the attribute. Returns empty list if attribute not found.
|
||||
"""
|
||||
if identifier_to_bzl_file is None:
|
||||
identifier_to_bzl_file = {}
|
||||
|
||||
# Pattern to match: attribute_name = <expression>
|
||||
# Captures everything until comma + newline + next attribute/paren, or end of string
|
||||
pattern = rf"{attribute_name}\s*=\s*(.+?)(?=,\s*\n\s*(?:\w+\s*=|\))|\Z)"
|
||||
match = re.search(pattern, block, re.DOTALL | re.MULTILINE)
|
||||
if not match:
|
||||
return []
|
||||
|
||||
expression = match.group(1).strip()
|
||||
|
||||
# Split expression by '+' operator to handle concatenation
|
||||
items = []
|
||||
parts = re.split(r"\+", expression)
|
||||
|
||||
for part in parts:
|
||||
part = part.strip()
|
||||
|
||||
# Check if this part is a list literal
|
||||
if part.startswith("[") and part.endswith("]"):
|
||||
# Extract the content between brackets
|
||||
list_content = part[1:-1]
|
||||
|
||||
# Extract quoted strings, handling both single and double quotes
|
||||
for line in list_content.split("\n"):
|
||||
# Remove inline comments
|
||||
line = re.sub(r"#.*$", "", line)
|
||||
|
||||
# Find all quoted strings in the line
|
||||
string_pattern = r'["\']([^"\']+)["\']'
|
||||
items.extend(re.findall(string_pattern, line))
|
||||
|
||||
# Check if this part is an identifier (not a list literal)
|
||||
elif re.match(r"^[a-zA-Z_][a-zA-Z0-9_]*$", part):
|
||||
# Resolve the identifier to a list of labels
|
||||
resolved_items = _resolve_identifier_to_labels(part, identifier_to_bzl_file, build_file)
|
||||
items.extend(resolved_items)
|
||||
|
||||
return items
|
||||
|
||||
|
||||
def _resolve_identifier_to_labels(
|
||||
identifier: str, identifier_to_bzl_file: dict[str, str], build_file: str = None
|
||||
) -> list[str]:
|
||||
"""Convert a Bazel identifier to a list of labels.
|
||||
|
||||
This function resolves identifiers used in list concatenation expressions.
|
||||
For example, in: srcs = ["file.js"] + sharding_jscore_passthrough_srcs
|
||||
The identifier 'sharding_jscore_passthrough_srcs' would be resolved to its
|
||||
corresponding list of labels by reading its definition from the .bzl file.
|
||||
|
||||
If the identifier is not found in load statements, this function will attempt
|
||||
to find it defined in the BUILD.bazel file itself.
|
||||
|
||||
Args:
|
||||
identifier: The identifier name to resolve (e.g., "sharding_jscore_passthrough_srcs")
|
||||
identifier_to_bzl_file: Dictionary mapping identifier names to .bzl file paths
|
||||
build_file: Path to the BUILD.bazel file for resolving local identifiers
|
||||
|
||||
Returns:
|
||||
List of resolved label strings
|
||||
"""
|
||||
identifier_pattern = rf"^{re.escape(identifier)}\s*=\s*\[(.+?)\]"
|
||||
|
||||
if identifier in identifier_to_bzl_file:
|
||||
bzl_file_path = identifier_to_bzl_file[identifier]
|
||||
with open(bzl_file_path, "r") as f:
|
||||
bzl_content = f.read()
|
||||
|
||||
# Find the identifier definition in the .bzl file
|
||||
match = re.search(identifier_pattern, bzl_content, re.MULTILINE | re.DOTALL)
|
||||
if not match:
|
||||
raise BazelParseError(
|
||||
f"Could not find definition of identifier '{identifier}' in '{bzl_file_path}'"
|
||||
)
|
||||
else:
|
||||
# Try to find the identifier in the BUILD.bazel file itself
|
||||
with open(build_file, "r") as f:
|
||||
build_content = f.read()
|
||||
|
||||
# Look for identifier definition in BUILD.bazel
|
||||
match = re.search(identifier_pattern, build_content, re.MULTILINE | re.DOTALL)
|
||||
if not match:
|
||||
raise BazelParseError(
|
||||
f"Identifier '{identifier}' referenced but not found in load statements "
|
||||
f"or in BUILD.bazel file."
|
||||
)
|
||||
|
||||
# Extract all quoted strings from the list
|
||||
items = []
|
||||
for line in match.group(1).split("\n"):
|
||||
# Remove inline comments
|
||||
line = re.sub(r"#.*$", "", line)
|
||||
|
||||
# Find all quoted strings in the line
|
||||
string_pattern = r'["\']([^"\']+)["\']'
|
||||
items.extend(re.findall(string_pattern, line))
|
||||
|
||||
return items
|
||||
|
||||
|
||||
def _extract_int_attribute(block: str, attribute_name: str) -> int | None:
|
||||
"""Extract an integer attribute from a BUILD.bazel rule block.
|
||||
Args:
|
||||
block: The text content of a BUILD.bazel rule block
|
||||
attribute_name: The name of the attribute to extract (e.g., "group_size")
|
||||
Returns:
|
||||
Integer value of the attribute. Returns None if attribute not found.
|
||||
"""
|
||||
# Pattern to match: attribute_name = <integer>
|
||||
pattern = rf"{attribute_name}\s*=\s*(\d+)"
|
||||
match = re.search(pattern, block)
|
||||
if not match:
|
||||
return None
|
||||
return int(match.group(1))
|
||||
|
||||
|
||||
def _extract_scalar_attribute(block: str, attribute_name: str) -> str:
|
||||
"""Extract a string attribute from a BUILD.bazel rule block.
|
||||
Args:
|
||||
block: The text content of a BUILD.bazel rule block
|
||||
attribute_name: The name of the attribute to extract (e.g., "group_count_multiplier")
|
||||
Returns:
|
||||
String value of the attribute. Returns empty string if attribute not found.
|
||||
"""
|
||||
# Pattern to match: attribute_name = "<value>"
|
||||
quoted_pattern = rf'{attribute_name}\s*=\s*["\']([^"\']+)["\']'
|
||||
match = re.search(quoted_pattern, block)
|
||||
if match:
|
||||
return match.group(1)
|
||||
|
||||
return ""
|
||||
|
||||
|
||||
def resolve_target_to_files(target_label: str) -> str:
|
||||
"""Resolve a Bazel target label to glob patterns or file paths.
|
||||
Supported target types:
|
||||
- Direct file: "//jstests/foo:bar.js" → "jstests/foo/bar.js"
|
||||
- all_javascript_files: returns glob pattern "package/*.js"
|
||||
- all_subpackage_javascript_files: returns glob pattern "package/**/*.js"
|
||||
Args:
|
||||
target_label: Bazel target label to resolve
|
||||
Returns:
|
||||
File path or glob pattern (relative to repo root)
|
||||
Raises:
|
||||
BazelParseError: If target type is unsupported
|
||||
"""
|
||||
absolute_package, target_name = _parse_label(target_label)
|
||||
|
||||
# Convert absolute package path to relative (for suite configuration)
|
||||
relative_package = os.path.relpath(absolute_package, config.RESMOKE_ROOT)
|
||||
|
||||
if target_name.endswith(".js"):
|
||||
# Direct file reference
|
||||
return os.path.join(relative_package, target_name)
|
||||
|
||||
elif target_name == "all_javascript_files":
|
||||
# Return glob pattern for *.js in package directory
|
||||
return os.path.join(relative_package, "*.js")
|
||||
|
||||
elif target_name == "all_subpackage_javascript_files":
|
||||
# Return glob pattern for recursive **/*.js
|
||||
return os.path.join(relative_package, "**/*.js")
|
||||
|
||||
else:
|
||||
raise BazelParseError(
|
||||
f"Unsupported target type '{target_label}'. "
|
||||
f"Supported types: direct .js files, all_javascript_files, all_subpackage_javascript_files"
|
||||
)
|
||||
@ -13,8 +13,8 @@ from typing import Any, Optional
|
||||
import yaml
|
||||
|
||||
import buildscripts.resmokelib.utils.filesystem as fs
|
||||
from buildscripts.resmokelib import bazel_suite_parser, errors, suite_hierarchy, utils
|
||||
from buildscripts.resmokelib import config as _config
|
||||
from buildscripts.resmokelib import errors, suite_hierarchy, utils
|
||||
from buildscripts.resmokelib.logging import loggers
|
||||
from buildscripts.resmokelib.testing import suite as _suite
|
||||
from buildscripts.resmokelib.utils import load_yaml_file
|
||||
@ -260,63 +260,6 @@ class SuiteConfigInterface:
|
||||
pass
|
||||
|
||||
|
||||
def expand_from_target_selector(config):
|
||||
from_target = config.get("selector", {}).get("from_target", {})
|
||||
if from_target:
|
||||
if len(config["selector"].keys()) > 1:
|
||||
# from_target is mutually exclusive with all other selector fields
|
||||
raise ValueError(
|
||||
f"'from_target' cannot be used with other selector fields. "
|
||||
f"Selector is: {config['selector']}"
|
||||
)
|
||||
|
||||
# Parse the bazel target to extract selector configuration
|
||||
try:
|
||||
target_config = bazel_suite_parser.parse_resmoke_suite_test(from_target)
|
||||
except bazel_suite_parser.BazelParseError as err:
|
||||
raise ValueError(f"Failed to parse bazel target '{from_target}': {err}")
|
||||
|
||||
# Resolve srcs to file paths
|
||||
resolved_roots = []
|
||||
for src_target in target_config["srcs"]:
|
||||
try:
|
||||
resolved_roots.append(bazel_suite_parser.resolve_target_to_files(src_target))
|
||||
except bazel_suite_parser.BazelParseError as err:
|
||||
raise ValueError(
|
||||
f"Failed to resolve target '{src_target}' from '{from_target}': {err}"
|
||||
)
|
||||
|
||||
# Resolve exclude_files to file paths
|
||||
resolved_exclude_files = []
|
||||
for exclude_target in target_config["exclude_files"]:
|
||||
try:
|
||||
resolved_exclude_files.append(
|
||||
bazel_suite_parser.resolve_target_to_files(exclude_target)
|
||||
)
|
||||
except bazel_suite_parser.BazelParseError as err:
|
||||
raise ValueError(
|
||||
f"Failed to resolve exclude target '{exclude_target}' from '{from_target}': {err}"
|
||||
)
|
||||
|
||||
selector = {}
|
||||
if resolved_roots:
|
||||
selector["roots"] = resolved_roots
|
||||
if resolved_exclude_files:
|
||||
selector["exclude_files"] = resolved_exclude_files
|
||||
if target_config["include_with_any_tags"]:
|
||||
selector["include_with_any_tags"] = target_config["include_with_any_tags"]
|
||||
if target_config["exclude_with_any_tags"]:
|
||||
selector["exclude_with_any_tags"] = target_config["exclude_with_any_tags"]
|
||||
if target_config["group_size"] is not None:
|
||||
selector["group_size"] = target_config["group_size"]
|
||||
if target_config["group_count_multiplier"]:
|
||||
selector["group_count_multiplier"] = float(target_config["group_count_multiplier"])
|
||||
|
||||
config["selector"] = selector
|
||||
|
||||
return config
|
||||
|
||||
|
||||
class ExplicitSuiteConfig(SuiteConfigInterface):
|
||||
"""Class for storing the resmoke.py suite YAML configuration."""
|
||||
|
||||
@ -341,7 +284,6 @@ class ExplicitSuiteConfig(SuiteConfigInterface):
|
||||
return None
|
||||
|
||||
config = utils.load_yaml_file(suite_path)
|
||||
config = expand_from_target_selector(config)
|
||||
return config
|
||||
|
||||
@classmethod
|
||||
@ -522,7 +464,6 @@ class MatrixSuiteConfig(SuiteConfigInterface):
|
||||
+ "To (re)generate the matrix suite files use `python3 buildscripts/resmoke.py generate-matrix-suites"
|
||||
)
|
||||
|
||||
config = expand_from_target_selector(config)
|
||||
return config
|
||||
|
||||
@classmethod
|
||||
@ -537,7 +478,6 @@ class MatrixSuiteConfig(SuiteConfigInterface):
|
||||
all_overrides = cls.parse_override_file(suites_dirs)
|
||||
|
||||
config = cls.process_overrides(matrix_suite, all_overrides, suite_name)
|
||||
config = expand_from_target_selector(config)
|
||||
return config
|
||||
|
||||
@classmethod
|
||||
|
||||
@ -1,18 +1,8 @@
|
||||
# TODO(SERVER-105817): The following library is autogenerated, please split these out into individual python targets
|
||||
load("@rules_python//python:defs.bzl", "py_library", "py_test")
|
||||
load("@rules_python//python:defs.bzl", "py_library")
|
||||
|
||||
py_library(
|
||||
name = "all_python_files",
|
||||
srcs = glob(["*.py"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
py_test(
|
||||
name = "test_bazel_suite_parser",
|
||||
srcs = [
|
||||
"test_bazel_suite_parser.py",
|
||||
],
|
||||
deps = [
|
||||
"//buildscripts/resmokelib",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1,296 +0,0 @@
|
||||
"""Unit tests for buildscripts/resmokelib/bazel_suite_parser.py."""
|
||||
|
||||
import os
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from buildscripts.resmokelib.bazel_suite_parser import (
|
||||
_extract_attribute,
|
||||
_parse_load_statements,
|
||||
_resolve_identifier_to_labels,
|
||||
)
|
||||
|
||||
|
||||
class TestExtractAttribute(unittest.TestCase):
|
||||
"""Unit tests for the _extract_attribute() function."""
|
||||
|
||||
def test_simple_multiline_list(self):
|
||||
"""Test extraction of a simple multi-line list."""
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = [
|
||||
"//jstests/core:all_subpackage_javascript_files",
|
||||
"//jstests/fle2:all_subpackage_javascript_files",
|
||||
"//src/mongo/db/modules/enterprise/jstests/fle2:all_subpackage_javascript_files",
|
||||
],
|
||||
shard_count = 2,
|
||||
)"""
|
||||
result = _extract_attribute(block, "srcs")
|
||||
self.assertEqual(
|
||||
result,
|
||||
[
|
||||
"//jstests/core:all_subpackage_javascript_files",
|
||||
"//jstests/fle2:all_subpackage_javascript_files",
|
||||
"//src/mongo/db/modules/enterprise/jstests/fle2:all_subpackage_javascript_files",
|
||||
],
|
||||
)
|
||||
|
||||
def test_multiline_list_with_comments(self):
|
||||
"""Test extraction of multi-line list with inline comments."""
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = [
|
||||
"//jstests/sharding/libs:all_subpackage_javascript_files",
|
||||
|
||||
# comment
|
||||
"//jstests/sharding/analyze_shard_key/libs:all_subpackage_javascript_files",
|
||||
"//jstests/sharding/internal_txns/libs:all_subpackage_javascript_files",
|
||||
"//jstests/sharding/updateOne_without_shard_key/libs:all_subpackage_javascript_files",
|
||||
],
|
||||
shard_count = 2,
|
||||
)"""
|
||||
result = _extract_attribute(block, "srcs")
|
||||
self.assertEqual(
|
||||
result,
|
||||
[
|
||||
"//jstests/sharding/libs:all_subpackage_javascript_files",
|
||||
"//jstests/sharding/analyze_shard_key/libs:all_subpackage_javascript_files",
|
||||
"//jstests/sharding/internal_txns/libs:all_subpackage_javascript_files",
|
||||
"//jstests/sharding/updateOne_without_shard_key/libs:all_subpackage_javascript_files",
|
||||
],
|
||||
)
|
||||
|
||||
def test_single_line_list(self):
|
||||
"""Test extraction of a single-line list."""
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = ["//jstests/core:test.js", "//jstests/core:test2.js"],
|
||||
shard_count = 2,
|
||||
)"""
|
||||
result = _extract_attribute(block, "srcs")
|
||||
self.assertEqual(result, ["//jstests/core:test.js", "//jstests/core:test2.js"])
|
||||
|
||||
def test_attribute_not_found(self):
|
||||
"""Test behavior when attribute is not present."""
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
shard_count = 2,
|
||||
)"""
|
||||
result = _extract_attribute(block, "srcs")
|
||||
self.assertEqual(result, [])
|
||||
|
||||
def test_mixed_quotes(self):
|
||||
"""Test extraction with mixed single and double quotes."""
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = [
|
||||
"//jstests/core:test.js",
|
||||
'//jstests/core:test2.js',
|
||||
],
|
||||
shard_count = 2,
|
||||
)"""
|
||||
result = _extract_attribute(block, "srcs")
|
||||
self.assertEqual(result, ["//jstests/core:test.js", "//jstests/core:test2.js"])
|
||||
|
||||
def test_empty_list(self):
|
||||
"""Test extraction of an empty list."""
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = [],
|
||||
shard_count = 2,
|
||||
)"""
|
||||
result = _extract_attribute(block, "srcs")
|
||||
self.assertEqual(result, [])
|
||||
|
||||
def test_multiple_attributes(self):
|
||||
"""Test extraction when multiple attributes are present."""
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = [
|
||||
"//jstests/core:test.js",
|
||||
],
|
||||
deps = [
|
||||
"//some:dependency",
|
||||
],
|
||||
shard_count = 2,
|
||||
)"""
|
||||
srcs_result = _extract_attribute(block, "srcs")
|
||||
deps_result = _extract_attribute(block, "deps")
|
||||
self.assertEqual(srcs_result, ["//jstests/core:test.js"])
|
||||
self.assertEqual(deps_result, ["//some:dependency"])
|
||||
|
||||
|
||||
class TestIdentifierResolution(unittest.TestCase):
|
||||
"""Unit tests for identifier resolution functionality."""
|
||||
|
||||
def setUp(self):
|
||||
"""Create temporary directory for test .bzl files."""
|
||||
self.test_dir = tempfile.mkdtemp()
|
||||
|
||||
def tearDown(self):
|
||||
"""Clean up temporary directory."""
|
||||
import shutil
|
||||
|
||||
shutil.rmtree(self.test_dir)
|
||||
|
||||
def test_parse_load_statements_single_line(self):
|
||||
"""Test parsing a single-line load statement."""
|
||||
content = 'load("//jstests/suites:selectors.bzl", "sharding_srcs", "core_srcs")'
|
||||
result = _parse_load_statements(content, "buildscripts/resmokeconfig")
|
||||
|
||||
expected_path = os.path.join(os.getcwd(), "jstests", "suites", "selectors.bzl")
|
||||
self.assertEqual(result["sharding_srcs"], expected_path)
|
||||
self.assertEqual(result["core_srcs"], expected_path)
|
||||
|
||||
def test_parse_load_statements_multiple_loads(self):
|
||||
"""Test parsing multiple load statements."""
|
||||
content = """
|
||||
load("//jstests/suites:selectors.bzl", "sharding_srcs")
|
||||
load("//jstests/core:tests.bzl", "core_tests")
|
||||
"""
|
||||
result = _parse_load_statements(content, "buildscripts/resmokeconfig")
|
||||
|
||||
self.assertEqual(
|
||||
result["sharding_srcs"], os.path.join(os.getcwd(), "jstests", "suites", "selectors.bzl")
|
||||
)
|
||||
self.assertEqual(
|
||||
result["core_tests"], os.path.join(os.getcwd(), "jstests", "core", "tests.bzl")
|
||||
)
|
||||
|
||||
def test_parse_load_statements_relative_path(self):
|
||||
"""Test parsing load statement with relative path."""
|
||||
content = 'load(":local_defs.bzl", "local_srcs")'
|
||||
result = _parse_load_statements(content, "buildscripts/resmokeconfig")
|
||||
|
||||
# Package-relative path: :local_defs.bzl resolves relative to package directory
|
||||
expected_path = os.path.join("buildscripts", "resmokeconfig", "local_defs.bzl")
|
||||
self.assertEqual(result["local_srcs"], expected_path)
|
||||
|
||||
def test_resolve_identifier_simple(self):
|
||||
"""Test resolving a simple identifier to list of labels."""
|
||||
# Create a .bzl file with an identifier definition
|
||||
bzl_file = os.path.join(self.test_dir, "test_srcs.bzl")
|
||||
with open(bzl_file, "w") as f:
|
||||
f.write(
|
||||
"""
|
||||
test_files = [
|
||||
"//jstests/core:test1.js",
|
||||
"//jstests/core:test2.js",
|
||||
"//jstests/core:test3.js",
|
||||
]
|
||||
"""
|
||||
)
|
||||
|
||||
identifier_to_bzl_file = {"test_files": bzl_file}
|
||||
result = _resolve_identifier_to_labels("test_files", identifier_to_bzl_file)
|
||||
|
||||
self.assertEqual(
|
||||
result,
|
||||
[
|
||||
"//jstests/core:test1.js",
|
||||
"//jstests/core:test2.js",
|
||||
"//jstests/core:test3.js",
|
||||
],
|
||||
)
|
||||
|
||||
def test_resolve_identifier_with_comments(self):
|
||||
"""Test resolving identifier with comments in the list."""
|
||||
bzl_file = os.path.join(self.test_dir, "test_srcs.bzl")
|
||||
with open(bzl_file, "w") as f:
|
||||
f.write(
|
||||
"""
|
||||
test_files = [
|
||||
"//jstests/core:test1.js",
|
||||
# This is a comment
|
||||
"//jstests/core:test2.js",
|
||||
"//jstests/core:test3.js", # inline comment
|
||||
]
|
||||
"""
|
||||
)
|
||||
|
||||
identifier_to_bzl_file = {"test_files": bzl_file}
|
||||
result = _resolve_identifier_to_labels("test_files", identifier_to_bzl_file)
|
||||
|
||||
self.assertEqual(
|
||||
result,
|
||||
[
|
||||
"//jstests/core:test1.js",
|
||||
"//jstests/core:test2.js",
|
||||
"//jstests/core:test3.js",
|
||||
],
|
||||
)
|
||||
|
||||
def test_extract_attribute_with_list_concatenation_and_identifiers(self):
|
||||
"""Test extracting attribute with list concatenation including identifiers."""
|
||||
# Create a .bzl file with identifier definitions
|
||||
bzl_file = os.path.join(self.test_dir, "test_srcs.bzl")
|
||||
with open(bzl_file, "w") as f:
|
||||
f.write(
|
||||
"""
|
||||
base_tests = [
|
||||
"//jstests/base:test1.js",
|
||||
"//jstests/base:test2.js",
|
||||
]
|
||||
|
||||
extra_tests = [
|
||||
"//jstests/extra:test3.js",
|
||||
]
|
||||
"""
|
||||
)
|
||||
|
||||
block = """resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = ["//jstests/core:custom.js"] + base_tests + extra_tests,
|
||||
shard_count = 2,
|
||||
)"""
|
||||
identifier_to_bzl_file = {
|
||||
"base_tests": bzl_file,
|
||||
"extra_tests": bzl_file,
|
||||
}
|
||||
result = _extract_attribute(block, "srcs", identifier_to_bzl_file)
|
||||
|
||||
self.assertEqual(
|
||||
result,
|
||||
[
|
||||
"//jstests/core:custom.js",
|
||||
"//jstests/base:test1.js",
|
||||
"//jstests/base:test2.js",
|
||||
"//jstests/extra:test3.js",
|
||||
],
|
||||
)
|
||||
|
||||
def test_resolve_identifier_in_same_build_file(self):
|
||||
"""Test resolving identifier defined in the same BUILD.bazel file."""
|
||||
# Create a BUILD.bazel file with local identifier definition
|
||||
build_file = os.path.join(self.test_dir, "BUILD.bazel")
|
||||
with open(build_file, "w") as f:
|
||||
f.write(
|
||||
"""
|
||||
local_tests = [
|
||||
"//jstests/local:test1.js",
|
||||
"//jstests/local:test2.js",
|
||||
]
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "test_suite",
|
||||
srcs = local_tests,
|
||||
shard_count = 2,
|
||||
)
|
||||
"""
|
||||
)
|
||||
|
||||
# The identifier maps to the BUILD.bazel file itself
|
||||
identifier_to_bzl_file = {"local_tests": build_file}
|
||||
result = _resolve_identifier_to_labels("local_tests", identifier_to_bzl_file)
|
||||
|
||||
self.assertEqual(
|
||||
result,
|
||||
[
|
||||
"//jstests/local:test1.js",
|
||||
"//jstests/local:test2.js",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@ -2,9 +2,6 @@ load("//bazel/resmoke:resmoke.bzl", "resmoke_suite_test")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "backup_restore",
|
||||
srcs = [
|
||||
"//src/mongo/db/modules/enterprise/jstests/hot_backups:all_subpackage_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/backup_restore.yml",
|
||||
data = [
|
||||
"//buildscripts/resmokeconfig:suites/concurrency_replication_for_backup_restore.yml",
|
||||
@ -42,9 +39,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "queryable_wt",
|
||||
srcs = [
|
||||
"//src/mongo/db/modules/enterprise/jstests/queryable_wt:all_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/queryable_wt.yml",
|
||||
data = [
|
||||
"//src/mongo/db/modules/enterprise/jstests/hot_backups/libs:all_javascript_files",
|
||||
|
||||
@ -2,7 +2,6 @@ load("//bazel/resmoke:resmoke.bzl", "resmoke_suite_test")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "failpoints",
|
||||
srcs = ["//jstests/fail_point:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/failpoints.yml",
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -17,7 +16,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "failpoints_auth",
|
||||
srcs = ["//jstests/fail_point:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/failpoints_auth.yml",
|
||||
data = [
|
||||
"//jstests/libs:authTestsKey",
|
||||
@ -40,7 +38,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "libunwind",
|
||||
srcs = ["//jstests/libunwind:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/libunwind.yml",
|
||||
tags = ["ci-release-critical"],
|
||||
target_compatible_with = select({
|
||||
|
||||
@ -3,23 +3,8 @@ load(":common.bzl", "CONCURRENCY_DATA", "CORE_DATA")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "core",
|
||||
srcs = [
|
||||
"//jstests/core:all_subpackage_javascript_files",
|
||||
"//jstests/core_standalone:all_subpackage_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/core.yml",
|
||||
data = CORE_DATA,
|
||||
exclude_files = [
|
||||
# Queryable encryption is not supported on standalone.
|
||||
"//jstests/core/query/queryable_encryption:all_subpackage_javascript_files",
|
||||
|
||||
# Query settings are not supported on standalone.
|
||||
"//jstests/core/query/query_settings:all_subpackage_javascript_files",
|
||||
|
||||
# Transactions are not supported on MongoDB standalone nodes, so we do not run these tests in the
|
||||
# 'core' suite. Instead we run them against a 1-node replica set in the 'core_txns' suite.
|
||||
"//jstests/core/txns:all_subpackage_javascript_files",
|
||||
],
|
||||
shard_count = 24,
|
||||
tags = [
|
||||
"ci-development-critical",
|
||||
@ -36,14 +21,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "concurrency",
|
||||
srcs = ["//jstests/concurrency/fsm_workloads:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/concurrency.yml",
|
||||
data = CONCURRENCY_DATA,
|
||||
exclude_with_any_tags = [
|
||||
"uses_transactions",
|
||||
"requires_replication",
|
||||
"requires_sharding",
|
||||
],
|
||||
shard_count = 5,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
|
||||
@ -2,10 +2,6 @@ load("//bazel/resmoke:resmoke.bzl", "resmoke_suite_test")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "search_community",
|
||||
srcs = [
|
||||
"//jstests/with_mongot/mongotmock:all_javascript_files",
|
||||
"//jstests/with_mongot/search_mocked:all_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/search_community.yml",
|
||||
data = [
|
||||
"//jstests/libs:key1",
|
||||
@ -15,11 +11,6 @@ resmoke_suite_test(
|
||||
"//jstests/with_mongot/search_mocked/lib:all_javascript_files",
|
||||
"//x509:generate_main_certificates",
|
||||
],
|
||||
exclude_files = [],
|
||||
exclude_with_any_tags = [
|
||||
"requires_auth",
|
||||
"search_community_incompatible",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -42,7 +33,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "search_community_ssl",
|
||||
srcs = ["//jstests/with_mongot/search_mocked/ssl:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/search_community_ssl.yml",
|
||||
data = [
|
||||
"//jstests/multiVersion/libs:all_javascript_files",
|
||||
@ -51,10 +41,6 @@ resmoke_suite_test(
|
||||
"//jstests/with_mongot/search_mocked/ssl/lib:all_javascript_files",
|
||||
"//x509:generate_main_certificates",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"requires_auth",
|
||||
"search_community_incompatible",
|
||||
],
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
"search_community_mongotmock",
|
||||
|
||||
@ -3,44 +3,8 @@ load("//jstests/suites/query-execution:common.bzl", "CORE_DATA")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "timeseries_crud_jscore_passthrough",
|
||||
srcs = [
|
||||
"//jstests/core/query:all_subpackage_javascript_files",
|
||||
"//jstests/core/write:all_subpackage_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/timeseries_crud_jscore_passthrough.yml",
|
||||
data = CORE_DATA,
|
||||
exclude_files = [
|
||||
"//jstests/core/query/where:all_subpackage_javascript_files",
|
||||
"//jstests/core/query/js:all_subpackage_javascript_files",
|
||||
|
||||
# The paths below are excluded from running in this suite because prior to moving under the
|
||||
# 'query' directory, they were not running in this suite.
|
||||
# TODO SERVER-94567 Determine if any of these tests can be enabled.
|
||||
"//jstests/core/query/json_schema:all_subpackage_javascript_files",
|
||||
"//jstests/core/query/doc_validation:all_subpackage_javascript_files",
|
||||
"//jstests/core/query/api:all_subpackage_javascript_files",
|
||||
"//jstests/core/query/queryable_encryption:all_subpackage_javascript_files",
|
||||
"//jstests/core/query/sbe:all_subpackage_javascript_files",
|
||||
|
||||
# Hashed indexes.
|
||||
"//jstests/core/query/internal_hash_eq:all_subpackage_javascript_files",
|
||||
|
||||
# Explain will return different plan than expected when a collection becomes a time-series
|
||||
# collection. Also, query shape will be different.
|
||||
"//jstests/core/query/explain:all_subpackage_javascript_files",
|
||||
|
||||
# elemMatch
|
||||
"//jstests/core/query/elemmatch:all_subpackage_javascript_files",
|
||||
|
||||
# Time-series collections are views which don't support map-reduce
|
||||
"//jstests/core/query/map_reduce:all_subpackage_javascript_files",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"requires_sharding",
|
||||
"requires_capped",
|
||||
"assumes_standalone_mongod",
|
||||
"exclude_from_timeseries_crud_passthrough",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
|
||||
@ -2,16 +2,10 @@ load("//bazel/resmoke:resmoke.bzl", "resmoke_suite_test")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "aggregation_disabled_optimization",
|
||||
srcs = ["//jstests/aggregation:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/aggregation_disabled_optimization.yml",
|
||||
data = [
|
||||
"//jstests/with_mongot/e2e_lib",
|
||||
],
|
||||
exclude_files = [
|
||||
"//jstests/aggregation/data:all_javascript_files",
|
||||
"//jstests/aggregation/extras:all_javascript_files",
|
||||
],
|
||||
exclude_with_any_tags = ["requires_pipeline_optimization"],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"aggregation",
|
||||
|
||||
@ -2,15 +2,10 @@ load("//bazel/resmoke:resmoke.bzl", "resmoke_suite_test")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "aggregation",
|
||||
srcs = ["//jstests/aggregation:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/aggregation.yml",
|
||||
data = [
|
||||
"//jstests/with_mongot/e2e_lib",
|
||||
],
|
||||
exclude_files = [
|
||||
"//jstests/aggregation/data:all_javascript_files",
|
||||
"//jstests/aggregation/extras:all_javascript_files",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"aggregation",
|
||||
@ -25,16 +20,11 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "aggregation_auth",
|
||||
srcs = ["//jstests/aggregation:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/aggregation_auth.yml",
|
||||
data = [
|
||||
"//jstests/libs:authTestsKey",
|
||||
"//jstests/with_mongot/e2e_lib",
|
||||
],
|
||||
exclude_files = [
|
||||
"//jstests/aggregation/extras:all_javascript_files",
|
||||
"//jstests/aggregation/data:all_javascript_files",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"aggregation",
|
||||
@ -55,33 +45,10 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "aggregation_read_concern_majority_passthrough",
|
||||
srcs = ["//jstests/aggregation:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/aggregation_read_concern_majority_passthrough.yml",
|
||||
data = [
|
||||
"//jstests/with_mongot/e2e_lib",
|
||||
],
|
||||
exclude_files = [
|
||||
"//jstests/aggregation/data:all_javascript_files",
|
||||
"//jstests/aggregation/extras:all_javascript_files",
|
||||
|
||||
# This test fails due to the inability to specify a writeConcern when secondaryThrottle is not
|
||||
# set as part of the moveChunk command.
|
||||
"//jstests/aggregation/sources/facet:use_cases.js",
|
||||
|
||||
# This test specifies a $out stage not as the last stage in the aggregation pipeline, causing a
|
||||
# non-local readConcern to erroneously be sent with the command.
|
||||
"//jstests/aggregation/sources/out:required_last_position.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
# The next two tags correspond to the special errors thrown by the
|
||||
# set_read_and_write_concerns.js override when it refuses to replace the readConcern or
|
||||
# writeConcern of a particular command. Above each tag are the message(s) that cause the tag to be
|
||||
# warranted.
|
||||
# "Cowardly refusing to override read concern of command: ..."
|
||||
"assumes_read_concern_unchanged",
|
||||
# "Cowardly refusing to override write concern of command: ..."
|
||||
"assumes_write_concern_unchanged",
|
||||
],
|
||||
shard_count = 8,
|
||||
tags = [
|
||||
"aggregation",
|
||||
@ -101,43 +68,10 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "aggregation_sharded_collections_passthrough",
|
||||
srcs = ["//jstests/aggregation:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/aggregation_sharded_collections_passthrough.yml",
|
||||
data = [
|
||||
"//jstests/with_mongot/e2e_lib",
|
||||
],
|
||||
exclude_files = [
|
||||
"//jstests/aggregation/data:all_javascript_files",
|
||||
"//jstests/aggregation/extras:all_javascript_files",
|
||||
|
||||
# This test makes assertions about whether aggregations will need to spill to disk, which assumes
|
||||
# all the data is located on a single shard.
|
||||
"//jstests/aggregation/exec:spill_to_disk.js",
|
||||
|
||||
# TODO SERVER-32311: These tests use getAggPlanStage(), which can't handle sharded explain output.
|
||||
"//jstests/aggregation/optimization:match_swapping_renamed_fields.js",
|
||||
"//jstests/aggregation/optimization:use_query_sort.js",
|
||||
"//jstests/aggregation/optimization:use_query_project_and_sort.js",
|
||||
"//jstests/aggregation/optimization:use_query_projection.js",
|
||||
|
||||
# TODO: Remove when SERVER-23229 is fixed.
|
||||
"//jstests/aggregation/sources/graphLookup:variables.js",
|
||||
"//jstests/aggregation/sources/group:groupMissing.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
"assumes_no_implicit_collection_creation_on_get_collection",
|
||||
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
"assumes_against_mongod_not_mongos",
|
||||
"assumes_no_implicit_collection_creation_after_drop",
|
||||
"assumes_no_implicit_index_creation",
|
||||
"assumes_unsharded_collection",
|
||||
"cannot_create_unique_index_when_using_hashed_shard_key",
|
||||
"requires_sharding",
|
||||
"requires_profiling",
|
||||
],
|
||||
shard_count = 8,
|
||||
tags = [
|
||||
"aggregation",
|
||||
|
||||
@ -3,7 +3,6 @@ load("//jstests/suites/query-execution:common.bzl", "CORE_DATA")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "auth",
|
||||
srcs = ["//jstests/auth:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/auth.yml",
|
||||
data = [
|
||||
"//jstests/auth/lib:all_subpackage_javascript_files",
|
||||
@ -20,9 +19,6 @@ resmoke_suite_test(
|
||||
"//jstests/ssl/libs",
|
||||
"//jstests/with_mongot/mongotmock/lib",
|
||||
],
|
||||
exclude_files = [
|
||||
"//jstests/auth:repl.js", # Skip until SERVER-25618 is resolved.
|
||||
],
|
||||
shard_count = 20,
|
||||
tags = [
|
||||
"auth",
|
||||
@ -39,7 +35,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "client_encrypt",
|
||||
srcs = ["//jstests/client_encrypt:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/client_encrypt.yml",
|
||||
data = [
|
||||
"//jstests/ssl/libs",
|
||||
@ -59,10 +54,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "ssl",
|
||||
srcs = [
|
||||
"//jstests/ssl:all_javascript_files",
|
||||
"//src/mongo/db/modules/enterprise/jstests/fips:all_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/ssl.yml",
|
||||
data = [
|
||||
"//jstests/libs:8k-prime.dhparam",
|
||||
@ -91,7 +82,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "ssl_special",
|
||||
srcs = ["//jstests/sslSpecial:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/ssl_special.yml",
|
||||
data = [
|
||||
"//jstests/libs:key1",
|
||||
@ -114,32 +104,10 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "core_auth",
|
||||
srcs = ["//jstests/core:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/core_auth.yml",
|
||||
data = CORE_DATA + [
|
||||
"//jstests/libs:authTestsKey",
|
||||
],
|
||||
exclude_files = [
|
||||
# Transactions are not supported on MongoDB standalone nodes.
|
||||
"//jstests/core/txns:all_subpackage_javascript_files",
|
||||
# Queryable encryption is not supported on standalone.
|
||||
"//jstests/core/query/queryable_encryption:all_subpackage_javascript_files",
|
||||
|
||||
# Commands using UUIDs are not compatible with name-based auth
|
||||
"//jstests/core/query:commands_with_uuid.js",
|
||||
|
||||
# Query settings are not supported on standalone.
|
||||
"//jstests/core/query/query_settings:all_subpackage_javascript_files",
|
||||
|
||||
# Skip any tests that run with auth explicitly.
|
||||
"//jstests/core/query/bulk:bulk_write_non_auth.js",
|
||||
"//jstests/core/administrative:auth1.js",
|
||||
"//jstests/core/administrative:auth2.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
# Multiple users cannot be authenticated on one connection within a session.
|
||||
"creates_and_authenticates_user",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"auth",
|
||||
@ -160,7 +128,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "ocsp",
|
||||
srcs = ["//jstests/ocsp:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/ocsp.yml",
|
||||
data = [
|
||||
"//jstests/ocsp/lib:all_javascript_files",
|
||||
@ -184,7 +151,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "ssl_linear",
|
||||
srcs = ["//jstests/ssl_linear:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/ssl_linear.yml",
|
||||
data = [
|
||||
"//jstests/libs:key1",
|
||||
@ -206,7 +172,6 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "ssl_x509",
|
||||
srcs = ["//jstests/ssl_x509:all_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/ssl_x509.yml",
|
||||
data = [
|
||||
"//jstests/libs:key1",
|
||||
|
||||
@ -3,24 +3,8 @@ load("//jstests/suites/query-execution:common.bzl", "CONCURRENCY_DATA")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "causally_consistent_jscore_txns_passthrough",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/causally_consistent_jscore_txns_passthrough.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# These tests rely on reads that cannot use an afterClusterTime read concern because the read
|
||||
# happens after a transaction is prepared, but before it is committed.
|
||||
"//jstests/core/txns:prepare_conflict_aggregation_behavior.js",
|
||||
|
||||
# These tests rely on having read concerns that don't use afterClusterTime.
|
||||
"//jstests/core/txns:timestamped_reads_wait_for_prepare_oplog_visibility.js",
|
||||
|
||||
# The following tests are excluded because they do not use the transactions shell helpers.
|
||||
"//jstests/core/txns:non_transactional_operations_on_session_with_transaction.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"does_not_support_causal_consistency",
|
||||
"requires_capped", # Transactions are not allowed to operate on capped collections.
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"causally_consistent",
|
||||
@ -40,55 +24,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "concurrency_replication_multi_stmt_txn",
|
||||
srcs = ["//jstests/concurrency/fsm_workloads:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/concurrency_replication_multi_stmt_txn.yml",
|
||||
data = [
|
||||
] + CONCURRENCY_DATA,
|
||||
exclude_files = [
|
||||
# Relies on having one thread observe writes from the other threads, which won't become visible
|
||||
# once a transaction in the thread is started because it'll keep reading from the same snapshot.
|
||||
"//jstests/concurrency/fsm_workloads/ddl/create_index_background:create_index_background.js",
|
||||
"//jstests/concurrency/fsm_workloads/ddl/create_index_background:create_index_background_partial_filter.js",
|
||||
"//jstests/concurrency/fsm_workloads/ddl/create_index_background:create_index_background_wildcard.js",
|
||||
"//jstests/concurrency/fsm_workloads/ddl/create_index_background:create_index_background_multi_doc_txn.js",
|
||||
|
||||
# Expects reads to die with a particular error, but other errors are possible if the read is part
|
||||
# of a transaction (e.g. ErrorCodes.LockTimeout).
|
||||
"//jstests/concurrency/fsm_workloads/query:drop_index_during_replan.js",
|
||||
"//jstests/concurrency/fsm_workloads/query:drop_index_during_lookup.js",
|
||||
|
||||
# Extracts error code from write error, which is obscured by runInsideTransaction.
|
||||
"//jstests/concurrency/fsm_workloads:access_collection_in_transaction_after_catalog_changes.js",
|
||||
|
||||
# Induces non-blindly-retriable errors (see SERVER-45767).
|
||||
"//jstests/concurrency/fsm_workloads/ddl:create_database.js",
|
||||
|
||||
# Performs direct writes to system.views
|
||||
"//jstests/concurrency/fsm_workloads/view_catalog:view_catalog_direct_system_writes.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"requires_standalone",
|
||||
"requires_sharding",
|
||||
"does_not_support_transactions",
|
||||
|
||||
# Snapshot reads in transactions are banned on capped collections.
|
||||
"requires_capped",
|
||||
|
||||
# Sharing cursors between state functions will fail in this suite because it will attempt to use
|
||||
# the same cursor in multiple transactions.
|
||||
"state_functions_share_cursor",
|
||||
|
||||
# These start a transaction in one state function and use it in other state functions. This suite
|
||||
# would instead execute each state function as its own transaction.
|
||||
"state_functions_share_transaction",
|
||||
|
||||
# Tests which expect commands to fail and catch the error can cause transactions to abort and
|
||||
# retry indefinitely.
|
||||
"catches_command_failures",
|
||||
|
||||
# time-series collections do not support write transactions
|
||||
"requires_timeseries",
|
||||
],
|
||||
data = CONCURRENCY_DATA,
|
||||
shard_count = 20,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -111,50 +48,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharded_collections_txns_uninitialized_fcv_jscore_passthrough",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharded_collections_txns_uninitialized_fcv_jscore_passthrough.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
"//jstests/core/txns:transactions_profiling.js",
|
||||
"//jstests/core/txns:transactions_profiling_with_drops.js",
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
"//jstests/core/txns:abort_expired_transaction.js",
|
||||
"//jstests/core/txns:abort_transaction_thread_does_not_block_on_locks.js",
|
||||
"//jstests/core/txns:kill_op_on_txn_expiry.js",
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
"//jstests/core/txns:speculative_snapshot_includes_all_writes.js",
|
||||
|
||||
# These workloads explicitly create collections inside multi-document transactions. These are
|
||||
# non-idempotent operations, and the implicit collection sharding logic upon collection access
|
||||
# results in premature collection creation, causing the workloads to fail.
|
||||
"//jstests/core/txns:create_indexes.js",
|
||||
"//jstests/core/txns:create_collection_parallel.js",
|
||||
"//jstests/core/txns:create_indexes_parallel.js",
|
||||
"//jstests/core/txns:commands_in_txns_read_concern.js",
|
||||
"//jstests/core/txns:create_collection.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_against_mongod_not_mongos",
|
||||
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
"assumes_no_implicit_collection_creation_on_get_collection",
|
||||
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
"assumes_no_implicit_collection_creation_after_drop",
|
||||
"assumes_no_implicit_index_creation",
|
||||
"assumes_unsharded_collection",
|
||||
"cannot_create_unique_index_when_using_hashed_shard_key",
|
||||
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
|
||||
# Prepare is not a command on mongos.
|
||||
"uses_prepare_transaction",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -181,13 +76,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "core_txns",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/core_txns.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_with_any_tags = [
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
],
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
"common",
|
||||
@ -202,14 +92,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "core_txns_large_txns_format",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/core_txns_large_txns_format.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [],
|
||||
exclude_with_any_tags = [
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
],
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
"jscore",
|
||||
@ -230,16 +114,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "replica_sets_large_txns_format_jscore_passthrough",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/replica_sets_large_txns_format_jscore_passthrough.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# These tests change the transactionLifetimeLimitSeconds server parameter which conflicts with how
|
||||
# the CheckReplDBHashInBackground hook doesn't want transactions to be reaped while it is running.
|
||||
"//jstests/core/txns:abort_expired_transaction.js",
|
||||
"//jstests/core/txns:abort_transaction_thread_does_not_block_on_locks.js",
|
||||
"//jstests/core/txns:kill_op_on_txn_expiry.js",
|
||||
],
|
||||
shard_count = 8,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -263,37 +139,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharded_causally_consistent_jscore_txns_passthrough",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharded_causally_consistent_jscore_txns_passthrough.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
"//jstests/core/txns:transactions_profiling_with_drops.js",
|
||||
"//jstests/core/txns:transactions_profiling.js",
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
"//jstests/core/txns:kill_op_on_txn_expiry.js",
|
||||
"//jstests/core/txns:abort_transaction_thread_does_not_block_on_locks.js",
|
||||
"//jstests/core/txns:abort_expired_transaction.js",
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
"//jstests/core/txns:speculative_snapshot_includes_all_writes.js",
|
||||
|
||||
# Does not use the transactions shell helpers so afterClusterTime read concern is incorrectly
|
||||
# attached to statements in a transaction beyond the first one.
|
||||
"//jstests/core/txns:non_transactional_operations_on_session_with_transaction.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_against_mongod_not_mongos",
|
||||
"does_not_support_causal_consistency",
|
||||
"requires_2_or_more_shards",
|
||||
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
|
||||
# Prepare is not a command on mongos.
|
||||
"uses_prepare_transaction",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"causally_consistent",
|
||||
@ -315,55 +162,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharded_collections_causally_consistent_jscore_txns_passthrough",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharded_collections_causally_consistent_jscore_txns_passthrough.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
"//jstests/core/txns:transactions_profiling_with_drops.js",
|
||||
"//jstests/core/txns:transactions_profiling.js",
|
||||
|
||||
# Set the transactionLifetimeLimitSeconds parameter, which is not on mongos.
|
||||
"//jstests/core/txns:abort_expired_transaction.js",
|
||||
"//jstests/core/txns:abort_transaction_thread_does_not_block_on_locks.js",
|
||||
"//jstests/core/txns:kill_op_on_txn_expiry.js",
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
"//jstests/core/txns:speculative_snapshot_includes_all_writes.js",
|
||||
|
||||
# Does not use the transactions shell helpers so afterClusterTime read concern is incorrectly
|
||||
# attached to statements in a transaction beyond the first one.
|
||||
"//jstests/core/txns:non_transactional_operations_on_session_with_transaction.js",
|
||||
|
||||
# These workloads explicitly create collections inside multi-document transactions. These are
|
||||
# non-idempotent operations, and the implicit collection sharding logic upon collection access
|
||||
# results in premature collection creation, causing the workloads to fail.
|
||||
"//jstests/core/txns:create_collection.js",
|
||||
"//jstests/core/txns:create_collection_parallel.js",
|
||||
"//jstests/core/txns:commands_in_txns_read_concern.js",
|
||||
"//jstests/core/txns:create_indexes.js",
|
||||
"//jstests/core/txns:create_indexes_parallel.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_against_mongod_not_mongos",
|
||||
"cannot_create_unique_index_when_using_hashed_shard_key",
|
||||
"does_not_support_causal_consistency",
|
||||
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
"assumes_no_implicit_collection_creation_on_get_collection",
|
||||
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
"assumes_no_implicit_collection_creation_after_drop",
|
||||
"assumes_no_implicit_index_creation",
|
||||
"assumes_unsharded_collection",
|
||||
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
|
||||
# Prepare is not a command on mongos
|
||||
"uses_prepare_transaction",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"causally_consistent",
|
||||
@ -385,32 +185,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharded_jscore_txns",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharded_jscore_txns.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
"//jstests/core/txns:transactions_profiling.js",
|
||||
"//jstests/core/txns:transactions_profiling_with_drops.js",
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
"//jstests/core/txns:abort_expired_transaction.js",
|
||||
"//jstests/core/txns:kill_op_on_txn_expiry.js",
|
||||
"//jstests/core/txns:abort_transaction_thread_does_not_block_on_locks.js",
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
"//jstests/core/txns:speculative_snapshot_includes_all_writes.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_against_mongod_not_mongos",
|
||||
"requires_2_or_more_shards",
|
||||
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
|
||||
# Prepare is not a command on mongos.
|
||||
"uses_prepare_transaction",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -431,50 +207,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharded_jscore_txns_sharded_collections",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharded_jscore_txns_sharded_collections.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
"//jstests/core/txns:transactions_profiling.js",
|
||||
"//jstests/core/txns:transactions_profiling_with_drops.js",
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
"//jstests/core/txns:abort_expired_transaction.js",
|
||||
"//jstests/core/txns:kill_op_on_txn_expiry.js",
|
||||
"//jstests/core/txns:abort_transaction_thread_does_not_block_on_locks.js",
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
"//jstests/core/txns:speculative_snapshot_includes_all_writes.js",
|
||||
|
||||
# These workloads explicitly create collections inside multi-document transactions. These are
|
||||
# non-idempotent operations, and the implicit collection sharding logic upon collection access
|
||||
# results in premature collection creation, causing the workloads to fail.
|
||||
"//jstests/core/txns:commands_in_txns_read_concern.js",
|
||||
"//jstests/core/txns:create_indexes_parallel.js",
|
||||
"//jstests/core/txns:create_collection.js",
|
||||
"//jstests/core/txns:create_collection_parallel.js",
|
||||
"//jstests/core/txns:create_indexes.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_against_mongod_not_mongos",
|
||||
"cannot_create_unique_index_when_using_hashed_shard_key",
|
||||
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
"assumes_no_implicit_collection_creation_on_get_collection",
|
||||
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
"assumes_no_implicit_collection_creation_after_drop",
|
||||
"assumes_no_implicit_index_creation",
|
||||
"assumes_unsharded_collection",
|
||||
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
|
||||
# Prepare is not a command on mongos.
|
||||
"uses_prepare_transaction",
|
||||
],
|
||||
shard_count = 4,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -495,32 +229,8 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharding_txns_uninitialized_fcv_jscore_passthrough",
|
||||
srcs = ["//jstests/core/txns:all_subpackage_javascript_files"],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharding_txns_uninitialized_fcv_jscore_passthrough.yml",
|
||||
data = ["//jstests/core/libs:raw_operation_utils.js"],
|
||||
exclude_files = [
|
||||
# Profile can only be run against the admin database on mongos.
|
||||
"//jstests/core/txns:transactions_profiling.js",
|
||||
"//jstests/core/txns:transactions_profiling_with_drops.js",
|
||||
|
||||
# transactionLifetimeLimitSeconds parameter is not available in mongos.
|
||||
"//jstests/core/txns:abort_expired_transaction.js",
|
||||
"//jstests/core/txns:kill_op_on_txn_expiry.js",
|
||||
"//jstests/core/txns:abort_transaction_thread_does_not_block_on_locks.js",
|
||||
|
||||
# Uses hangAfterCollectionInserts failpoint not available on mongos.
|
||||
"//jstests/core/txns:speculative_snapshot_includes_all_writes.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_against_mongod_not_mongos",
|
||||
"requires_2_or_more_shards",
|
||||
|
||||
# Transactions are not allowed to operate on capped collections.
|
||||
"requires_capped",
|
||||
|
||||
# Prepare is not a command on mongos.
|
||||
"uses_prepare_transaction",
|
||||
],
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
"initsync",
|
||||
|
||||
@ -3,85 +3,11 @@ load("//jstests/suites/query-execution:common.bzl", "CORE_DATA")
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharded_collections_jscore_passthrough_rate_limited",
|
||||
srcs = [
|
||||
"//jstests/core:all_subpackage_javascript_files",
|
||||
"//jstests/core_sharding:all_subpackage_javascript_files",
|
||||
"//jstests/fle2:all_subpackage_javascript_files",
|
||||
"//src/mongo/db/modules/enterprise/jstests/fle2:all_subpackage_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharded_collections_jscore_passthrough_rate_limited.yml",
|
||||
data = [
|
||||
"//jstests/sharding/analyze_shard_key/libs:all_subpackage_javascript_files",
|
||||
"//jstests/sharding/libs:all_subpackage_javascript_files",
|
||||
] + CORE_DATA,
|
||||
exclude_files = [
|
||||
# These tests run in the jscore_txn passthrough suites.
|
||||
"//jstests/core/txns:all_subpackage_javascript_files",
|
||||
|
||||
# The following tests fail because a certain command or functionality is not supported by
|
||||
# mongos. This command or functionality is placed in a comment next to the failing test.
|
||||
"//jstests/core/query/api:apitest_db.js", # serverStatus output doesn't have storageEngine.
|
||||
"//jstests/core/query:awaitdata_getmore_cmd.js", # capped collections.
|
||||
"//jstests/core/query/doc_validation:bypass_doc_validation.js", # sharded $out output not permitted
|
||||
"//jstests/core/administrative:check_shard_index.js", # checkShardingIndex.
|
||||
"//jstests/core/administrative:compact_keeps_indexes.js", # compact.
|
||||
"//jstests/core/administrative/current_op:currentop.js", # uses fsync.
|
||||
"//jstests/core/diagnostics:dbhash.js", # dbhash.
|
||||
"//jstests/core/administrative/fsync:fsync.js", # uses fsync.
|
||||
"//jstests/core/index/geo:geo_s2cursorlimitskip.js", # profiling.
|
||||
"//jstests/core/index/geo:geo_update_btree2.js", # notablescan.
|
||||
"//jstests/core/query:queryoptimizera.js", # "local" database.
|
||||
"//jstests/core/diagnostics:startup_log.js", # "local" database.
|
||||
"//jstests/core/query/cursor:tailable_cursor_invalidation.js", # capped collections.
|
||||
"//jstests/core/query/cursor:tailable_getmore_batch_size.js", # capped collections.
|
||||
"//jstests/core/query/cursor:tailable_skip_limit.js", # capped collections.
|
||||
"//jstests/core/query/top:top.js", # top.
|
||||
|
||||
# The following tests fail because mongos behaves differently from mongod when testing certain
|
||||
# functionality. The differences are in a comment next to the failing test.
|
||||
"//jstests/core/index/geo:geo_2d_explain.js", # executionSuccess in different spot in explain().
|
||||
"//jstests/core/index/geo:geo_s2explain.js", # inputStage in different spot in explain().
|
||||
"//jstests/core/index/geo:geo_s2sparse.js", # keysPerIndex in different spot in validate().
|
||||
"//jstests/core/diagnostics:operation_latency_histogram.js", # Stats are counted differently on mongos, SERVER-24880.
|
||||
|
||||
# The following tests fail because they count indexes. These counts do not take into account the
|
||||
# additional hashed shard key indexes that are automatically added by this passthrough.
|
||||
"//jstests/core/query/api:apitest_dbcollection.js",
|
||||
"//jstests/core/ddl:bad_index_plugin.js",
|
||||
"//jstests/core/ddl:create_indexes.js",
|
||||
"//jstests/core/txns:create_indexes.js",
|
||||
"//jstests/core/catalog:list_indexes_non_existent_ns.js",
|
||||
"//jstests/core/query/map_reduce:mr_preserve_indexes.js",
|
||||
|
||||
# TODO: Remove after fixing SERVER-103278. executionStats.nReturned is incorrect for sharded distinct commands.
|
||||
"//jstests/core/query/distinct:distinct_index1.js",
|
||||
|
||||
# TODO SERVER-32311: These tests use plan stage helpers which can't handle sharded explain output.
|
||||
"//jstests/core/index:index_multikey.js",
|
||||
"//jstests/core/query/expr:expr_index_use.js",
|
||||
"//jstests/core/query/explain:optimized_match_explain.js",
|
||||
"//jstests/core/query/sort:sort_array.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_standalone_mongod",
|
||||
"assumes_against_mongod_not_mongos",
|
||||
|
||||
# This passthrough implicitly shards the accessed collections. Do not run tests where collections
|
||||
# can't be created on `getCollection` call.
|
||||
"assumes_no_implicit_collection_creation_on_get_collection",
|
||||
|
||||
# Tests tagged with the following will fail because they assume collections are not sharded.
|
||||
"assumes_no_implicit_collection_creation_after_drop",
|
||||
"assumes_no_implicit_index_creation",
|
||||
"assumes_unsharded_collection",
|
||||
"cannot_create_unique_index_when_using_hashed_shard_key",
|
||||
|
||||
# system.profile collection doesn't exist on mongos.
|
||||
"requires_profiling",
|
||||
|
||||
# Capped collections cannot be sharded
|
||||
"requires_capped",
|
||||
],
|
||||
shard_count = 20,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
@ -101,89 +27,11 @@ resmoke_suite_test(
|
||||
|
||||
resmoke_suite_test(
|
||||
name = "sharding_jscore_passthrough_with_balancer_rate_limited",
|
||||
srcs = [
|
||||
"//jstests/core:all_subpackage_javascript_files",
|
||||
"//jstests/core_sharding:all_subpackage_javascript_files",
|
||||
"//jstests/fle2:all_subpackage_javascript_files",
|
||||
"//src/mongo/db/modules/enterprise/jstests/fle2:all_subpackage_javascript_files",
|
||||
],
|
||||
config = "//buildscripts/resmokeconfig:suites/sharding_jscore_passthrough_with_balancer_rate_limited.yml",
|
||||
data = [
|
||||
"//jstests/sharding/analyze_shard_key/libs:all_subpackage_javascript_files",
|
||||
"//jstests/sharding/libs:all_subpackage_javascript_files",
|
||||
] + CORE_DATA,
|
||||
exclude_files = [
|
||||
# These tests use chunk migration, and they expect the balancer to be disabled.
|
||||
"//jstests/core_sharding/chunk_migration:all_javascript_files",
|
||||
|
||||
# These tests are run in sharded_jscore_txns.
|
||||
"//jstests/core/txns:all_subpackage_javascript_files",
|
||||
|
||||
# TODO SERVER-87108 re-enable all map reduce tests
|
||||
"//jstests/core/query/map_reduce:all_javascript_files",
|
||||
|
||||
# The following tests fail because a certain command or functionality is not supported on
|
||||
# mongos. This command or functionality is placed in a comment next to the failing test.
|
||||
"//jstests/core/query/api:apitest_db.js", # serverStatus output doesn't have storageEngine.
|
||||
"//jstests/core/administrative:check_shard_index.js", # checkShardingIndex.
|
||||
"//jstests/core/administrative:compact_keeps_indexes.js", # compact.
|
||||
"//jstests/core/administrative/current_op:currentop.js", # uses fsync.
|
||||
"//jstests/core/diagnostics:dbhash.js", # dbhash.
|
||||
"//jstests/core/administrative/fsync:fsync.js", # uses fsync.
|
||||
"//jstests/core/index/geo:geo_s2cursorlimitskip.js", # profiling.
|
||||
"//jstests/core/index/geo:geo_update_btree2.js", # notablescan.
|
||||
"//jstests/core/query:queryoptimizera.js", # "local" database.
|
||||
"//jstests/core/diagnostics:startup_log.js", # "local" database.
|
||||
"//jstests/core/query/top:top.js", # top.
|
||||
|
||||
# The following tests fail because mongos behaves differently from mongod when testing certain
|
||||
# functionality. The differences are in a comment next to the failing test.
|
||||
"//jstests/core/index/geo:geo_2d_explain.js", # executionSuccess in different spot in explain().
|
||||
"//jstests/core/index/geo:geo_s2sparse.js", # inputStage in different spot in explain().
|
||||
"//jstests/core/index/geo:geo_s2explain.js", # keysPerIndex in different spot in validate().
|
||||
"//jstests/core/diagnostics:operation_latency_histogram.js", # Stats are counted differently on mongos, SERVER-24880.
|
||||
|
||||
# override library is not able to intercept createIndex commands executed inside benchRun
|
||||
"//jstests/core/shell:bench_test1.js",
|
||||
|
||||
# moveCollection will drop indexes which will reset index statistics this test asserts on.
|
||||
"//jstests/core/index:index_stats.js",
|
||||
|
||||
# moveCollection and the many deleteMany commands in this test block each other and can easily cause the test to time out.
|
||||
# This is caused by the pauseMigrationsDuringMultiUpdates cluster parameter and the random migrations failpoint both being enabled for this suite.
|
||||
# TODO SERVER-91655: re-enable this test in this suite or potentially in a noPassthrough suite.
|
||||
"//jstests/core/timeseries/query:timeseries_predicates.js",
|
||||
|
||||
# moveCollection and the many multi updates in this test block each other and can easily cause the test to time out.
|
||||
# This is caused by the pauseMigrationsDuringMultiUpdates cluster parameter and the random migrations failpoint both being enabled for this suite.
|
||||
# TODO SERVER-91722: re-enable this test in this suite or potentially in a noPassthrough suite.
|
||||
"//jstests/core/index/geo:geo_update_btree.js",
|
||||
|
||||
# TODO SERVER-88275: A moveCollection command changes the UUID of the targeted collection.
|
||||
# Any query using an auto yielding policy will likely return a QueryPlanKilled error if a moveCollection commit happens during the query execution.
|
||||
"//jstests/core/timeseries/geo:timeseries_geonear_random_measurements.js",
|
||||
"//jstests/core/timeseries/query:timeseries_homogeneous_top_bottom.js",
|
||||
],
|
||||
exclude_with_any_tags = [
|
||||
"assumes_standalone_mongod",
|
||||
"assumes_against_mongod_not_mongos",
|
||||
"assumes_balancer_off",
|
||||
|
||||
# system.profile collection doesn't exist on mongos.
|
||||
"requires_profiling",
|
||||
|
||||
# fsync lock is not compatible with migrations since it
|
||||
# can't be executed while DDL lock is being held.
|
||||
"requires_fsync",
|
||||
|
||||
# This suite performs balancing of unsharded collection in background
|
||||
# using moveCollection that changes collections UUID
|
||||
"assumes_stable_collection_uuid",
|
||||
|
||||
# implicitly_retry_on_migration_in_progress.js alters find/aggregate commands
|
||||
# so that the whole result set is returned through a single batch
|
||||
"assumes_no_implicit_cursor_exhaustion",
|
||||
],
|
||||
shard_count = 20,
|
||||
tags = [
|
||||
"ci-release-critical",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user