summaryrefslogtreecommitdiff
path: root/buildscripts/resmokelib/testing
diff options
context:
space:
mode:
authorJordi Serra Torrens <jordi.serra-torrens@mongodb.com>2023-01-18 10:49:06 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-18 11:29:34 +0000
commitc82eaeff371a536180ab1136ae571c706ad6ed68 (patch)
treee4203428abe2553b5acb83179d63d0ec61272571 /buildscripts/resmokelib/testing
parenteffd5996bf966b5784223e9ab08f8401c33f9d2f (diff)
downloadmongo-c82eaeff371a536180ab1136ae571c706ad6ed68.tar.gz
SERVER-71690 Implement a new sharding hook to verify the sharding filtering metadata
Diffstat (limited to 'buildscripts/resmokelib/testing')
-rw-r--r--buildscripts/resmokelib/testing/hooks/shard_filtering_metadata.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/shard_filtering_metadata.py b/buildscripts/resmokelib/testing/hooks/shard_filtering_metadata.py
new file mode 100644
index 00000000000..5c197b69ae5
--- /dev/null
+++ b/buildscripts/resmokelib/testing/hooks/shard_filtering_metadata.py
@@ -0,0 +1,22 @@
+"""Test hook for verifying the correctness of shard filtering metadata on shards of a sharded cluster."""
+
+import os.path
+
+from buildscripts.resmokelib.testing.fixtures import shardedcluster
+from buildscripts.resmokelib.testing.hooks import jsfile
+
+
+class CheckShardFilteringMetadata(jsfile.DataConsistencyHook):
+ IS_BACKGROUND = False
+
+ def __init__(self, hook_logger, fixture, shell_options=None):
+ """Initialize CheckShardFilteringMetadata."""
+
+ if not isinstance(fixture, shardedcluster.ShardedClusterFixture):
+ raise ValueError(f"'fixture' must be an instance of ShardedClusterFixture, but got"
+ f" {fixture.__class__.__name__}")
+
+ description = "Inspect filtering metadata on shards"
+ js_filename = os.path.join("jstests", "hooks", "run_check_shard_filtering_metadata.js")
+ super().__init__(hook_logger, fixture, js_filename, description,
+ shell_options=shell_options)