diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 77773cfd147..3277f143bff 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -297,6 +297,18 @@ WORKSPACE.bazel @10gen/devprod-build @svc-auto-approve-bot # The following patterns are parsed from ./jstests/libs/override_methods/OWNERS.yml /jstests/libs/override_methods/**/*golden_overrides.js @10gen/query-optimization @svc-auto-approve-bot +# The following patterns are parsed from ./jstests/libs/query/OWNERS.yml +/jstests/libs/query/**/* @10gen/query @svc-auto-approve-bot +/jstests/libs/query/**/analyze_plan.js @10gen/query-optimization @svc-auto-approve-bot +/jstests/libs/query/**/aggregation_pipeline_utils.js @10gen/query @svc-auto-approve-bot +/jstests/libs/query/**/change_stream*.js @10gen/query-execution @svc-auto-approve-bot +/jstests/libs/query/**/geo*.js @10gen/query-integration @svc-auto-approve-bot +/jstests/libs/query/**/group_to_distinct_scan_utils.js @10gen/query-integration @svc-auto-approve-bot +/jstests/libs/query/**/optimizer_utils.js @10gen/query-optimization @svc-auto-approve-bot +/jstests/libs/query/**/query_settings*.js @10gen/query-execution @svc-auto-approve-bot +/jstests/libs/query/**/sbe*.js @10gen/query-execution @svc-auto-approve-bot +/jstests/libs/query/**/wildcard_index_helpers.js @10gen/query-optimization @svc-auto-approve-bot + # The following patterns are parsed from ./jstests/multiVersion/OWNERS.yml /jstests/multiVersion/**/migration* @10gen/server-cluster-scalability @svc-auto-approve-bot /jstests/multiVersion/**/rs_endpoint* @10gen/server-cluster-scalability @svc-auto-approve-bot diff --git a/buildscripts/resmokelib/testing/testcases/mql_model_mongod_test.py b/buildscripts/resmokelib/testing/testcases/mql_model_mongod_test.py index 4c26ade4f44..f96f20d6459 100644 --- a/buildscripts/resmokelib/testing/testcases/mql_model_mongod_test.py +++ b/buildscripts/resmokelib/testing/testcases/mql_model_mongod_test.py @@ -28,7 +28,7 @@ class MqlModelMongodTestCase(jsrunnerfile.JSRunnerFileTestCase): logger, "MQL MongoD Model test", json_filenames[0], - test_runner_file="jstests/libs/mql_model_mongod_test_runner.js", + test_runner_file="jstests/libs/query/mql_model_mongod_test_runner.js", shell_executable=shell_executable, shell_options=shell_options, ) diff --git a/jstests/aggregation/accumulators/first_last.js b/jstests/aggregation/accumulators/first_last.js index 57b43b8f6c3..3b15f93fee0 100644 --- a/jstests/aggregation/accumulators/first_last.js +++ b/jstests/aggregation/accumulators/first_last.js @@ -1,7 +1,7 @@ /** * Basic tests for the $first/$last accumulators. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {arrayEq, orderedArrayEq} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/accumulators/first_n_last_n.js b/jstests/aggregation/accumulators/first_n_last_n.js index e271d302f85..d6ca4a5eed0 100644 --- a/jstests/aggregation/accumulators/first_n_last_n.js +++ b/jstests/aggregation/accumulators/first_n_last_n.js @@ -1,7 +1,7 @@ /** * Basic tests for the $firstN/$lastN accumulators. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {arrayEq} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/accumulators/min_n_max_n.js b/jstests/aggregation/accumulators/min_n_max_n.js index 8838715d5e2..6b42c979bf4 100644 --- a/jstests/aggregation/accumulators/min_n_max_n.js +++ b/jstests/aggregation/accumulators/min_n_max_n.js @@ -1,7 +1,7 @@ /** * Basic tests for the $minN/$maxN accumulators. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/aggregation/accumulators/top_bottom_top_n_bottom_n.js b/jstests/aggregation/accumulators/top_bottom_top_n_bottom_n.js index df833ba2d32..052ae9c62a0 100644 --- a/jstests/aggregation/accumulators/top_bottom_top_n_bottom_n.js +++ b/jstests/aggregation/accumulators/top_bottom_top_n_bottom_n.js @@ -1,7 +1,7 @@ /** * Basic tests for the $top/$bottom/$topN/$bottomN accumulators. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/aggregation/add_with_date.js b/jstests/aggregation/add_with_date.js index b20258d1b0d..7cea25981a3 100644 --- a/jstests/aggregation/add_with_date.js +++ b/jstests/aggregation/add_with_date.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.getSiblingDB(jsTestName()).coll; coll.drop(); diff --git a/jstests/aggregation/bugs/optimize_text.js b/jstests/aggregation/bugs/optimize_text.js index 6909003c392..379eab58546 100644 --- a/jstests/aggregation/bugs/optimize_text.js +++ b/jstests/aggregation/bugs/optimize_text.js @@ -4,7 +4,7 @@ // # because the shard doesn't know whether the merger needs the textScore metadata. // assumes_unsharded_collection, // ] -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.optimize_text; assert.commandWorked(coll.createIndex({"$**": "text"})); diff --git a/jstests/aggregation/bugs/reverseArray.js b/jstests/aggregation/bugs/reverseArray.js index 72ef588091d..175672c40c3 100644 --- a/jstests/aggregation/bugs/reverseArray.js +++ b/jstests/aggregation/bugs/reverseArray.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; var coll = db.reverseArray; diff --git a/jstests/aggregation/bugs/server10176.js b/jstests/aggregation/bugs/server10176.js index 4286f5f21cb..553b580ad31 100644 --- a/jstests/aggregation/bugs/server10176.js +++ b/jstests/aggregation/bugs/server10176.js @@ -1,6 +1,6 @@ // SERVER-10176: Add $abs aggregation expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server11118.js b/jstests/aggregation/bugs/server11118.js index fe8e7d749f0..50752588b90 100644 --- a/jstests/aggregation/bugs/server11118.js +++ b/jstests/aggregation/bugs/server11118.js @@ -1,5 +1,5 @@ // SERVER-11118 Tests for $dateToString -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server14670.js b/jstests/aggregation/bugs/server14670.js index 0fb458f3092..b185b34ceb4 100644 --- a/jstests/aggregation/bugs/server14670.js +++ b/jstests/aggregation/bugs/server14670.js @@ -3,7 +3,7 @@ * test their expected behaviour. * */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server14872.js b/jstests/aggregation/bugs/server14872.js index a41850b3fb0..d8c1bdeca39 100644 --- a/jstests/aggregation/bugs/server14872.js +++ b/jstests/aggregation/bugs/server14872.js @@ -1,6 +1,6 @@ // SERVER-14872: Aggregation expression to concatenate multiple arrays into one -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server20169.js b/jstests/aggregation/bugs/server20169.js index 341ff1cca4e..dfb3b648320 100644 --- a/jstests/aggregation/bugs/server20169.js +++ b/jstests/aggregation/bugs/server20169.js @@ -1,6 +1,6 @@ // In SERVER-20169, the $range expression was added to the aggregation framework. In this file, we // test the behavior and error cases of this expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server22093.js b/jstests/aggregation/bugs/server22093.js index e3854c12d7f..15ffe845142 100644 --- a/jstests/aggregation/bugs/server22093.js +++ b/jstests/aggregation/bugs/server22093.js @@ -16,7 +16,7 @@ import { getAggPlanStage, getQueryPlanner, planHasStage -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; var coll = db.countscan; coll.drop(); diff --git a/jstests/aggregation/bugs/server4589.js b/jstests/aggregation/bugs/server4589.js index d2159bbe7c1..408c5c080ee 100644 --- a/jstests/aggregation/bugs/server4589.js +++ b/jstests/aggregation/bugs/server4589.js @@ -1,6 +1,6 @@ // SERVER-4589: Add $arrayElemAt aggregation expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server6190.js b/jstests/aggregation/bugs/server6190.js index 31c75469300..20affdcea38 100644 --- a/jstests/aggregation/bugs/server6190.js +++ b/jstests/aggregation/bugs/server6190.js @@ -1,6 +1,6 @@ // $week returns a date's week of the year. Week zero is comprised of any dates before the first // Sunday of the year. SERVER-6190 -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server6192_server6193.js b/jstests/aggregation/bugs/server6192_server6193.js index e38b03cdd86..b4e2f5f509d 100644 --- a/jstests/aggregation/bugs/server6192_server6193.js +++ b/jstests/aggregation/bugs/server6192_server6193.js @@ -11,7 +11,7 @@ // do_not_wrap_aggregations_in_facets, // requires_pipeline_optimization, // ] -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const t = db.jstests_aggregation_server6192; t.drop(); diff --git a/jstests/aggregation/bugs/server6195.js b/jstests/aggregation/bugs/server6195.js index 5ed9c76f7a9..0a3a333fd9d 100644 --- a/jstests/aggregation/bugs/server6195.js +++ b/jstests/aggregation/bugs/server6195.js @@ -1,6 +1,6 @@ // ensure $concat asserts on string -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server6239.js b/jstests/aggregation/bugs/server6239.js index 9a78c52cd60..617829e2b4a 100644 --- a/jstests/aggregation/bugs/server6239.js +++ b/jstests/aggregation/bugs/server6239.js @@ -1,6 +1,6 @@ // SERVER-6239 reenable $add and $subtract with dates with better semantics // Note: error conditions tested also in server6240.js -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server6240.js b/jstests/aggregation/bugs/server6240.js index 4a0429cbd90..98876cbe04d 100644 --- a/jstests/aggregation/bugs/server6240.js +++ b/jstests/aggregation/bugs/server6240.js @@ -13,7 +13,7 @@ * 3) Assert that we get the correct error */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server6570.js b/jstests/aggregation/bugs/server6570.js index aaee71a92fd..5bdca70f2f4 100644 --- a/jstests/aggregation/bugs/server6570.js +++ b/jstests/aggregation/bugs/server6570.js @@ -1,5 +1,5 @@ // ensure $add asserts on string -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/server7781.js b/jstests/aggregation/bugs/server7781.js index 6344d355457..7b57601973e 100644 --- a/jstests/aggregation/bugs/server7781.js +++ b/jstests/aggregation/bugs/server7781.js @@ -1,5 +1,5 @@ // SERVER-7781 $geoNear pipeline stage -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; var coll = 'server7781'; diff --git a/jstests/aggregation/bugs/server8568.js b/jstests/aggregation/bugs/server8568.js index 563998018b9..42609da5c94 100644 --- a/jstests/aggregation/bugs/server8568.js +++ b/jstests/aggregation/bugs/server8568.js @@ -1,5 +1,5 @@ // SERVER-8568: Adding $sqrt expression -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/bugs/skip_limit_overflow.js b/jstests/aggregation/bugs/skip_limit_overflow.js index 7d4862a0714..6554e6c2f67 100644 --- a/jstests/aggregation/bugs/skip_limit_overflow.js +++ b/jstests/aggregation/bugs/skip_limit_overflow.js @@ -12,8 +12,8 @@ * requires_pipeline_optimization, * ] */ -import {aggPlanHasStage, getAggPlanStages} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {aggPlanHasStage, getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.server39788; coll.drop(); diff --git a/jstests/aggregation/bugs/substr.js b/jstests/aggregation/bugs/substr.js index a82ab187146..144e8c106dd 100644 --- a/jstests/aggregation/bugs/substr.js +++ b/jstests/aggregation/bugs/substr.js @@ -1,5 +1,5 @@ // Aggregation $substrBytes tests. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; let t = db.jstests_aggregation_substr; diff --git a/jstests/aggregation/bugs/substrCP.js b/jstests/aggregation/bugs/substrCP.js index bac76ef3c72..b33cac4dc96 100644 --- a/jstests/aggregation/bugs/substrCP.js +++ b/jstests/aggregation/bugs/substrCP.js @@ -1,6 +1,6 @@ // In SERVER-22580 and SERVER-51557, the $substrCP expression was introduced. In this file, we test // the error cases and the intended behavior of this expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; var coll = db.substrCP; diff --git a/jstests/aggregation/bugs/upperlower.js b/jstests/aggregation/bugs/upperlower.js index 354ffe51687..325cf9b4277 100644 --- a/jstests/aggregation/bugs/upperlower.js +++ b/jstests/aggregation/bugs/upperlower.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.jstests_aggregation_upperlower; coll.drop(); diff --git a/jstests/aggregation/explain.js b/jstests/aggregation/explain.js index 1cba7ca5399..be56234b5ec 100644 --- a/jstests/aggregation/explain.js +++ b/jstests/aggregation/explain.js @@ -1,7 +1,7 @@ // Tests the behavior of explain() when used with the aggregation pipeline. // - Explain() should not read or modify the plan cache. // - The result should always include serverInfo. -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; let coll = db.explain; coll.drop(); diff --git a/jstests/aggregation/explain_limit.js b/jstests/aggregation/explain_limit.js index c5a2931454c..c4883cd500f 100644 --- a/jstests/aggregation/explain_limit.js +++ b/jstests/aggregation/explain_limit.js @@ -8,8 +8,8 @@ // # Implicit index creation may change the plan/engine used. // assumes_no_implicit_index_creation, // ] -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; let coll = db.explain_limit; diff --git a/jstests/aggregation/explain_per_stage_exec_stats.js b/jstests/aggregation/explain_per_stage_exec_stats.js index 698582baa70..9df237c6c90 100644 --- a/jstests/aggregation/explain_per_stage_exec_stats.js +++ b/jstests/aggregation/explain_per_stage_exec_stats.js @@ -12,8 +12,8 @@ * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_per_stage_exec_stats; coll.drop(); diff --git a/jstests/aggregation/expressions/add.js b/jstests/aggregation/expressions/add.js index c46a54c823b..8f38e756d0f 100644 --- a/jstests/aggregation/expressions/add.js +++ b/jstests/aggregation/expressions/add.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrCodeAndErrMsgContains} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/any_element_true.js b/jstests/aggregation/expressions/any_element_true.js index 4110fd6d4da..61f5f898a6e 100644 --- a/jstests/aggregation/expressions/any_element_true.js +++ b/jstests/aggregation/expressions/any_element_true.js @@ -1,7 +1,7 @@ /** * Basic test coverage for the $anyElementTrue expression. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.any_element_true; coll.drop(); diff --git a/jstests/aggregation/expressions/arrayToObject.js b/jstests/aggregation/expressions/arrayToObject.js index 081db0ed0e4..87b9e224756 100644 --- a/jstests/aggregation/expressions/arrayToObject.js +++ b/jstests/aggregation/expressions/arrayToObject.js @@ -1,5 +1,5 @@ // Tests for $arrayToObject aggregation expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/concat_arrays.js b/jstests/aggregation/expressions/concat_arrays.js index f13ec0af10f..2abd4a8ecbf 100644 --- a/jstests/aggregation/expressions/concat_arrays.js +++ b/jstests/aggregation/expressions/concat_arrays.js @@ -11,10 +11,10 @@ // # tests from implicit index creation suites. // assumes_no_implicit_index_creation, // ] -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.projection_expr_concat_arrays; coll.drop(); diff --git a/jstests/aggregation/expressions/date_add_subtract.js b/jstests/aggregation/expressions/date_add_subtract.js index b4a755f42a0..3f0fc4ae2a6 100644 --- a/jstests/aggregation/expressions/date_add_subtract.js +++ b/jstests/aggregation/expressions/date_add_subtract.js @@ -4,9 +4,9 @@ * ] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; -import {executeAggregationTestCase} from "jstests/libs/aggregation_pipeline_utils.js"; +import {executeAggregationTestCase} from "jstests/libs/query/aggregation_pipeline_utils.js"; const coll = db.date_add_subtract; coll.drop(); diff --git a/jstests/aggregation/expressions/date_diff.js b/jstests/aggregation/expressions/date_diff.js index 9de42502abc..8f8ab28abac 100644 --- a/jstests/aggregation/expressions/date_diff.js +++ b/jstests/aggregation/expressions/date_diff.js @@ -3,8 +3,8 @@ * @tags: [ * ] */ -import "jstests/libs/sbe_assert_error_override.js"; -import {executeAggregationTestCase} from "jstests/libs/aggregation_pipeline_utils.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; +import {executeAggregationTestCase} from "jstests/libs/query/aggregation_pipeline_utils.js"; const testDB = db.getSiblingDB(jsTestName()); const coll = testDB.collection; diff --git a/jstests/aggregation/expressions/date_expressions_with_timezones.js b/jstests/aggregation/expressions/date_expressions_with_timezones.js index 76aae2925c3..b1c7d82dcfe 100644 --- a/jstests/aggregation/expressions/date_expressions_with_timezones.js +++ b/jstests/aggregation/expressions/date_expressions_with_timezones.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.date_expressions_with_time_zones; coll.drop(); diff --git a/jstests/aggregation/expressions/date_from_parts.js b/jstests/aggregation/expressions/date_from_parts.js index 295c898a3c0..7f6c201d827 100644 --- a/jstests/aggregation/expressions/date_from_parts.js +++ b/jstests/aggregation/expressions/date_from_parts.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import { anyEq, diff --git a/jstests/aggregation/expressions/date_from_string.js b/jstests/aggregation/expressions/date_from_string.js index 29b5c066228..5316b914958 100644 --- a/jstests/aggregation/expressions/date_from_string.js +++ b/jstests/aggregation/expressions/date_from_string.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import { anyEq, diff --git a/jstests/aggregation/expressions/date_from_string_on_error.js b/jstests/aggregation/expressions/date_from_string_on_error.js index 581426e578b..80c7eed5845 100644 --- a/jstests/aggregation/expressions/date_from_string_on_error.js +++ b/jstests/aggregation/expressions/date_from_string_on_error.js @@ -1,7 +1,7 @@ /** * Tests for the $dateFromString expression with the optional 'onError' parameter. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrCodeAndErrMsgContains} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/date_to_parts.js b/jstests/aggregation/expressions/date_to_parts.js index 22c785885b4..412e32bfc57 100644 --- a/jstests/aggregation/expressions/date_to_parts.js +++ b/jstests/aggregation/expressions/date_to_parts.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/date_to_string.js b/jstests/aggregation/expressions/date_to_string.js index 33e60171554..590ddf5acf7 100644 --- a/jstests/aggregation/expressions/date_to_string.js +++ b/jstests/aggregation/expressions/date_to_string.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrCodeAndErrMsgContains} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/date_trunc.js b/jstests/aggregation/expressions/date_trunc.js index 3884dd9c505..e40c6230b72 100644 --- a/jstests/aggregation/expressions/date_trunc.js +++ b/jstests/aggregation/expressions/date_trunc.js @@ -3,8 +3,8 @@ * @tags: [ * ] */ -import "jstests/libs/sbe_assert_error_override.js"; -import {executeAggregationTestCase} from "jstests/libs/aggregation_pipeline_utils.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; +import {executeAggregationTestCase} from "jstests/libs/query/aggregation_pipeline_utils.js"; const testDB = db.getSiblingDB(jsTestName()); const coll = testDB.collection; diff --git a/jstests/aggregation/expressions/day_of_expressions.js b/jstests/aggregation/expressions/day_of_expressions.js index 33d32305cdc..bb61dcd684a 100644 --- a/jstests/aggregation/expressions/day_of_expressions.js +++ b/jstests/aggregation/expressions/day_of_expressions.js @@ -1,6 +1,6 @@ // Tests for the $dayOfYear, $dayOfMonth, and $dayOfWeek expressions. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {arrayEq, assertArrayEq, assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/divide.js b/jstests/aggregation/expressions/divide.js index 4668cd2c1b7..5d2b9d3de13 100644 --- a/jstests/aggregation/expressions/divide.js +++ b/jstests/aggregation/expressions/divide.js @@ -1,5 +1,5 @@ // Tests for $divide aggregation expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/expression_mod.js b/jstests/aggregation/expressions/expression_mod.js index d428c97a1b6..b584dc7c6d8 100644 --- a/jstests/aggregation/expressions/expression_mod.js +++ b/jstests/aggregation/expressions/expression_mod.js @@ -1,6 +1,6 @@ // Confirm correctness of $mod evaluation in aggregation. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode, testExpression} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/expression_trigonometric.js b/jstests/aggregation/expressions/expression_trigonometric.js index a7cdb77714c..8bf44374f0a 100644 --- a/jstests/aggregation/expressions/expression_trigonometric.js +++ b/jstests/aggregation/expressions/expression_trigonometric.js @@ -1,6 +1,6 @@ // SERVER-32930: Basic integration tests for trigonometric aggregation expressions. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/filter.js b/jstests/aggregation/expressions/filter.js index 206aeb393f2..2655f5aeb34 100644 --- a/jstests/aggregation/expressions/filter.js +++ b/jstests/aggregation/expressions/filter.js @@ -1,6 +1,6 @@ // Test $filter aggregation expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertArrayEq, assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/floor_ceil.js b/jstests/aggregation/expressions/floor_ceil.js index 70d2749ebab..48c1927129c 100644 --- a/jstests/aggregation/expressions/floor_ceil.js +++ b/jstests/aggregation/expressions/floor_ceil.js @@ -1,6 +1,6 @@ // The following are integration tests for $floor and $ceil. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/in.js b/jstests/aggregation/expressions/in.js index 2030a12deba..5d4a909371c 100644 --- a/jstests/aggregation/expressions/in.js +++ b/jstests/aggregation/expressions/in.js @@ -3,7 +3,7 @@ // @tags: [ // assumes_no_implicit_collection_creation_after_drop, // ] -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; const caseSensitive = { diff --git a/jstests/aggregation/expressions/indexof_bytes.js b/jstests/aggregation/expressions/indexof_bytes.js index 0408bc5c550..f0f5ff7ac44 100644 --- a/jstests/aggregation/expressions/indexof_bytes.js +++ b/jstests/aggregation/expressions/indexof_bytes.js @@ -1,6 +1,6 @@ // In SERVER-8951, $indexOfBytes was introduced. In this file, we test the correctness and error // cases of the expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode, testExpression} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/indexof_codepoints.js b/jstests/aggregation/expressions/indexof_codepoints.js index fcc6936afb3..8225f245cc9 100644 --- a/jstests/aggregation/expressions/indexof_codepoints.js +++ b/jstests/aggregation/expressions/indexof_codepoints.js @@ -1,6 +1,6 @@ // In SERVER-8951, $indexOfCP was introduced. In this file, we test the correctness and error // cases of the expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode, testExpression} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/log_pow_exp.js b/jstests/aggregation/expressions/log_pow_exp.js index d70a0861578..b91b57b64b1 100644 --- a/jstests/aggregation/expressions/log_pow_exp.js +++ b/jstests/aggregation/expressions/log_pow_exp.js @@ -1,6 +1,6 @@ // SERVER-18427: Add $log, $log10, $ln, $pow, and $exp aggregation expressions. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/multiply.js b/jstests/aggregation/expressions/multiply.js index 771e3dde61a..1797e65c145 100644 --- a/jstests/aggregation/expressions/multiply.js +++ b/jstests/aggregation/expressions/multiply.js @@ -1,5 +1,5 @@ // Tests for $multiply aggregation expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/objectToArray.js b/jstests/aggregation/expressions/objectToArray.js index 1397faf8f96..3bd9bf17a2a 100644 --- a/jstests/aggregation/expressions/objectToArray.js +++ b/jstests/aggregation/expressions/objectToArray.js @@ -1,5 +1,5 @@ // Tests for the $objectToArray aggregation expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/regex.js b/jstests/aggregation/expressions/regex.js index 4a5034f4c98..72aaf01cebc 100644 --- a/jstests/aggregation/expressions/regex.js +++ b/jstests/aggregation/expressions/regex.js @@ -1,7 +1,7 @@ /** * Tests for $regexFind, $regexFindAll and $regexMatch aggregation expressions. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {anyEq, assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/regex_error_cases.js b/jstests/aggregation/expressions/regex_error_cases.js index 4085ac86866..5bf7ac4f9e9 100644 --- a/jstests/aggregation/expressions/regex_error_cases.js +++ b/jstests/aggregation/expressions/regex_error_cases.js @@ -1,5 +1,5 @@ -import "jstests/libs/sbe_assert_error_override.js"; -import {executeAggregationTestCase} from "jstests/libs/aggregation_pipeline_utils.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; +import {executeAggregationTestCase} from "jstests/libs/query/aggregation_pipeline_utils.js"; const coll = db.regex_error_cases; coll.drop(); diff --git a/jstests/aggregation/expressions/regex_limits.js b/jstests/aggregation/expressions/regex_limits.js index c38b3d5813e..8228751c0de 100644 --- a/jstests/aggregation/expressions/regex_limits.js +++ b/jstests/aggregation/expressions/regex_limits.js @@ -5,7 +5,7 @@ * tsan_incompatible, * ] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/replace_one.js b/jstests/aggregation/expressions/replace_one.js index 986f6a68c34..dbdbf6bf64a 100644 --- a/jstests/aggregation/expressions/replace_one.js +++ b/jstests/aggregation/expressions/replace_one.js @@ -1,6 +1,6 @@ // Test $replaceOne aggregation expressions. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/round_trunc.js b/jstests/aggregation/expressions/round_trunc.js index f3130920a7c..9c628ad4e9b 100644 --- a/jstests/aggregation/expressions/round_trunc.js +++ b/jstests/aggregation/expressions/round_trunc.js @@ -1,6 +1,6 @@ // Basic integration tests for the $round and $trunc aggregation expressions. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/set.js b/jstests/aggregation/expressions/set.js index b26d0c85078..aa9bca2adaf 100644 --- a/jstests/aggregation/expressions/set.js +++ b/jstests/aggregation/expressions/set.js @@ -1,7 +1,7 @@ /** * Test the set expressions. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/sortArray.js b/jstests/aggregation/expressions/sortArray.js index 92f448526b6..8b9428e302d 100644 --- a/jstests/aggregation/expressions/sortArray.js +++ b/jstests/aggregation/expressions/sortArray.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; let coll = db.sortArray; diff --git a/jstests/aggregation/expressions/split.js b/jstests/aggregation/expressions/split.js index a185499ceb5..192d5836373 100644 --- a/jstests/aggregation/expressions/split.js +++ b/jstests/aggregation/expressions/split.js @@ -1,7 +1,7 @@ // In SERVER-6773, the $split expression was introduced. In this file, we test the functionality and // error cases of the expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode, testExpression} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/subtract.js b/jstests/aggregation/expressions/subtract.js index 3de1c7c9878..c5f907d8a9b 100644 --- a/jstests/aggregation/expressions/subtract.js +++ b/jstests/aggregation/expressions/subtract.js @@ -1,5 +1,5 @@ // Tests for $subtract aggregation expression -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrCodeAndErrMsgContains} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/switch_errors.js b/jstests/aggregation/expressions/switch_errors.js index f39826b8807..34f6b47e963 100644 --- a/jstests/aggregation/expressions/switch_errors.js +++ b/jstests/aggregation/expressions/switch_errors.js @@ -1,6 +1,6 @@ // SERVER-10689 introduced the $switch expression. In this file, we test the error cases of the // expression. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/expressions/trim.js b/jstests/aggregation/expressions/trim.js index 9c123634c54..d3d1c397070 100644 --- a/jstests/aggregation/expressions/trim.js +++ b/jstests/aggregation/expressions/trim.js @@ -1,7 +1,7 @@ /** * Basic tests for the $trim, $ltrim, and $rtrim expressions. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import { assertErrorCode, diff --git a/jstests/aggregation/expressions/ts_second_increment.js b/jstests/aggregation/expressions/ts_second_increment.js index 8232faa4bba..2a4dc2deff3 100644 --- a/jstests/aggregation/expressions/ts_second_increment.js +++ b/jstests/aggregation/expressions/ts_second_increment.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; var testDB = db.getSiblingDB("expression_ts_second_increment"); diff --git a/jstests/aggregation/expressions/unary_numeric.js b/jstests/aggregation/expressions/unary_numeric.js index c22fa9a7c34..979d2356bd6 100644 --- a/jstests/aggregation/expressions/unary_numeric.js +++ b/jstests/aggregation/expressions/unary_numeric.js @@ -1,6 +1,6 @@ // Tests the behavior of $ceil, $floor, $exp, $log10, $ln and $sqrt when used in agg expressions. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/extras/window_function_helpers.js b/jstests/aggregation/extras/window_function_helpers.js index 54e07ed68e0..8a486337908 100644 --- a/jstests/aggregation/extras/window_function_helpers.js +++ b/jstests/aggregation/extras/window_function_helpers.js @@ -1,5 +1,5 @@ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; /** * Create a collection of tickers and prices. diff --git a/jstests/aggregation/group_conversion_to_distinct_scan.js b/jstests/aggregation/group_conversion_to_distinct_scan.js index b1f683b2abd..e76f6e582e6 100644 --- a/jstests/aggregation/group_conversion_to_distinct_scan.js +++ b/jstests/aggregation/group_conversion_to_distinct_scan.js @@ -19,8 +19,8 @@ * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; import { addIndex, assertPipelineResultsAndExplain, @@ -32,7 +32,7 @@ import { documents, prepareCollection, removeIndex, -} from "jstests/libs/group_to_distinct_scan_utils.js"; +} from "jstests/libs/query/group_to_distinct_scan_utils.js"; prepareCollection(); diff --git a/jstests/aggregation/group_with_acc_n_to_distinct_scan.js b/jstests/aggregation/group_with_acc_n_to_distinct_scan.js index b6d1e0e0dd8..cf8627af3ce 100644 --- a/jstests/aggregation/group_with_acc_n_to_distinct_scan.js +++ b/jstests/aggregation/group_with_acc_n_to_distinct_scan.js @@ -22,7 +22,7 @@ import { assertPlanUsesDistinctScan, assertPlanUsesIndexScan, prepareCollection, -} from "jstests/libs/group_to_distinct_scan_utils.js"; +} from "jstests/libs/query/group_to_distinct_scan_utils.js"; prepareCollection(); diff --git a/jstests/aggregation/group_with_top_bottom_to_distinct_scan.js b/jstests/aggregation/group_with_top_bottom_to_distinct_scan.js index cc5a72cb4c5..3c70ccfdb49 100644 --- a/jstests/aggregation/group_with_top_bottom_to_distinct_scan.js +++ b/jstests/aggregation/group_with_top_bottom_to_distinct_scan.js @@ -18,7 +18,7 @@ * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; import { addIndex, assertPipelineResultsAndExplain, @@ -28,8 +28,8 @@ import { assertPlanUsesIndexScan, prepareCollection, removeIndex, -} from "jstests/libs/group_to_distinct_scan_utils.js"; -import {checkSbeCompletelyDisabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/group_to_distinct_scan_utils.js"; +import {checkSbeCompletelyDisabled} from "jstests/libs/query/sbe_util.js"; prepareCollection(); diff --git a/jstests/aggregation/match_no_swap_rand.js b/jstests/aggregation/match_no_swap_rand.js index 77dc24a952b..16c778acf0b 100644 --- a/jstests/aggregation/match_no_swap_rand.js +++ b/jstests/aggregation/match_no_swap_rand.js @@ -14,7 +14,7 @@ * requires_fcv_72 * ] */ -import {getPlanStage, getQueryPlanner, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getQueryPlanner, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; function getWinningPlanForPipeline({coll, pipeline}) { const explain = assert.commandWorked(coll.explain().aggregate(pipeline)); diff --git a/jstests/aggregation/match_swapping_renamed_fields.js b/jstests/aggregation/match_swapping_renamed_fields.js index fa661b579bf..fbd16c8532e 100644 --- a/jstests/aggregation/match_swapping_renamed_fields.js +++ b/jstests/aggregation/match_swapping_renamed_fields.js @@ -6,7 +6,7 @@ * requires_pipeline_optimization, * ] */ -import {getAggPlanStage, getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; /** * Utillity for inhibiting aggregate stage pushdowns to find-land queries. It doesn't prohibit other diff --git a/jstests/aggregation/optimize_away_pipeline.js b/jstests/aggregation/optimize_away_pipeline.js index 37f23b6d83c..65a3513458a 100644 --- a/jstests/aggregation/optimize_away_pipeline.js +++ b/jstests/aggregation/optimize_away_pipeline.js @@ -15,6 +15,7 @@ // not_allowed_with_signed_security_token, // ] import {isWiredTiger} from "jstests/concurrency/fsm_workload_helpers/server_types.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { aggPlanHasStage, getAggPlanStage, @@ -22,9 +23,11 @@ import { isAggregationPlan, isQueryPlan, planHasStage, -} from "jstests/libs/analyze_plan.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {checkSbeFullyEnabled, checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import { + checkSbeFullyEnabled, + checkSbeRestrictedOrFullyEnabled +} from "jstests/libs/query/sbe_util.js"; const sbeFullyEnabled = checkSbeFullyEnabled(db); const sbeRestricted = checkSbeRestrictedOrFullyEnabled(db); diff --git a/jstests/aggregation/range.js b/jstests/aggregation/range.js index 5a28f3ffb4c..99a04308882 100644 --- a/jstests/aggregation/range.js +++ b/jstests/aggregation/range.js @@ -1,7 +1,7 @@ /* * Tests general $range functionality. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {arrayEq, assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/sources/graphLookup/error.js b/jstests/aggregation/sources/graphLookup/error.js index f7269c2c5b2..1c11a962c76 100644 --- a/jstests/aggregation/sources/graphLookup/error.js +++ b/jstests/aggregation/sources/graphLookup/error.js @@ -1,6 +1,6 @@ // In MongoDB 3.4, $graphLookup was introduced. In this file, we test the error cases. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/aggregation/sources/graphLookup/graphlookup_rewrite.js b/jstests/aggregation/sources/graphLookup/graphlookup_rewrite.js index 8f08bc4458d..f7cafb84391 100644 --- a/jstests/aggregation/sources/graphLookup/graphlookup_rewrite.js +++ b/jstests/aggregation/sources/graphLookup/graphlookup_rewrite.js @@ -8,7 +8,7 @@ // ] import {arrayEq, orderedArrayEq} from "jstests/aggregation/extras/utils.js"; -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.graphlookup_rewrite; coll.drop(); diff --git a/jstests/aggregation/sources/group/top_bottom_common_sort_key_optimization.js b/jstests/aggregation/sources/group/top_bottom_common_sort_key_optimization.js index 67cb2446dd0..224852e72fb 100644 --- a/jstests/aggregation/sources/group/top_bottom_common_sort_key_optimization.js +++ b/jstests/aggregation/sources/group/top_bottom_common_sort_key_optimization.js @@ -21,7 +21,7 @@ import { getEngine, getPlanStages, getSingleNodeExplain -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB(jsTestName()); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/aggregation/sources/lookup/lookup_collation.js b/jstests/aggregation/sources/lookup/lookup_collation.js index df47c23bba7..063216fdb3b 100644 --- a/jstests/aggregation/sources/lookup/lookup_collation.js +++ b/jstests/aggregation/sources/lookup/lookup_collation.js @@ -10,8 +10,12 @@ * The 'collation' command option overrides local collection's collation. */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStages, getQueryPlanner, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + getAggPlanStages, + getQueryPlanner, + getWinningPlan +} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB(jsTestName()); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/aggregation/sources/lookup/lookup_equijoin_semantics_lib.js b/jstests/aggregation/sources/lookup/lookup_equijoin_semantics_lib.js index 739effa0cc5..95ff8bed711 100644 --- a/jstests/aggregation/sources/lookup/lookup_equijoin_semantics_lib.js +++ b/jstests/aggregation/sources/lookup/lookup_equijoin_semantics_lib.js @@ -15,8 +15,8 @@ */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; export const JoinAlgorithm = { HJ: {name: "HJ", strategy: "HashJoin"}, diff --git a/jstests/aggregation/sources/lookup/lookup_foreign_collation.js b/jstests/aggregation/sources/lookup/lookup_foreign_collation.js index 4c466f0ad7a..0dd3ee32503 100644 --- a/jstests/aggregation/sources/lookup/lookup_foreign_collation.js +++ b/jstests/aggregation/sources/lookup/lookup_foreign_collation.js @@ -6,8 +6,8 @@ * ] */ import {anyEq} from "jstests/aggregation/extras/utils.js"; -import {getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB(jsTestName()); const localColl = testDB.local_no_collation; diff --git a/jstests/aggregation/sources/lookup/lookup_non_existent_collection.js b/jstests/aggregation/sources/lookup/lookup_non_existent_collection.js index 8003f735102..7513e1d5885 100644 --- a/jstests/aggregation/sources/lookup/lookup_non_existent_collection.js +++ b/jstests/aggregation/sources/lookup/lookup_non_existent_collection.js @@ -9,8 +9,8 @@ * ] */ -import {aggPlanHasStage, getAggPlanStages} from "jstests/libs/analyze_plan.js"; -import {checkSbeCompletelyDisabled} from "jstests/libs/sbe_util.js"; +import {aggPlanHasStage, getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeCompletelyDisabled} from "jstests/libs/query/sbe_util.js"; if (checkSbeCompletelyDisabled(db)) { jsTestLog("Skipping test because SBE is disabled: no lowering of $lookup to SBE."); diff --git a/jstests/aggregation/sources/lookup/lookup_numeric_field.js b/jstests/aggregation/sources/lookup/lookup_numeric_field.js index 830f1da2a86..a6374deeeb2 100644 --- a/jstests/aggregation/sources/lookup/lookup_numeric_field.js +++ b/jstests/aggregation/sources/lookup/lookup_numeric_field.js @@ -5,7 +5,7 @@ // # Using a column scan removes the transformBy we search for. // assumes_no_implicit_index_creation, // ] -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const local = db.local; const foreign = db.foreign; diff --git a/jstests/aggregation/sources/lookup/lookup_query_stats.js b/jstests/aggregation/sources/lookup/lookup_query_stats.js index 6729b851679..5629c1c9dfb 100644 --- a/jstests/aggregation/sources/lookup/lookup_query_stats.js +++ b/jstests/aggregation/sources/lookup/lookup_query_stats.js @@ -14,12 +14,15 @@ * requires_pipeline_optimization * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; import { getQueryInfoAtTopLevelOrFirstStage, getSbePlanStages -} from "jstests/libs/sbe_explain_helpers.js"; -import {checkSbeFullyEnabled, checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_explain_helpers.js"; +import { + checkSbeFullyEnabled, + checkSbeRestrictedOrFullyEnabled +} from "jstests/libs/query/sbe_util.js"; const isSBEFullyEnabled = checkSbeFullyEnabled(db); const isSBELookupEnabled = checkSbeRestrictedOrFullyEnabled(db); diff --git a/jstests/aggregation/sources/lookup/profile_lookup.js b/jstests/aggregation/sources/lookup/profile_lookup.js index 5dd30487c4c..878eb0bb6e9 100644 --- a/jstests/aggregation/sources/lookup/profile_lookup.js +++ b/jstests/aggregation/sources/lookup/profile_lookup.js @@ -5,7 +5,7 @@ // not_allowed_with_signed_security_token, // ] -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const localColl = db.local; const foreignColl = db.foreign; diff --git a/jstests/aggregation/sources/match/elemmatch_optimization.js b/jstests/aggregation/sources/match/elemmatch_optimization.js index d85d85c034c..8c55a9b8042 100644 --- a/jstests/aggregation/sources/match/elemmatch_optimization.js +++ b/jstests/aggregation/sources/match/elemmatch_optimization.js @@ -16,7 +16,7 @@ import { getPlanStages, getWinningPlanFromExplain, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/aggregation/sources/match/trivial_match_expr.js b/jstests/aggregation/sources/match/trivial_match_expr.js index dcfd05148f4..b011c115341 100644 --- a/jstests/aggregation/sources/match/trivial_match_expr.js +++ b/jstests/aggregation/sources/match/trivial_match_expr.js @@ -10,7 +10,7 @@ // # Explicitly testing optimization. // requires_pipeline_optimization, // ] -import {getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.trivial_match_expr; coll.drop(); diff --git a/jstests/aggregation/sources/project/remove_redundant_projects.js b/jstests/aggregation/sources/project/remove_redundant_projects.js index c36de25637c..9e35cb0b9f0 100644 --- a/jstests/aggregation/sources/project/remove_redundant_projects.js +++ b/jstests/aggregation/sources/project/remove_redundant_projects.js @@ -13,12 +13,12 @@ import { getWinningPlan, isAggregationPlan, isQueryPlan, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; import { checkSbeCompletelyDisabled, checkSbeFullyEnabled, checkSbeRestrictedOrFullyEnabled -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; let coll = db.remove_redundant_projects; coll.drop(); diff --git a/jstests/aggregation/sources/setWindowFields/comprehensive_parse.js b/jstests/aggregation/sources/setWindowFields/comprehensive_parse.js index 80a6644363c..8d85ca44136 100644 --- a/jstests/aggregation/sources/setWindowFields/comprehensive_parse.js +++ b/jstests/aggregation/sources/setWindowFields/comprehensive_parse.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/aggregation/sources/setWindowFields/derivative.js b/jstests/aggregation/sources/setWindowFields/derivative.js index 9bddf4cbfbb..614067b1576 100644 --- a/jstests/aggregation/sources/setWindowFields/derivative.js +++ b/jstests/aggregation/sources/setWindowFields/derivative.js @@ -1,7 +1,7 @@ /** * Test the behavior of $derivative. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.setWindowFields_derivative; diff --git a/jstests/aggregation/sources/setWindowFields/desugar.js b/jstests/aggregation/sources/setWindowFields/desugar.js index 0c0a718839e..570e71e572f 100644 --- a/jstests/aggregation/sources/setWindowFields/desugar.js +++ b/jstests/aggregation/sources/setWindowFields/desugar.js @@ -10,7 +10,7 @@ * do_not_wrap_aggregations_in_facets, * ] */ -import {getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import {getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; assert.commandWorked(coll.insert({})); diff --git a/jstests/aggregation/sources/setWindowFields/explain.js b/jstests/aggregation/sources/setWindowFields/explain.js index 617cad7b089..fd4b93943af 100644 --- a/jstests/aggregation/sources/setWindowFields/explain.js +++ b/jstests/aggregation/sources/setWindowFields/explain.js @@ -6,7 +6,7 @@ * * @tags: [assumes_against_mongod_not_mongos] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/aggregation/sources/setWindowFields/integral.js b/jstests/aggregation/sources/setWindowFields/integral.js index 4566682d9d8..c68a45b4644 100644 --- a/jstests/aggregation/sources/setWindowFields/integral.js +++ b/jstests/aggregation/sources/setWindowFields/integral.js @@ -1,7 +1,7 @@ /** * Test the behavior of $integral. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {documentBounds} from "jstests/aggregation/extras/window_function_helpers.js"; const coll = db.setWindowFields_integral; diff --git a/jstests/aggregation/sources/setWindowFields/linear_fill.js b/jstests/aggregation/sources/setWindowFields/linear_fill.js index ca0d926022b..3f5b567ee3c 100644 --- a/jstests/aggregation/sources/setWindowFields/linear_fill.js +++ b/jstests/aggregation/sources/setWindowFields/linear_fill.js @@ -4,7 +4,7 @@ * requires_fcv_52, * ] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.linear_fill; coll.drop(); diff --git a/jstests/aggregation/sources/setWindowFields/memory_limit.js b/jstests/aggregation/sources/setWindowFields/memory_limit.js index 83b215d1a58..d562eeb1d3c 100644 --- a/jstests/aggregation/sources/setWindowFields/memory_limit.js +++ b/jstests/aggregation/sources/setWindowFields/memory_limit.js @@ -7,7 +7,7 @@ * ] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {DiscoverTopology} from "jstests/libs/discover_topology.js"; import {setParameterOnAllHosts} from "jstests/noPassthrough/libs/server_parameter_helpers.js"; diff --git a/jstests/aggregation/sources/setWindowFields/n_accumulators.js b/jstests/aggregation/sources/setWindowFields/n_accumulators.js index fec9fd4fd63..23afef2ba59 100644 --- a/jstests/aggregation/sources/setWindowFields/n_accumulators.js +++ b/jstests/aggregation/sources/setWindowFields/n_accumulators.js @@ -1,7 +1,7 @@ /** * Test that the 'n' family of accumulators work as window functions. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import { seedWithTickerData, diff --git a/jstests/aggregation/sources/setWindowFields/optimize.js b/jstests/aggregation/sources/setWindowFields/optimize.js index a78d75c2f59..94887da54b6 100644 --- a/jstests/aggregation/sources/setWindowFields/optimize.js +++ b/jstests/aggregation/sources/setWindowFields/optimize.js @@ -7,7 +7,7 @@ * requires_pipeline_optimization, * ] */ -import {aggPlanHasStage, getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage, getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; // Find how many stages of the plan are 'stageName'. function numberOfStages(explain, stageName) { diff --git a/jstests/aggregation/sources/setWindowFields/partition.js b/jstests/aggregation/sources/setWindowFields/partition.js index 833a4a6cae1..a20dd779973 100644 --- a/jstests/aggregation/sources/setWindowFields/partition.js +++ b/jstests/aggregation/sources/setWindowFields/partition.js @@ -9,7 +9,7 @@ * ] */ import {resultsEq} from "jstests/aggregation/extras/utils.js"; -import {getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import {getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/aggregation/sources/setWindowFields/range_wrong_type.js b/jstests/aggregation/sources/setWindowFields/range_wrong_type.js index 4a8159428bb..c323a14fe5b 100644 --- a/jstests/aggregation/sources/setWindowFields/range_wrong_type.js +++ b/jstests/aggregation/sources/setWindowFields/range_wrong_type.js @@ -5,7 +5,7 @@ * Originally intended to reproduce SERVER-71387. */ -import "jstests/libs/sbe_assert_error_override.js"; // Override error-code-checking APIs. +import "jstests/libs/query/sbe_assert_error_override.js"; // Override error-code-checking APIs. const coll = db.set_window_fields_range_wrong_type; coll.drop(); diff --git a/jstests/aggregation/sources/setWindowFields/spill_to_disk.js b/jstests/aggregation/sources/setWindowFields/spill_to_disk.js index 20fcf81b8a4..d9714bbd783 100644 --- a/jstests/aggregation/sources/setWindowFields/spill_to_disk.js +++ b/jstests/aggregation/sources/setWindowFields/spill_to_disk.js @@ -8,17 +8,17 @@ * not_allowed_with_signed_security_token, * ] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {arrayEq} from "jstests/aggregation/extras/utils.js"; import { seedWithTickerData, testAccumAgainstGroup } from "jstests/aggregation/extras/window_function_helpers.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {DiscoverTopology} from "jstests/libs/discover_topology.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; import {setParameterOnAllHosts} from "jstests/noPassthrough/libs/server_parameter_helpers.js"; // Doc size was found through logging the size in the SpillableCache. Partition sizes were chosen diff --git a/jstests/aggregation/sources/setWindowFields/time.js b/jstests/aggregation/sources/setWindowFields/time.js index a0fee4a3c39..8bed3ebbbb5 100644 --- a/jstests/aggregation/sources/setWindowFields/time.js +++ b/jstests/aggregation/sources/setWindowFields/time.js @@ -1,7 +1,7 @@ /** * Test time-based window bounds. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.setWindowFields_time; coll.drop(); diff --git a/jstests/aggregation/sources/setWindowFields/window_functions_on_timeseries_coll.js b/jstests/aggregation/sources/setWindowFields/window_functions_on_timeseries_coll.js index 5146d0efc2d..ec975031ac5 100644 --- a/jstests/aggregation/sources/setWindowFields/window_functions_on_timeseries_coll.js +++ b/jstests/aggregation/sources/setWindowFields/window_functions_on_timeseries_coll.js @@ -12,7 +12,7 @@ * ] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStage, getQueryPlanner, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getQueryPlanner, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.window_functions_on_timeseries_coll; diff --git a/jstests/aggregation/sources/sort/explain_sort.js b/jstests/aggregation/sources/sort/explain_sort.js index ae0f8223a6a..da3c27010ba 100644 --- a/jstests/aggregation/sources/sort/explain_sort.js +++ b/jstests/aggregation/sources/sort/explain_sort.js @@ -5,7 +5,7 @@ // # Asserts on the number of documents examined in an explain plan. // assumes_no_implicit_index_creation // ] -import {getAggPlanStages, isQueryPlan} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages, isQueryPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_sort; coll.drop(); diff --git a/jstests/aggregation/sources/unionWith/unionWith.js b/jstests/aggregation/sources/unionWith/unionWith.js index 80df6637394..98d7e0a6acb 100644 --- a/jstests/aggregation/sources/unionWith/unionWith.js +++ b/jstests/aggregation/sources/unionWith/unionWith.js @@ -6,7 +6,7 @@ * ] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {anyEq} from "jstests/aggregation/extras/utils.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; diff --git a/jstests/aggregation/sources/unionWith/unionWith_explain.js b/jstests/aggregation/sources/unionWith/unionWith_explain.js index bd36cf7a73c..dc4565b9812 100644 --- a/jstests/aggregation/sources/unionWith/unionWith_explain.js +++ b/jstests/aggregation/sources/unionWith/unionWith_explain.js @@ -8,8 +8,8 @@ */ import {anyEq, arrayEq, documentEq} from "jstests/aggregation/extras/utils.js"; -import {getExecutionStats, getUnionWithStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getExecutionStats, getUnionWithStage} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB(jsTestName()); const collA = testDB.A; diff --git a/jstests/aggregation/spill_to_disk.js b/jstests/aggregation/spill_to_disk.js index 1ec286a2fc8..7360ec930e1 100644 --- a/jstests/aggregation/spill_to_disk.js +++ b/jstests/aggregation/spill_to_disk.js @@ -13,12 +13,12 @@ // requires_persistence, // not_allowed_with_signed_security_token, // ] -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {arrayEq, assertArrayEq} from "jstests/aggregation/extras/utils.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {getSbePlanStages} from "jstests/libs/sbe_explain_helpers.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getSbePlanStages} from "jstests/libs/query/sbe_explain_helpers.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.spill_to_disk; coll.drop(); diff --git a/jstests/aggregation/split_match_and_swap_with_sort.js b/jstests/aggregation/split_match_and_swap_with_sort.js index 86ef01ef101..72266e48da8 100644 --- a/jstests/aggregation/split_match_and_swap_with_sort.js +++ b/jstests/aggregation/split_match_and_swap_with_sort.js @@ -11,7 +11,7 @@ // # Don't disable the thing we are specifically testing for! // requires_pipeline_optimization, // ] -import {getAggPlanStage, getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getPlanStage} from "jstests/libs/query/analyze_plan.js"; const collName = jsTestName(); const coll = db.getSiblingDB("split_match_and_swap_with_sort")[collName]; diff --git a/jstests/aggregation/use_query_project_and_sort.js b/jstests/aggregation/use_query_project_and_sort.js index f65e6ce61ef..d2b21726046 100644 --- a/jstests/aggregation/use_query_project_and_sort.js +++ b/jstests/aggregation/use_query_project_and_sort.js @@ -7,7 +7,7 @@ // @tags: [ // do_not_wrap_aggregations_in_facets, // ] -import {hasRejectedPlans, isQueryPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {hasRejectedPlans, isQueryPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.use_query_project_and_sort; coll.drop(); diff --git a/jstests/aggregation/use_query_projection.js b/jstests/aggregation/use_query_projection.js index 0e49fb789c4..b3eebce0d24 100644 --- a/jstests/aggregation/use_query_projection.js +++ b/jstests/aggregation/use_query_projection.js @@ -13,7 +13,7 @@ import { isAggregationPlan, isQueryPlan, planHasStage, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.use_query_projection; coll.drop(); diff --git a/jstests/aggregation/use_query_sort.js b/jstests/aggregation/use_query_sort.js index e62588dc960..cecefe68876 100644 --- a/jstests/aggregation/use_query_sort.js +++ b/jstests/aggregation/use_query_sort.js @@ -10,7 +10,7 @@ import { hasRejectedPlans, isQueryPlan, planHasStage, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.use_query_sort; coll.drop(); diff --git a/jstests/aggregation/variables/runtime_constants.js b/jstests/aggregation/variables/runtime_constants.js index 1e2e6d67b95..a17e05982e7 100644 --- a/jstests/aggregation/variables/runtime_constants.js +++ b/jstests/aggregation/variables/runtime_constants.js @@ -2,7 +2,7 @@ * Tests the behavior of runtime constants $$IS_MR and $$JS_SCOPE. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; const coll = db.runtime_constants; diff --git a/jstests/auth/sbe_plan_cache_user_roles.js b/jstests/auth/sbe_plan_cache_user_roles.js index bd1b49d9820..88b7137c829 100644 --- a/jstests/auth/sbe_plan_cache_user_roles.js +++ b/jstests/auth/sbe_plan_cache_user_roles.js @@ -6,7 +6,7 @@ * assumes_standalone_mongod, * ] */ -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const mongod = MongoRunner.runMongod(); const dbName = "test"; diff --git a/jstests/auth/user_roles_disable_parameter.js b/jstests/auth/user_roles_disable_parameter.js index 82bbdf4ec63..f2c2e74be41 100644 --- a/jstests/auth/user_roles_disable_parameter.js +++ b/jstests/auth/user_roles_disable_parameter.js @@ -1,7 +1,7 @@ // Tests that $$USER_ROLES is not available when the server parameter is set to false. // @tags: [requires_fcv_70] -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const dbName = "test"; const collName = "coll"; diff --git a/jstests/change_streams/apply_ops.js b/jstests/change_streams/apply_ops.js index 98bad36dd4c..e447b69827e 100644 --- a/jstests/change_streams/apply_ops.js +++ b/jstests/change_streams/apply_ops.js @@ -9,9 +9,9 @@ */ import {withTxnAndAutoRetryOnMongos} from "jstests/libs/auto_retry_transaction_in_sharding.js"; -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const otherCollName = "change_stream_apply_ops_2"; const coll = assertDropAndRecreateCollection(db, "change_stream_apply_ops"); diff --git a/jstests/change_streams/apply_ops_resumability.js b/jstests/change_streams/apply_ops_resumability.js index 32a45474d7a..c442b73a79f 100644 --- a/jstests/change_streams/apply_ops_resumability.js +++ b/jstests/change_streams/apply_ops_resumability.js @@ -3,9 +3,9 @@ // @tags: [uses_transactions, requires_snapshot_read, requires_majority_read_concern] import {withTxnAndAutoRetryOnMongos} from "jstests/libs/auto_retry_transaction_in_sharding.js"; -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const coll = assertDropAndRecreateCollection(db, "change_stream_apply_ops"); const otherCollName = "change_stream_apply_ops_2"; diff --git a/jstests/change_streams/apply_ops_vectored_insert.js b/jstests/change_streams/apply_ops_vectored_insert.js index e79679a8d17..3a05c923222 100644 --- a/jstests/change_streams/apply_ops_vectored_insert.js +++ b/jstests/change_streams/apply_ops_vectored_insert.js @@ -7,9 +7,9 @@ * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const otherCollName = "change_stream_apply_ops_vi_2"; const coll = assertDropAndRecreateCollection(db, "change_stream_apply_ops_vi"); diff --git a/jstests/change_streams/change_stream.js b/jstests/change_streams/change_stream.js index 1ee8e513cc0..e68166f42af 100644 --- a/jstests/change_streams/change_stream.js +++ b/jstests/change_streams/change_stream.js @@ -2,16 +2,16 @@ // Mark as assumes_read_preference_unchanged since reading from the non-replicated "system.profile" // collection results in a failure in the secondary reads suite. // @tags: [assumes_read_preference_unchanged] -import { - assertInvalidChangeStreamNss, - assertValidChangeStreamNss, - ChangeStreamTest -} from "jstests/libs/change_stream_util.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + assertInvalidChangeStreamNss, + assertValidChangeStreamNss, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; // Drop and recreate the collections to be used in this set of tests. assertDropAndRecreateCollection(db, "t1"); diff --git a/jstests/change_streams/collation.js b/jstests/change_streams/collation.js index 0d2adce937a..94396afc55b 100644 --- a/jstests/change_streams/collation.js +++ b/jstests/change_streams/collation.js @@ -2,17 +2,17 @@ * Tests that a change stream can take a user-specified collation, does not inherit the collection's * default collation, and uses the simple collation if none is provided. */ -import { - assertChangeStreamEventEq, - ChangeStreamTest, - isChangeStreamPassthrough, - runCommandChangeStreamPassthroughAware, -} from "jstests/libs/change_stream_util.js"; import { assertCreateCollection, assertDropAndRecreateCollection, assertDropCollection, } from "jstests/libs/collection_drop_recreate.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest, + isChangeStreamPassthrough, + runCommandChangeStreamPassthroughAware, +} from "jstests/libs/query/change_stream_util.js"; let cst = new ChangeStreamTest(db); diff --git a/jstests/change_streams/create_event_from_chunk_migration.js b/jstests/change_streams/create_event_from_chunk_migration.js index 7a04c86d075..6e4d6ac4935 100644 --- a/jstests/change_streams/create_event_from_chunk_migration.js +++ b/jstests/change_streams/create_event_from_chunk_migration.js @@ -12,8 +12,8 @@ * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = jsTestName(); diff --git a/jstests/change_streams/ddl_abort_index_build_event.js b/jstests/change_streams/ddl_abort_index_build_event.js index 6a6e6b0b2f5..b756801bbe2 100644 --- a/jstests/change_streams/ddl_abort_index_build_event.js +++ b/jstests/change_streams/ddl_abort_index_build_event.js @@ -7,7 +7,7 @@ * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); const coll = testDB.coll; diff --git a/jstests/change_streams/ddl_coll_mod_event.js b/jstests/change_streams/ddl_coll_mod_event.js index a5170bf73e6..1a145dcf778 100644 --- a/jstests/change_streams/ddl_coll_mod_event.js +++ b/jstests/change_streams/ddl_coll_mod_event.js @@ -9,8 +9,8 @@ * exclude_when_record_ids_replicated * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/ddl_create_drop_index_events.js b/jstests/change_streams/ddl_create_drop_index_events.js index 96221becdb4..518b21bd2dd 100644 --- a/jstests/change_streams/ddl_create_drop_index_events.js +++ b/jstests/change_streams/ddl_create_drop_index_events.js @@ -7,7 +7,7 @@ * assumes_against_mongod_not_mongos, * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/ddl_create_event.js b/jstests/change_streams/ddl_create_event.js index 435898e9b01..f9a48f87c12 100644 --- a/jstests/change_streams/ddl_create_event.js +++ b/jstests/change_streams/ddl_create_event.js @@ -10,9 +10,12 @@ * exclude_when_record_ids_replicated * ] */ -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/ddl_create_index_txn.js b/jstests/change_streams/ddl_create_index_txn.js index fcdc92d5305..7232bccae70 100644 --- a/jstests/change_streams/ddl_create_index_txn.js +++ b/jstests/change_streams/ddl_create_index_txn.js @@ -15,8 +15,8 @@ * ] */ import {withTxnAndAutoRetryOnMongos} from "jstests/libs/auto_retry_transaction_in_sharding.js"; -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const dbName = jsTestName() + "_db0"; const collName = jsTestName() + '_1'; diff --git a/jstests/change_streams/ddl_rename_cross_db.js b/jstests/change_streams/ddl_rename_cross_db.js index 9248fdcd461..e69c6ddc053 100644 --- a/jstests/change_streams/ddl_rename_cross_db.js +++ b/jstests/change_streams/ddl_rename_cross_db.js @@ -10,7 +10,7 @@ * assumes_against_mongod_not_mongos, * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; function runTest(watchType, renameType) { // Use minimum distinguishable names to keep database name under 64-byte limit. diff --git a/jstests/change_streams/ddl_view_events.js b/jstests/change_streams/ddl_view_events.js index 971b87cab2b..7e8bdcde425 100644 --- a/jstests/change_streams/ddl_view_events.js +++ b/jstests/change_streams/ddl_view_events.js @@ -9,12 +9,12 @@ * exclude_when_record_ids_replicated * ] */ +import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; import { assertChangeStreamEventEq, canonicalizeEventForTesting, ChangeStreamTest -} from "jstests/libs/change_stream_util.js"; -import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/delete_in_txn_produces_correct_doc_key.js b/jstests/change_streams/delete_in_txn_produces_correct_doc_key.js index fcf37764f2d..f28208d2619 100644 --- a/jstests/change_streams/delete_in_txn_produces_correct_doc_key.js +++ b/jstests/change_streams/delete_in_txn_produces_correct_doc_key.js @@ -6,8 +6,8 @@ // assumes_against_mongod_not_mongos // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const collName = "delete_in_txn_produces_correct_doc_key"; diff --git a/jstests/change_streams/does_not_implicitly_create_database.js b/jstests/change_streams/does_not_implicitly_create_database.js index e5d1a5218ad..6caca9b83df 100644 --- a/jstests/change_streams/does_not_implicitly_create_database.js +++ b/jstests/change_streams/does_not_implicitly_create_database.js @@ -3,7 +3,7 @@ * created, and will not implicitly create either. */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; // Ensure that the test DB does not exist. const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/end_of_transaction.js b/jstests/change_streams/end_of_transaction.js index 5127c6c767d..22a6ef3f192 100644 --- a/jstests/change_streams/end_of_transaction.js +++ b/jstests/change_streams/end_of_transaction.js @@ -11,9 +11,9 @@ */ import {withTxnAndAutoRetryOnMongos} from "jstests/libs/auto_retry_transaction_in_sharding.js"; -import {assertEndOfTransaction, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {assertEndOfTransaction, ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const otherCollName = "change_stream_end_of_transaction_2"; const coll = assertDropAndRecreateCollection(db, "change_stream_end_of_transaction"); diff --git a/jstests/change_streams/expanded_update_description.js b/jstests/change_streams/expanded_update_description.js index a74f489ca12..ed3c7a30c56 100644 --- a/jstests/change_streams/expanded_update_description.js +++ b/jstests/change_streams/expanded_update_description.js @@ -2,8 +2,8 @@ * Test change stream 'updateDescription' with 'showExpandedEvents'. */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; // Drop and recreate the collections to be used in this set of tests. assertDropAndRecreateCollection(db, "coll"); diff --git a/jstests/change_streams/global_index.js b/jstests/change_streams/global_index.js index ddc073dbbea..b5e36209b15 100644 --- a/jstests/change_streams/global_index.js +++ b/jstests/change_streams/global_index.js @@ -12,7 +12,10 @@ // TODO (SERVER-69932): once sharding has a working global index implementation, rewrite this test // to run on mongos (don't use internal commands) and remove assumes_against_mongod_not_mongos. -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; const adminDB = db.getSiblingDB("admin"); const cst = new ChangeStreamTest(adminDB); diff --git a/jstests/change_streams/include_cluster_time.js b/jstests/change_streams/include_cluster_time.js index a9546d6aad4..6e966ce7c7e 100644 --- a/jstests/change_streams/include_cluster_time.js +++ b/jstests/change_streams/include_cluster_time.js @@ -4,8 +4,8 @@ // the oplog entry. When operations get bundled into a transaction, their operationTime is instead // based on the commit oplog entry, which would cause this test to fail. // @tags: [change_stream_does_not_expect_txns] -import {assertInvalidateOp} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {assertInvalidateOp} from "jstests/libs/query/change_stream_util.js"; // Drop and recreate the collections to be used in this set of tests. const coll = assertDropAndRecreateCollection(db, "include_cluster_time"); diff --git a/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js b/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js index dc8d4457c17..3e01a4a8fd7 100644 --- a/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js +++ b/jstests/change_streams/lookup_pit_pre_and_post_image_in_transaction.js @@ -6,9 +6,9 @@ * uses_transactions, * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {TransactionsUtil} from "jstests/libs/transactions_util.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/lookup_post_image.js b/jstests/change_streams/lookup_post_image.js index 21dfb7292aa..50585a00982 100644 --- a/jstests/change_streams/lookup_post_image.js +++ b/jstests/change_streams/lookup_post_image.js @@ -5,13 +5,16 @@ // do_not_wrap_aggregations_in_facets, // uses_multiple_connections, // ] -import {ChangeStreamTest, isChangeStreamPassthrough} from "jstests/libs/change_stream_util.js"; import { assertCreateCollection, assertDropAndRecreateCollection, assertDropCollection, } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + ChangeStreamTest, + isChangeStreamPassthrough +} from "jstests/libs/query/change_stream_util.js"; import {TwoPhaseDropCollectionTest} from "jstests/replsets/libs/two_phase_drops.js"; const coll = assertDropAndRecreateCollection(db, "change_post_image"); diff --git a/jstests/change_streams/lookup_pre_image.js b/jstests/change_streams/lookup_pre_image.js index f6577c6b67c..31f4af24436 100644 --- a/jstests/change_streams/lookup_pre_image.js +++ b/jstests/change_streams/lookup_pre_image.js @@ -7,11 +7,14 @@ * uses_multiple_connections, * ] */ -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; const coll = assertDropAndRecreateCollection(db, "change_stream_pre_images"); const cst = new ChangeStreamTest(db); diff --git a/jstests/change_streams/metadata_notifications.js b/jstests/change_streams/metadata_notifications.js index 75bf56e765c..b2b01eb18cb 100644 --- a/jstests/change_streams/metadata_notifications.js +++ b/jstests/change_streams/metadata_notifications.js @@ -5,13 +5,13 @@ // do_not_run_in_whole_cluster_passthrough, // requires_fcv_63, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertCreateCollection, assertDropAndRecreateCollection, assertDropCollection, } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const testDb = db.getSiblingDB(jsTestName()); let cst = new ChangeStreamTest(testDb); diff --git a/jstests/change_streams/migrate_last_chunk_from_shard_event.js b/jstests/change_streams/migrate_last_chunk_from_shard_event.js index 503abb68b18..473922365f9 100644 --- a/jstests/change_streams/migrate_last_chunk_from_shard_event.js +++ b/jstests/change_streams/migrate_last_chunk_from_shard_event.js @@ -11,8 +11,11 @@ * ] */ -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = jsTestName(); diff --git a/jstests/change_streams/no_regex_leak.js b/jstests/change_streams/no_regex_leak.js index 6a976dae080..d6b71804dde 100644 --- a/jstests/change_streams/no_regex_leak.js +++ b/jstests/change_streams/no_regex_leak.js @@ -2,8 +2,8 @@ * This test makes sure that regex control characters in the namespace of changestream targets don't * affect what documents appear in a changestream, in response to SERVER-41164. */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; function test_no_leak(dbNameUnrelated, collNameUnrelated, dbNameProblematic, collNameProblematic) { const dbUnrelated = db.getSiblingDB(dbNameUnrelated); diff --git a/jstests/change_streams/oplog_rewrite/change_stream_basic_match_pushdown_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_basic_match_pushdown_rewrite.js index e8a4e01e790..b414af33ba7 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_basic_match_pushdown_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_basic_match_pushdown_rewrite.js @@ -9,13 +9,13 @@ // assumes_unsharded_collection, // assumes_read_preference_unchanged // ] +import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import { assertNumChangeStreamDocsReturnedFromShard, assertNumMatchingOplogEventsForShard, createShardedCollection, getExecutionStatsForShard, -} from "jstests/libs/change_stream_rewrite_util.js"; -import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_and_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_documentKey_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_documentKey_rewrite.js index b7ece44229f..a5d28147476 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_documentKey_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_documentKey_rewrite.js @@ -10,11 +10,11 @@ // assumes_unsharded_collection, // assumes_read_preference_unchanged // ] +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_documentKey_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocumentBeforeChange_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocumentBeforeChange_rewrite.js index 3b06310966d..44b7820cfa1 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocumentBeforeChange_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocumentBeforeChange_rewrite.js @@ -14,7 +14,7 @@ import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_fullDocumentBeforeChange_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocument_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocument_rewrite.js index f506381160f..6bcfe6f9f85 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocument_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_fullDocument_rewrite.js @@ -13,7 +13,7 @@ import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_fullDocument_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_namespace_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_namespace_rewrite.js index 5d2cc0cd441..72182c0c064 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_namespace_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_namespace_rewrite.js @@ -9,11 +9,11 @@ // assumes_unsharded_collection, // assumes_read_preference_unchanged // ] +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_and_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_operation_type_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_operation_type_rewrite.js index 91090059c88..ed417ea87fc 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_operation_type_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_operation_type_rewrite.js @@ -13,7 +13,7 @@ import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_and_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_to_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_to_rewrite.js index 79bffa58d47..2c30166df95 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_to_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_to_rewrite.js @@ -9,11 +9,11 @@ // assumes_unsharded_collection, // assumes_read_preference_unchanged // ] +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_and_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_updateDescription_rewrite.js b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_updateDescription_rewrite.js index 7a4df67f35f..4fe2abec2f1 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_updateDescription_rewrite.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_match_pushdown_updateDescription_rewrite.js @@ -13,7 +13,7 @@ import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_updateDescription_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/change_stream_null_existence_eq_rewrite_test.js b/jstests/change_streams/oplog_rewrite/change_stream_null_existence_eq_rewrite_test.js index 3ecb3c3afce..89d5073b8ce 100644 --- a/jstests/change_streams/oplog_rewrite/change_stream_null_existence_eq_rewrite_test.js +++ b/jstests/change_streams/oplog_rewrite/change_stream_null_existence_eq_rewrite_test.js @@ -11,7 +11,7 @@ import { generateChangeStreamWriteWorkload, getAllChangeStreamEvents, isPlainObject -} from "jstests/libs/change_stream_rewrite_util.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; const dbName = jsTestName(); const collName = "coll1"; diff --git a/jstests/change_streams/oplog_rewrite/match_pushdown_namespace_rewrite_with_expanded_events.js b/jstests/change_streams/oplog_rewrite/match_pushdown_namespace_rewrite_with_expanded_events.js index 5b736d44c24..c79acd69753 100644 --- a/jstests/change_streams/oplog_rewrite/match_pushdown_namespace_rewrite_with_expanded_events.js +++ b/jstests/change_streams/oplog_rewrite/match_pushdown_namespace_rewrite_with_expanded_events.js @@ -11,11 +11,11 @@ // assumes_unsharded_collection, // assumes_read_preference_unchanged // ] +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { createShardedCollection, verifyChangeStreamOnWholeCluster -} from "jstests/libs/change_stream_rewrite_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "change_stream_match_pushdown_and_rewrite"; diff --git a/jstests/change_streams/oplog_rewrite/projection_changes_type.js b/jstests/change_streams/oplog_rewrite/projection_changes_type.js index cb9b8cae081..686f478a287 100644 --- a/jstests/change_streams/oplog_rewrite/projection_changes_type.js +++ b/jstests/change_streams/oplog_rewrite/projection_changes_type.js @@ -7,7 +7,7 @@ import { generateChangeStreamWriteWorkload, getAllChangeStreamEvents, isPlainObject -} from "jstests/libs/change_stream_rewrite_util.js"; +} from "jstests/libs/query/change_stream_rewrite_util.js"; const dbName = jsTestName(); const collName = "coll1"; diff --git a/jstests/change_streams/pipeline_style_updates.js b/jstests/change_streams/pipeline_style_updates.js index 034b072c4a7..4fdf5676976 100644 --- a/jstests/change_streams/pipeline_style_updates.js +++ b/jstests/change_streams/pipeline_style_updates.js @@ -5,8 +5,8 @@ * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; assertDropAndRecreateCollection(db, "t1"); diff --git a/jstests/change_streams/pipeline_style_updates_v2_oplog_entries.js b/jstests/change_streams/pipeline_style_updates_v2_oplog_entries.js index 9bfce90f8a2..a712caeef26 100644 --- a/jstests/change_streams/pipeline_style_updates_v2_oplog_entries.js +++ b/jstests/change_streams/pipeline_style_updates_v2_oplog_entries.js @@ -5,8 +5,8 @@ * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; // Drop and recreate the collections to be used in this set of tests. assertDropAndRecreateCollection(db, "t1"); diff --git a/jstests/change_streams/queryable_encryption_change_stream.js b/jstests/change_streams/queryable_encryption_change_stream.js index ffbc234d4c4..1ee9fd4da94 100644 --- a/jstests/change_streams/queryable_encryption_change_stream.js +++ b/jstests/change_streams/queryable_encryption_change_stream.js @@ -8,7 +8,10 @@ // ] // import {EncryptedClient, isEnterpriseShell} from "jstests/fle2/libs/encrypted_client_util.js"; -import {canonicalizeEventForTesting, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import { + canonicalizeEventForTesting, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; if (!isEnterpriseShell()) { jsTestLog("Skipping test as it requires the enterprise module"); diff --git a/jstests/change_streams/refine_collection_shard_key_event.js b/jstests/change_streams/refine_collection_shard_key_event.js index c2e06fe2038..eb6f4004ea1 100644 --- a/jstests/change_streams/refine_collection_shard_key_event.js +++ b/jstests/change_streams/refine_collection_shard_key_event.js @@ -14,7 +14,10 @@ TestData.skipCheckShardFilteringMetadata = true; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; var st = new ShardingTest({ diff --git a/jstests/change_streams/reshard_collection_event.js b/jstests/change_streams/reshard_collection_event.js index eca57d9e5b5..4b13bb79b31 100644 --- a/jstests/change_streams/reshard_collection_event.js +++ b/jstests/change_streams/reshard_collection_event.js @@ -10,8 +10,11 @@ * ] */ -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; var st = new ShardingTest({ diff --git a/jstests/change_streams/resume_expanded_events.js b/jstests/change_streams/resume_expanded_events.js index ad8ce274313..7e5eea8e3da 100644 --- a/jstests/change_streams/resume_expanded_events.js +++ b/jstests/change_streams/resume_expanded_events.js @@ -14,7 +14,7 @@ * exclude_when_record_ids_replicated * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); const collName = "coll1"; diff --git a/jstests/change_streams/resume_from_high_water_mark_token.js b/jstests/change_streams/resume_from_high_water_mark_token.js index 5f055fefc7e..0116bba9849 100644 --- a/jstests/change_streams/resume_from_high_water_mark_token.js +++ b/jstests/change_streams/resume_from_high_water_mark_token.js @@ -1,11 +1,11 @@ /** * Tests that a synthetic high-water-mark (HWM) token obeys the same semantics as a regular token. */ -import {runCommandChangeStreamPassthroughAware} from "jstests/libs/change_stream_util.js"; import { assertCreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; +import {runCommandChangeStreamPassthroughAware} from "jstests/libs/query/change_stream_util.js"; // Drop the test collections to assure a clean run. const collName = jsTestName(); diff --git a/jstests/change_streams/shard_collection_event.js b/jstests/change_streams/shard_collection_event.js index 4c4e6fe19a7..def534b82f0 100644 --- a/jstests/change_streams/shard_collection_event.js +++ b/jstests/change_streams/shard_collection_event.js @@ -11,11 +11,14 @@ * ] */ -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; jsTestLog("creating sharding test"); diff --git a/jstests/change_streams/shell_helper.js b/jstests/change_streams/shell_helper.js index 0d4512ba765..6f55e1dc2be 100644 --- a/jstests/change_streams/shell_helper.js +++ b/jstests/change_streams/shell_helper.js @@ -6,12 +6,15 @@ // the oplog entry. When operations get bundled into a transaction, their operationTime is instead // based on the commit oplog entry, which would cause this test to fail. // @tags: [change_stream_does_not_expect_txns] -import {assertChangeStreamEventEq, assertInvalidateOp} from "jstests/libs/change_stream_util.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + assertChangeStreamEventEq, + assertInvalidateOp +} from "jstests/libs/query/change_stream_util.js"; const coll = assertDropAndRecreateCollection(db, "change_stream_shell_helper"); diff --git a/jstests/change_streams/show_expanded_events.js b/jstests/change_streams/show_expanded_events.js index 99d1a4db027..da460115aaa 100644 --- a/jstests/change_streams/show_expanded_events.js +++ b/jstests/change_streams/show_expanded_events.js @@ -11,12 +11,15 @@ * exclude_when_record_ids_replicated * ] */ -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertCreateCollection, assertDropAndRecreateCollection, assertDropCollection, } from "jstests/libs/collection_drop_recreate.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/show_raw_update_description.js b/jstests/change_streams/show_raw_update_description.js index 36d954d7bd8..5a4bd66fbde 100644 --- a/jstests/change_streams/show_raw_update_description.js +++ b/jstests/change_streams/show_raw_update_description.js @@ -9,8 +9,8 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; // Drop and recreate the collections to be used in this set of tests. assertDropAndRecreateCollection(db, "t1"); diff --git a/jstests/change_streams/show_resharding_system_events.js b/jstests/change_streams/show_resharding_system_events.js index 1255d09a7c9..8d14c45cdff 100644 --- a/jstests/change_streams/show_resharding_system_events.js +++ b/jstests/change_streams/show_resharding_system_events.js @@ -11,8 +11,8 @@ * assumes_read_preference_unchanged, * ] */ -import {assertChangeStreamEventEq} from "jstests/libs/change_stream_util.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {assertChangeStreamEventEq} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Create a single-shard cluster for this test. diff --git a/jstests/change_streams/show_system_events.js b/jstests/change_streams/show_system_events.js index 86a8886c17c..b2c1e40a1ca 100644 --- a/jstests/change_streams/show_system_events.js +++ b/jstests/change_streams/show_system_events.js @@ -9,8 +9,8 @@ * assumes_no_implicit_index_creation * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/timeseries.js b/jstests/change_streams/timeseries.js index 02666df4c22..0e48574d934 100644 --- a/jstests/change_streams/timeseries.js +++ b/jstests/change_streams/timeseries.js @@ -8,8 +8,8 @@ * ] */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; let testDB = db.getSiblingDB(jsTestName()); testDB.dropDatabase(); diff --git a/jstests/change_streams/whole_cluster.js b/jstests/change_streams/whole_cluster.js index 8ba54733193..6d5c63ba6a9 100644 --- a/jstests/change_streams/whole_cluster.js +++ b/jstests/change_streams/whole_cluster.js @@ -1,11 +1,11 @@ // Basic tests for $changeStream against all databases in the cluster. +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { assertInvalidChangeStreamNss, assertValidChangeStreamNss, ChangeStreamTest -} from "jstests/libs/change_stream_util.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/change_stream_util.js"; const testDb = db.getSiblingDB(jsTestName()); const adminDB = testDb.getSiblingDB("admin"); diff --git a/jstests/change_streams/whole_cluster_metadata_notifications.js b/jstests/change_streams/whole_cluster_metadata_notifications.js index e5520f8e6dd..ea80204041b 100644 --- a/jstests/change_streams/whole_cluster_metadata_notifications.js +++ b/jstests/change_streams/whole_cluster_metadata_notifications.js @@ -3,12 +3,12 @@ // collections will live on different shards. Majority read concern cannot be off with multi-shard // transactions, which is why this test needs the tag below. // @tags: [requires_majority_read_concern] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {TwoPhaseDropCollectionTest} from "jstests/replsets/libs/two_phase_drops.js"; // Define two databases. We will conduct our tests by creating one collection in each. diff --git a/jstests/change_streams/whole_cluster_resumability.js b/jstests/change_streams/whole_cluster_resumability.js index 57bb1a53085..4ae9f2d8eaf 100644 --- a/jstests/change_streams/whole_cluster_resumability.js +++ b/jstests/change_streams/whole_cluster_resumability.js @@ -1,10 +1,10 @@ // Basic tests for resuming a $changeStream that is open against all databases in a cluster. -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; // Create two databases, with one collection in each. const testDBs = [db.getSiblingDB(jsTestName()), db.getSiblingDB(jsTestName() + "_other")]; diff --git a/jstests/change_streams/whole_db.js b/jstests/change_streams/whole_db.js index 665115ee8b9..85880832ad7 100644 --- a/jstests/change_streams/whole_db.js +++ b/jstests/change_streams/whole_db.js @@ -2,9 +2,12 @@ // Do not run in whole-cluster passthrough since this test assumes that the change stream will be // invalidated by a database drop. // @tags: [do_not_run_in_whole_cluster_passthrough] -import {assertInvalidChangeStreamNss, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + assertInvalidChangeStreamNss, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; const testDb = db.getSiblingDB(jsTestName()); assert.commandWorked(testDb.dropDatabase()); diff --git a/jstests/change_streams/whole_db_metadata_notifications.js b/jstests/change_streams/whole_db_metadata_notifications.js index 3dd1ff68fad..c7c36c664e1 100644 --- a/jstests/change_streams/whole_db_metadata_notifications.js +++ b/jstests/change_streams/whole_db_metadata_notifications.js @@ -2,13 +2,13 @@ // Do not run in whole-cluster passthrough since this test assumes that the change stream will be // invalidated by a database drop. // @tags: [do_not_run_in_whole_cluster_passthrough] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertCreateCollection, assertDropAndRecreateCollection, assertDropCollection, } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {TwoPhaseDropCollectionTest} from "jstests/replsets/libs/two_phase_drops.js"; const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/change_streams/whole_db_resumability.js b/jstests/change_streams/whole_db_resumability.js index 1716233ca36..c35d2784d8a 100644 --- a/jstests/change_streams/whole_db_resumability.js +++ b/jstests/change_streams/whole_db_resumability.js @@ -2,12 +2,12 @@ // Do not run in whole-cluster passthrough since this test assumes that the change stream will be // invalidated by a database drop. // @tags: [do_not_run_in_whole_cluster_passthrough] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; // Drop and recreate the collections to be used in this set of tests. const testDB = db.getSiblingDB(jsTestName()); diff --git a/jstests/concurrency/fsm_workloads/batched_multi_deletes_with_write_conflicts.js b/jstests/concurrency/fsm_workloads/batched_multi_deletes_with_write_conflicts.js index 2f9c7e63206..2be9b729d72 100644 --- a/jstests/concurrency/fsm_workloads/batched_multi_deletes_with_write_conflicts.js +++ b/jstests/concurrency/fsm_workloads/batched_multi_deletes_with_write_conflicts.js @@ -10,7 +10,7 @@ * requires_fcv_61, * ] */ -import {checkNWouldDelete, getPlanStage, getPlanStages} from "jstests/libs/analyze_plan.js"; +import {checkNWouldDelete, getPlanStage, getPlanStages} from "jstests/libs/query/analyze_plan.js"; export const $config = (function() { // 'data' is passed (copied) to each of the worker threads. diff --git a/jstests/concurrency/fsm_workloads/query/explain/explain.js b/jstests/concurrency/fsm_workloads/query/explain/explain.js index 67ce8eedc99..3980257d007 100644 --- a/jstests/concurrency/fsm_workloads/query/explain/explain.js +++ b/jstests/concurrency/fsm_workloads/query/explain/explain.js @@ -5,7 +5,7 @@ * */ import {isMongod} from "jstests/concurrency/fsm_workload_helpers/server_types.js"; -import {getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan} from "jstests/libs/query/analyze_plan.js"; export const $config = (function() { var data = { diff --git a/jstests/concurrency/fsm_workloads/query/explain/explain_count.js b/jstests/concurrency/fsm_workloads/query/explain/explain_count.js index 4d8e487315e..f69dfaea670 100644 --- a/jstests/concurrency/fsm_workloads/query/explain/explain_count.js +++ b/jstests/concurrency/fsm_workloads/query/explain/explain_count.js @@ -6,7 +6,7 @@ import {extendWorkload} from "jstests/concurrency/fsm_libs/extend_workload.js"; import {isMongos} from "jstests/concurrency/fsm_workload_helpers/server_types.js"; import {$config as $baseConfig} from "jstests/concurrency/fsm_workloads/query/explain/explain.js"; -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; export const $config = extendWorkload($baseConfig, function($config, $super) { function assertNCounted(num, obj, db) { diff --git a/jstests/concurrency/fsm_workloads/query/explain/explain_distinct.js b/jstests/concurrency/fsm_workloads/query/explain/explain_distinct.js index 3f2ed10fa12..262ca273762 100644 --- a/jstests/concurrency/fsm_workloads/query/explain/explain_distinct.js +++ b/jstests/concurrency/fsm_workloads/query/explain/explain_distinct.js @@ -5,7 +5,7 @@ */ import {extendWorkload} from "jstests/concurrency/fsm_libs/extend_workload.js"; import {$config as $baseConfig} from "jstests/concurrency/fsm_workloads/query/explain/explain.js"; -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; export const $config = extendWorkload($baseConfig, function($config, $super) { $config.states = Object.extend({ diff --git a/jstests/concurrency/fsm_workloads/query/explain/explain_find.js b/jstests/concurrency/fsm_workloads/query/explain/explain_find.js index 98d9bf4b644..49a51522698 100644 --- a/jstests/concurrency/fsm_workloads/query/explain/explain_find.js +++ b/jstests/concurrency/fsm_workloads/query/explain/explain_find.js @@ -6,7 +6,7 @@ */ import {extendWorkload} from "jstests/concurrency/fsm_libs/extend_workload.js"; import {$config as $baseConfig} from "jstests/concurrency/fsm_workloads/query/explain/explain.js"; -import {isIxscan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {isIxscan, planHasStage} from "jstests/libs/query/analyze_plan.js"; export const $config = extendWorkload($baseConfig, function($config, $super) { $config.states = Object.extend({ diff --git a/jstests/concurrency/fsm_workloads/random_moveChunk/random_moveChunk_timeseries_inserts.js b/jstests/concurrency/fsm_workloads/random_moveChunk/random_moveChunk_timeseries_inserts.js index 9ed3dfc8512..ff85c9a6dea 100644 --- a/jstests/concurrency/fsm_workloads/random_moveChunk/random_moveChunk_timeseries_inserts.js +++ b/jstests/concurrency/fsm_workloads/random_moveChunk/random_moveChunk_timeseries_inserts.js @@ -17,8 +17,8 @@ import { $config as $baseConfig } from 'jstests/concurrency/fsm_workloads/sharded_partitioned/sharded_moveChunk_partitioned.js'; import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getPlanStages} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; import {findChunksUtil} from "jstests/sharding/libs/find_chunks_util.js"; export const $config = extendWorkload($baseConfig, function($config, $super) { diff --git a/jstests/core/administrative/profile/profile_getmore.js b/jstests/core/administrative/profile/profile_getmore.js index c1d74dc7a27..2be54fb6cda 100644 --- a/jstests/core/administrative/profile/profile_getmore.js +++ b/jstests/core/administrative/profile/profile_getmore.js @@ -9,9 +9,9 @@ // requires_profiling, // ] -import {getPlanCacheShapeHashFromObject} from "jstests/libs/analyze_plan.js"; import {isLinux} from "jstests/libs/os_helpers.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +import {getPlanCacheShapeHashFromObject} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB("profile_getmore"); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/core/administrative/profile/profile_query_hash.js b/jstests/core/administrative/profile/profile_query_hash.js index a33e44dbb5c..0df9f6487b0 100644 --- a/jstests/core/administrative/profile/profile_query_hash.js +++ b/jstests/core/administrative/profile/profile_query_hash.js @@ -9,8 +9,8 @@ // requires_profiling, // ] -import {getPlanCacheShapeHashFromExplain} from "jstests/libs/analyze_plan.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +import {getPlanCacheShapeHashFromExplain} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB("plan_cache_shape_hash"); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/core/clustered/clustered_collection_collation.js b/jstests/core/clustered/clustered_collection_collation.js index 853987d7620..952903230ef 100644 --- a/jstests/core/clustered/clustered_collection_collation.js +++ b/jstests/core/clustered/clustered_collection_collation.js @@ -10,11 +10,11 @@ * ] */ -import {getQueryPlanner, getWinningPlan} from "jstests/libs/analyze_plan.js"; import { validateClusteredCollectionHint } from "jstests/libs/clustered_collections/clustered_collection_hint_common.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {getQueryPlanner, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const collatedName = 'clustered_collection_with_collation'; const collated = db[collatedName]; diff --git a/jstests/core/index/bindata_indexonly.js b/jstests/core/index/bindata_indexonly.js index a48d799c23b..f69db374d99 100644 --- a/jstests/core/index/bindata_indexonly.js +++ b/jstests/core/index/bindata_indexonly.js @@ -6,7 +6,7 @@ * assumes_read_concern_local, * ] */ -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.jstests_bindata_indexonly; diff --git a/jstests/core/index/covered/coveredIndex1.js b/jstests/core/index/covered/coveredIndex1.js index 30934a29453..76a8e38cf8e 100644 --- a/jstests/core/index/covered/coveredIndex1.js +++ b/jstests/core/index/covered/coveredIndex1.js @@ -12,7 +12,7 @@ * ] */ // Include helpers for analyzing explain output. -import {getWinningPlan, isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const coll = db["jstests_coveredIndex1"]; coll.drop(); diff --git a/jstests/core/index/covered/coveredIndex2.js b/jstests/core/index/covered/coveredIndex2.js index e3fb2a59360..a24c4a5518c 100644 --- a/jstests/core/index/covered/coveredIndex2.js +++ b/jstests/core/index/covered/coveredIndex2.js @@ -9,7 +9,7 @@ // assumes_no_implicit_index_creation, // ] // Include helpers for analyzing explain output. -import {getWinningPlan, isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const t = db["jstests_coveredIndex2"]; t.drop(); diff --git a/jstests/core/index/covered/covered_index_compound_1.js b/jstests/core/index/covered/covered_index_compound_1.js index e98d56b4cbd..3d6b0971216 100644 --- a/jstests/core/index/covered/covered_index_compound_1.js +++ b/jstests/core/index/covered/covered_index_compound_1.js @@ -8,7 +8,7 @@ // Compound index covered query tests // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_compound_1"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_negative_1.js b/jstests/core/index/covered/covered_index_negative_1.js index 826fa19e37a..59f612bf045 100644 --- a/jstests/core/index/covered/covered_index_negative_1.js +++ b/jstests/core/index/covered/covered_index_negative_1.js @@ -8,7 +8,7 @@ // assumes_balancer_off, // does_not_support_stepdowns, // ] -import {getWinningPlan, isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const coll = db.covered_negative_1; coll.drop(); diff --git a/jstests/core/index/covered/covered_index_simple_1.js b/jstests/core/index/covered/covered_index_simple_1.js index c673d92de50..6cad42e6cd7 100644 --- a/jstests/core/index/covered/covered_index_simple_1.js +++ b/jstests/core/index/covered/covered_index_simple_1.js @@ -8,7 +8,7 @@ // Simple covered index query test // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_simple_1"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_simple_2.js b/jstests/core/index/covered/covered_index_simple_2.js index d2e48f3c88a..244675ec7bc 100644 --- a/jstests/core/index/covered/covered_index_simple_2.js +++ b/jstests/core/index/covered/covered_index_simple_2.js @@ -8,7 +8,7 @@ // Simple covered index query test with unique index // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_simple_2"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_simple_3.js b/jstests/core/index/covered/covered_index_simple_3.js index bc07e87f5a5..11dad8e420a 100644 --- a/jstests/core/index/covered/covered_index_simple_3.js +++ b/jstests/core/index/covered/covered_index_simple_3.js @@ -8,7 +8,7 @@ // Simple covered index query test with a unique sparse index // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_simple_3"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_simple_id.js b/jstests/core/index/covered/covered_index_simple_id.js index 3651a83063d..44b2fa4fa2c 100644 --- a/jstests/core/index/covered/covered_index_simple_id.js +++ b/jstests/core/index/covered/covered_index_simple_id.js @@ -5,7 +5,7 @@ // Simple covered index query test // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_simple_id"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_sort_1.js b/jstests/core/index/covered/covered_index_sort_1.js index e08e9061df6..d8a22df44dd 100644 --- a/jstests/core/index/covered/covered_index_sort_1.js +++ b/jstests/core/index/covered/covered_index_sort_1.js @@ -8,7 +8,7 @@ // Simple covered index query test with sort // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_sort_1"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_sort_2.js b/jstests/core/index/covered/covered_index_sort_2.js index a2acff2ec5c..2da708ef743 100644 --- a/jstests/core/index/covered/covered_index_sort_2.js +++ b/jstests/core/index/covered/covered_index_sort_2.js @@ -5,7 +5,7 @@ // ] // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_sort_2"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_sort_3.js b/jstests/core/index/covered/covered_index_sort_3.js index 10661031625..23e87550b6a 100644 --- a/jstests/core/index/covered/covered_index_sort_3.js +++ b/jstests/core/index/covered/covered_index_sort_3.js @@ -8,7 +8,7 @@ // Compound index covered query tests with sort // Include helpers for analyzing explain output. -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("covered_sort_3"); coll.drop(); diff --git a/jstests/core/index/covered/covered_index_sort_no_fetch_optimization.js b/jstests/core/index/covered/covered_index_sort_no_fetch_optimization.js index 4146eda85bd..06801a7658a 100644 --- a/jstests/core/index/covered/covered_index_sort_no_fetch_optimization.js +++ b/jstests/core/index/covered/covered_index_sort_no_fetch_optimization.js @@ -9,8 +9,8 @@ * assumes_unsharded_collection, * ] */ -import {getWinningPlan, isIndexOnly, planHasStage} from "jstests/libs/analyze_plan.js"; import {exhaustFindCursorAndReturnResults} from "jstests/libs/find_cmd_util.js"; +import {getWinningPlan, isIndexOnly, planHasStage} from "jstests/libs/query/analyze_plan.js"; const collName = "covered_index_sort_no_fetch_optimization"; const coll = db.getCollection(collName); diff --git a/jstests/core/index/elemmatch_index.js b/jstests/core/index/elemmatch_index.js index 7caaaf8e3a0..a83d55fcf9d 100644 --- a/jstests/core/index/elemmatch_index.js +++ b/jstests/core/index/elemmatch_index.js @@ -6,7 +6,7 @@ * assumes_read_concern_local, * ] */ -import {getWinningPlan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const coll = db.elemMatch_index; coll.drop(); diff --git a/jstests/core/index/express.js b/jstests/core/index/express.js index 95caf316add..1faa9638989 100644 --- a/jstests/core/index/express.js +++ b/jstests/core/index/express.js @@ -20,16 +20,16 @@ */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; +import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getPlanStage, getQueryPlanner, getWinningPlan, isExpress -} from "jstests/libs/analyze_plan.js"; -import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {runWithParamsAllNodes} from "jstests/libs/optimizer_utils.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {runWithParamsAllNodes} from "jstests/libs/query/optimizer_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const coll = db.getCollection('express_coll'); diff --git a/jstests/core/index/express_id_eq.js b/jstests/core/index/express_id_eq.js index a29440e7286..cff1607a969 100644 --- a/jstests/core/index/express_id_eq.js +++ b/jstests/core/index/express_id_eq.js @@ -14,10 +14,10 @@ */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {isExpress, isIdhack, isIdhackOrExpress} from "jstests/libs/analyze_plan.js"; import { ClusteredCollectionUtil } from "jstests/libs/clustered_collections/clustered_collection_util.js"; +import {isExpress, isIdhack, isIdhackOrExpress} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB("express_id_eq"); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/core/index/express_write.js b/jstests/core/index/express_write.js index 5c60b448b03..4bbe83e6ca2 100644 --- a/jstests/core/index/express_write.js +++ b/jstests/core/index/express_write.js @@ -10,7 +10,7 @@ */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {isExpress} from "jstests/libs/analyze_plan.js"; +import {isExpress} from "jstests/libs/query/analyze_plan.js"; const collName = 'express_write_coll'; const coll = db.getCollection(collName); diff --git a/jstests/core/index/express_write_explicit_coll_creation.js b/jstests/core/index/express_write_explicit_coll_creation.js index 5cc7aa4b262..734fbd8d62d 100644 --- a/jstests/core/index/express_write_explicit_coll_creation.js +++ b/jstests/core/index/express_write_explicit_coll_creation.js @@ -12,8 +12,8 @@ */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {isExpress} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {isExpress} from "jstests/libs/query/analyze_plan.js"; const collName = 'express_write_explicit_coll_creation'; const coll = db.getCollection(collName); diff --git a/jstests/core/index/fts/fts_projection.js b/jstests/core/index/fts/fts_projection.js index 67e69179e85..de75974b095 100644 --- a/jstests/core/index/fts/fts_projection.js +++ b/jstests/core/index/fts/fts_projection.js @@ -3,7 +3,7 @@ // assumes_read_concern_local, // ] -import {getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; var t = db.getSiblingDB("test").getCollection("fts_projection"); t.drop(); diff --git a/jstests/core/index/geo/geo_2d_explain.js b/jstests/core/index/geo/geo_2d_explain.js index 22a1b3a2f06..fca85c4934f 100644 --- a/jstests/core/index/geo/geo_2d_explain.js +++ b/jstests/core/index/geo/geo_2d_explain.js @@ -1,7 +1,7 @@ // @tags: [ // assumes_balancer_off, // ] -import {getExecutionStats, getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getExecutionStats, getPlanStages} from "jstests/libs/query/analyze_plan.js"; var t = db.geo_2d_explain; diff --git a/jstests/core/index/geo/geo_center_sphere2.js b/jstests/core/index/geo/geo_center_sphere2.js index c3d763e3b91..f5e903f820a 100644 --- a/jstests/core/index/geo/geo_center_sphere2.js +++ b/jstests/core/index/geo/geo_center_sphere2.js @@ -9,7 +9,7 @@ // multiple documents, and so requires simultaneous testing. // -import {deg2rad, rad2deg} from "jstests/libs/geo_math.js"; +import {deg2rad, rad2deg} from "jstests/libs/query/geo_math.js"; function computexscandist(y, maxDistDegrees) { return maxDistDegrees / diff --git a/jstests/core/index/geo/geo_max.js b/jstests/core/index/geo/geo_max.js index 2d2b9ac61c6..6ebf3737f3c 100644 --- a/jstests/core/index/geo/geo_max.js +++ b/jstests/core/index/geo/geo_max.js @@ -5,7 +5,7 @@ // assumes_read_concern_local, // ] -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; var test = new GeoNearRandomTest("geo_near_max"); diff --git a/jstests/core/index/geo/geo_mindistance.js b/jstests/core/index/geo/geo_mindistance.js index 2fcdf05ff20..8d030431ae3 100644 --- a/jstests/core/index/geo/geo_mindistance.js +++ b/jstests/core/index/geo/geo_mindistance.js @@ -4,7 +4,7 @@ // requires_getmore, // ] -import {deg2rad, metersToRadians} from "jstests/libs/geo_math.js"; +import {deg2rad, metersToRadians} from "jstests/libs/query/geo_math.js"; var t = db.geo_mindistance; t.drop(); diff --git a/jstests/core/index/geo/geo_near_bounds_overflow.js b/jstests/core/index/geo/geo_near_bounds_overflow.js index e0d58188123..0fe545f05cd 100644 --- a/jstests/core/index/geo/geo_near_bounds_overflow.js +++ b/jstests/core/index/geo/geo_near_bounds_overflow.js @@ -1,5 +1,5 @@ // Tests behavior with invalid 2d bounds. -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; const test = new GeoNearRandomTest('geo_near_bounds_overflow'); diff --git a/jstests/core/index/geo/geo_near_random1.js b/jstests/core/index/geo/geo_near_random1.js index c31466d6d91..fd487afb7b4 100644 --- a/jstests/core/index/geo/geo_near_random1.js +++ b/jstests/core/index/geo/geo_near_random1.js @@ -6,7 +6,7 @@ * requires_getmore, * ] */ -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; var test = new GeoNearRandomTest("geo_near_random1"); diff --git a/jstests/core/index/geo/geo_near_random2.js b/jstests/core/index/geo/geo_near_random2.js index aae8e3f73fc..bcd84ea1a9d 100644 --- a/jstests/core/index/geo/geo_near_random2.js +++ b/jstests/core/index/geo/geo_near_random2.js @@ -7,7 +7,7 @@ * ] */ -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; var test = new GeoNearRandomTest("geo_near_random2"); diff --git a/jstests/core/index/geo/geo_s2explain.js b/jstests/core/index/geo/geo_s2explain.js index 4c51a6bc457..d3d5f8f6ca1 100644 --- a/jstests/core/index/geo/geo_s2explain.js +++ b/jstests/core/index/geo/geo_s2explain.js @@ -1,7 +1,7 @@ // Test to check whether the number of intervals in a geoNear query equals // the number of inputStages it completes -import {getExecutionStages} from "jstests/libs/analyze_plan.js"; +import {getExecutionStages} from "jstests/libs/query/analyze_plan.js"; var t = db.jstests_geo_s2explain; t.drop(); diff --git a/jstests/core/index/geo/geo_small_large.js b/jstests/core/index/geo/geo_small_large.js index ae6680cdd5d..c5e9cc62edf 100644 --- a/jstests/core/index/geo/geo_small_large.js +++ b/jstests/core/index/geo/geo_small_large.js @@ -8,7 +8,7 @@ * requires_getmore, * ] */ -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; // Do some random tests (for near queries) with very large and small ranges diff --git a/jstests/core/index/hashed/hashed_index_collation.js b/jstests/core/index/hashed/hashed_index_collation.js index e3aba5d61ce..7075b92640e 100644 --- a/jstests/core/index/hashed/hashed_index_collation.js +++ b/jstests/core/index/hashed/hashed_index_collation.js @@ -6,7 +6,7 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; const coll = db.hashed_index_collation; coll.drop(); diff --git a/jstests/core/index/hashed/hashed_index_covered_queries.js b/jstests/core/index/hashed/hashed_index_covered_queries.js index b5b53da75f8..675cefcd471 100644 --- a/jstests/core/index/hashed/hashed_index_covered_queries.js +++ b/jstests/core/index/hashed/hashed_index_covered_queries.js @@ -9,7 +9,7 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; const coll = db.compound_hashed_index; coll.drop(); diff --git a/jstests/core/index/hashed/hashed_index_queries.js b/jstests/core/index/hashed/hashed_index_queries.js index addb6538f75..9d35291da21 100644 --- a/jstests/core/index/hashed/hashed_index_queries.js +++ b/jstests/core/index/hashed/hashed_index_queries.js @@ -6,7 +6,7 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; const collNamePrefix = 'hashed_index_queries_'; let collCount = 0; diff --git a/jstests/core/index/hashed/hashed_index_queries_with_logical_operators.js b/jstests/core/index/hashed/hashed_index_queries_with_logical_operators.js index afcaa029c23..e80fcae8b3f 100644 --- a/jstests/core/index/hashed/hashed_index_queries_with_logical_operators.js +++ b/jstests/core/index/hashed/hashed_index_queries_with_logical_operators.js @@ -8,7 +8,7 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; const coll = db.hashed_index_queries_with_logical_operators; coll.drop(); diff --git a/jstests/core/index/hashed/hashed_index_sort.js b/jstests/core/index/hashed/hashed_index_sort.js index 9952d838679..81ebd06c955 100644 --- a/jstests/core/index/hashed/hashed_index_sort.js +++ b/jstests/core/index/hashed/hashed_index_sort.js @@ -6,7 +6,7 @@ * assumes_unsharded_collection, * ] */ -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; const coll = db.hashed_index_sort; coll.drop(); diff --git a/jstests/core/index/hidden_index.js b/jstests/core/index/hidden_index.js index 25074644961..17f5ab2c7c0 100644 --- a/jstests/core/index/hidden_index.js +++ b/jstests/core/index/hidden_index.js @@ -10,10 +10,10 @@ * ] */ -import {getNumberOfIndexScans} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import {IndexCatalogHelpers} from "jstests/libs/index_catalog_helpers.js"; +import {getNumberOfIndexScans} from "jstests/libs/query/analyze_plan.js"; const collName = "hidden_index"; let coll = assertDropAndRecreateCollection(db, collName); diff --git a/jstests/core/index/index_bounds_code.js b/jstests/core/index/index_bounds_code.js index b96fa1f7cfe..b04cbeafec5 100644 --- a/jstests/core/index/index_bounds_code.js +++ b/jstests/core/index/index_bounds_code.js @@ -3,7 +3,7 @@ // assumes_unsharded_collection, // requires_non_retryable_writes, // ] -import {assertCoveredQueryAndCount} from "jstests/libs/analyze_plan.js"; +import {assertCoveredQueryAndCount} from "jstests/libs/query/analyze_plan.js"; const coll = db.index_bounds_code; coll.drop(); diff --git a/jstests/core/index/index_bounds_maxkey.js b/jstests/core/index/index_bounds_maxkey.js index 82391be7268..ad2628a0fb0 100644 --- a/jstests/core/index/index_bounds_maxkey.js +++ b/jstests/core/index/index_bounds_maxkey.js @@ -6,7 +6,7 @@ // # unexpected plans. // assumes_no_implicit_index_creation, // ] -import {assertCoveredQueryAndCount} from "jstests/libs/analyze_plan.js"; +import {assertCoveredQueryAndCount} from "jstests/libs/query/analyze_plan.js"; const coll = db.index_bounds_maxkey; coll.drop(); diff --git a/jstests/core/index/index_bounds_minkey.js b/jstests/core/index/index_bounds_minkey.js index 56764d0a703..8efebfd49cb 100644 --- a/jstests/core/index/index_bounds_minkey.js +++ b/jstests/core/index/index_bounds_minkey.js @@ -6,7 +6,7 @@ // # unexpected plans. // assumes_no_implicit_index_creation, // ] -import {assertCoveredQueryAndCount} from "jstests/libs/analyze_plan.js"; +import {assertCoveredQueryAndCount} from "jstests/libs/query/analyze_plan.js"; const coll = db.index_bounds_minkey; coll.drop(); diff --git a/jstests/core/index/index_bounds_object.js b/jstests/core/index/index_bounds_object.js index 79b77f7308a..18bf6d7cdbc 100644 --- a/jstests/core/index/index_bounds_object.js +++ b/jstests/core/index/index_bounds_object.js @@ -7,7 +7,7 @@ import { assertCoveredQueryAndCount, getWinningPlan, isIndexOnly -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.index_bounds_object; coll.drop(); diff --git a/jstests/core/index/index_bounds_pipe.js b/jstests/core/index/index_bounds_pipe.js index 820519cec58..3a85b2fbcbb 100644 --- a/jstests/core/index/index_bounds_pipe.js +++ b/jstests/core/index/index_bounds_pipe.js @@ -6,8 +6,8 @@ * requires_fcv_80, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {exhaustFindCursorAndReturnResults} from "jstests/libs/find_cmd_util.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const collName = jsTestName(); const coll = db.getCollection(collName); diff --git a/jstests/core/index/index_bounds_timestamp.js b/jstests/core/index/index_bounds_timestamp.js index ee7f6588625..c35ae813dd4 100644 --- a/jstests/core/index/index_bounds_timestamp.js +++ b/jstests/core/index/index_bounds_timestamp.js @@ -10,7 +10,7 @@ import { getWinningPlanFromExplain, isCollscan, isIndexOnly -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; // Setup the test collection. let coll = db.index_bounds_timestamp; diff --git a/jstests/core/index/index_check2.js b/jstests/core/index/index_check2.js index d507ac82d3e..912187ae49c 100644 --- a/jstests/core/index/index_check2.js +++ b/jstests/core/index/index_check2.js @@ -7,7 +7,7 @@ let t = db.index_check2; t.drop(); // Include helpers for analyzing explain output. -import {getWinningPlan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIxscan} from "jstests/libs/query/analyze_plan.js"; for (var i = 0; i < 1000; i++) { var a = []; diff --git a/jstests/core/index/index_count_scan.js b/jstests/core/index/index_count_scan.js index 752762e1ace..7af1f6fc107 100644 --- a/jstests/core/index/index_count_scan.js +++ b/jstests/core/index/index_count_scan.js @@ -12,7 +12,7 @@ // # Explain for the aggregate command cannot run within a multi-document transaction. // does_not_support_transactions, // ] -import {getPlanStage, getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; const coll = db.index_count; coll.drop(); diff --git a/jstests/core/index/index_decimal.js b/jstests/core/index/index_decimal.js index 6f027c600e7..354097c096f 100644 --- a/jstests/core/index/index_decimal.js +++ b/jstests/core/index/index_decimal.js @@ -7,7 +7,7 @@ // Test indexing of decimal numbers // Include helpers for analyzing explain output. -import {getWinningPlanFromExplain, isCollscan, isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var t = db.decimal_indexing; t.drop(); diff --git a/jstests/core/index/index_filter_catalog_independent.js b/jstests/core/index/index_filter_catalog_independent.js index 528a90cfa8e..ce180ffbd53 100644 --- a/jstests/core/index/index_filter_catalog_independent.js +++ b/jstests/core/index/index_filter_catalog_independent.js @@ -14,14 +14,14 @@ * assumes_balancer_off, * ] */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { getPlanStages, getQueryPlanners, getWinningPlan, getWinningPlanFromExplain, isCollscan -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/analyze_plan.js"; const collName = "index_filter_catalog_independent"; const coll = db[collName]; diff --git a/jstests/core/index/index_filter_collation.js b/jstests/core/index/index_filter_collation.js index f5a49fa1cc7..c9193eea33f 100644 --- a/jstests/core/index/index_filter_collation.js +++ b/jstests/core/index/index_filter_collation.js @@ -16,7 +16,7 @@ * assumes_balancer_off, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const collName = "index_filter_collation"; const coll = db[collName]; diff --git a/jstests/core/index/index_filter_commands.js b/jstests/core/index/index_filter_commands.js index 8d5a921e7dd..a483d2a7575 100644 --- a/jstests/core/index/index_filter_commands.js +++ b/jstests/core/index/index_filter_commands.js @@ -41,6 +41,10 @@ * ] */ +import { + ClusteredCollectionUtil +} from "jstests/libs/clustered_collections/clustered_collection_util.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getPlanCacheKeyFromPipeline, getPlanCacheKeyFromShape, @@ -55,15 +59,11 @@ import { isIdhackOrExpress, isIxscan, planHasStage, -} from "jstests/libs/analyze_plan.js"; -import { - ClusteredCollectionUtil -} from "jstests/libs/clustered_collections/clustered_collection_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; import { checkSbeFullFeatureFlagEnabled, checkSbeRestrictedOrFullyEnabled -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; // Flag indicating if index filter commands are running through the query settings interface. var isIndexFiltersToQuerySettings = TestData.isIndexFiltersToQuerySettings || false; diff --git a/jstests/core/index/index_filter_commands_invalidate_plan_cache_entries.js b/jstests/core/index/index_filter_commands_invalidate_plan_cache_entries.js index 706485c3bab..301d068344e 100644 --- a/jstests/core/index/index_filter_commands_invalidate_plan_cache_entries.js +++ b/jstests/core/index/index_filter_commands_invalidate_plan_cache_entries.js @@ -20,8 +20,8 @@ * assumes_balancer_off, * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; // For testing convenience this variable is made an integer "1" if SBE is fully enabled, because the // expected amount of plan cache entries differs between the SBE plan cache and the classic one. diff --git a/jstests/core/index/index_filter_on_hidden_index.js b/jstests/core/index/index_filter_on_hidden_index.js index 06100c66cad..6d8d5e8a222 100644 --- a/jstests/core/index/index_filter_on_hidden_index.js +++ b/jstests/core/index/index_filter_on_hidden_index.js @@ -22,7 +22,7 @@ * ] */ -import {getPlanStages, getWinningPlan, isCollscan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan, isCollscan} from "jstests/libs/query/analyze_plan.js"; const collName = 'hidden_indexes_remain_visible_in_index_filters'; db[collName].drop(); diff --git a/jstests/core/index/index_multikey.js b/jstests/core/index/index_multikey.js index dd7c022f272..1626eec06dc 100644 --- a/jstests/core/index/index_multikey.js +++ b/jstests/core/index/index_multikey.js @@ -6,7 +6,7 @@ * ] */ // For making assertions about explain output. -import {getPlanStage, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.getCollection("index_multikey"); coll.drop(); diff --git a/jstests/core/index/index_partial_read_ops.js b/jstests/core/index/index_partial_read_ops.js index 5586a905949..c8ebc18aa35 100644 --- a/jstests/core/index/index_partial_read_ops.js +++ b/jstests/core/index/index_partial_read_ops.js @@ -17,7 +17,7 @@ import { getWinningPlan, isCollscan, isIxscan -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; let explain; const coll = db.index_partial_read_ops; diff --git a/jstests/core/index/index_stats.js b/jstests/core/index/index_stats.js index 9ee78c0a662..b19d36c7b50 100644 --- a/jstests/core/index/index_stats.js +++ b/jstests/core/index/index_stats.js @@ -18,8 +18,8 @@ // references_foreign_collection, // ] -import {getAggPlanStage, getPlanStages} from "jstests/libs/analyze_plan.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage, getPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; var colName = "jstests_index_stats"; var col = db[colName]; diff --git a/jstests/core/index/index_type_change.js b/jstests/core/index/index_type_change.js index 65da7b40af6..d0d3ba499bf 100644 --- a/jstests/core/index/index_type_change.js +++ b/jstests/core/index/index_type_change.js @@ -3,7 +3,7 @@ * will update the index entries associated with that document. */ -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var coll = db.index_type_change; coll.drop(); diff --git a/jstests/core/index/indexj.js b/jstests/core/index/indexj.js index 62b2bc8c7db..b6197dc2ce2 100644 --- a/jstests/core/index/indexj.js +++ b/jstests/core/index/indexj.js @@ -12,8 +12,8 @@ // requires_fcv_63, // ] -import {getPlanStages} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const t = db[jsTestName()]; t.drop(); diff --git a/jstests/core/index/partial_index_optimization.js b/jstests/core/index/partial_index_optimization.js index 0e8fa2ccd1a..a61a8371c05 100644 --- a/jstests/core/index/partial_index_optimization.js +++ b/jstests/core/index/partial_index_optimization.js @@ -19,7 +19,7 @@ import { assertStagesForExplainOfCommand, getWinningPlan, isCollscan, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; function flagVal(n) { return (n % 5 > 3) ? true : false; diff --git a/jstests/core/index/sparse_index_internal_expr.js b/jstests/core/index/sparse_index_internal_expr.js index d7ccf6a38b2..f217d3d32bc 100644 --- a/jstests/core/index/sparse_index_internal_expr.js +++ b/jstests/core/index/sparse_index_internal_expr.js @@ -9,7 +9,7 @@ * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.sparse_index_internal_expr; coll.drop(); diff --git a/jstests/core/index/wildcard/compound_wildcard_index_filter.js b/jstests/core/index/wildcard/compound_wildcard_index_filter.js index d958b753c40..c43837f4438 100644 --- a/jstests/core/index/wildcard/compound_wildcard_index_filter.js +++ b/jstests/core/index/wildcard/compound_wildcard_index_filter.js @@ -12,7 +12,7 @@ * ] */ -import {WildcardIndexHelpers} from "jstests/libs/wildcard_index_helpers.js"; +import {WildcardIndexHelpers} from "jstests/libs/query/wildcard_index_helpers.js"; /** * Utility function to find an index filter by keyPattern or index name in the given filterList. diff --git a/jstests/core/index/wildcard/compound_wildcard_index_hiding.js b/jstests/core/index/wildcard/compound_wildcard_index_hiding.js index 23d424fc58d..4828feef8e9 100644 --- a/jstests/core/index/wildcard/compound_wildcard_index_hiding.js +++ b/jstests/core/index/wildcard/compound_wildcard_index_hiding.js @@ -10,7 +10,7 @@ * ] */ -import {WildcardIndexHelpers} from "jstests/libs/wildcard_index_helpers.js"; +import {WildcardIndexHelpers} from "jstests/libs/query/wildcard_index_helpers.js"; const collectionName = "compound_wildcard_index_hiding"; const cwiList = [ diff --git a/jstests/core/index/wildcard/compound_wildcard_index_hint.js b/jstests/core/index/wildcard/compound_wildcard_index_hint.js index f35e4ae3cfe..12550590c2d 100644 --- a/jstests/core/index/wildcard/compound_wildcard_index_hint.js +++ b/jstests/core/index/wildcard/compound_wildcard_index_hint.js @@ -6,7 +6,7 @@ * ] */ -import {WildcardIndexHelpers} from "jstests/libs/wildcard_index_helpers.js"; +import {WildcardIndexHelpers} from "jstests/libs/query/wildcard_index_helpers.js"; const cwiList = [ // Note: 'wildcardProjection' cannot be specified if the wildcard field is not "$**". diff --git a/jstests/core/index/wildcard/compound_wildcard_index_or.js b/jstests/core/index/wildcard/compound_wildcard_index_or.js index d637818539c..66b011a8cd7 100644 --- a/jstests/core/index/wildcard/compound_wildcard_index_or.js +++ b/jstests/core/index/wildcard/compound_wildcard_index_or.js @@ -11,7 +11,7 @@ * ] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getQueryPlanner, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getQueryPlanner, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const documentList = [ { diff --git a/jstests/core/index/wildcard/compound_wildcard_index_prefix.js b/jstests/core/index/wildcard/compound_wildcard_index_prefix.js index 7695b91c379..00ec3f29f87 100644 --- a/jstests/core/index/wildcard/compound_wildcard_index_prefix.js +++ b/jstests/core/index/wildcard/compound_wildcard_index_prefix.js @@ -9,8 +9,8 @@ * ] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; -import {WildcardIndexHelpers} from "jstests/libs/wildcard_index_helpers.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; +import {WildcardIndexHelpers} from "jstests/libs/query/wildcard_index_helpers.js"; const coll = db.query_on_prefix_of_compound_wildcard_index; diff --git a/jstests/core/index/wildcard/compound_wildcard_index_unbounded.js b/jstests/core/index/wildcard/compound_wildcard_index_unbounded.js index 3d2c3330788..c9de70a7731 100644 --- a/jstests/core/index/wildcard/compound_wildcard_index_unbounded.js +++ b/jstests/core/index/wildcard/compound_wildcard_index_unbounded.js @@ -8,7 +8,7 @@ * assumes_read_concern_local, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.compound_wildcard_index_unbounded; coll.drop(); diff --git a/jstests/core/index/wildcard/compound_wildcard_sort.js b/jstests/core/index/wildcard/compound_wildcard_sort.js index 75fb6b67822..393379ea182 100644 --- a/jstests/core/index/wildcard/compound_wildcard_sort.js +++ b/jstests/core/index/wildcard/compound_wildcard_sort.js @@ -15,8 +15,8 @@ * ] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.compound_wildcard_sort; coll.drop(); diff --git a/jstests/core/index/wildcard/wildcard_and_text_indexes.js b/jstests/core/index/wildcard/wildcard_and_text_indexes.js index c6a01f2f4fe..641e7d31560 100644 --- a/jstests/core/index/wildcard/wildcard_and_text_indexes.js +++ b/jstests/core/index/wildcard/wildcard_and_text_indexes.js @@ -7,14 +7,14 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; +import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getPlanStages, getRejectedPlans, getWinningPlan, planHasStage -} from "jstests/libs/analyze_plan.js"; -import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; const assertArrayEq = (l, r) => assert(arrayEq(l, r), tojson(l) + " != " + tojson(r)); diff --git a/jstests/core/index/wildcard/wildcard_and_with_not.js b/jstests/core/index/wildcard/wildcard_and_with_not.js index d38b7b0700e..8dd5ff3cabb 100644 --- a/jstests/core/index/wildcard/wildcard_and_with_not.js +++ b/jstests/core/index/wildcard/wildcard_and_with_not.js @@ -15,8 +15,8 @@ * ] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const documentList = [ { diff --git a/jstests/core/index/wildcard/wildcard_index_basic_index_bounds.js b/jstests/core/index/wildcard/wildcard_index_basic_index_bounds.js index 8120e876eb4..cf1520a3954 100644 --- a/jstests/core/index/wildcard/wildcard_index_basic_index_bounds.js +++ b/jstests/core/index/wildcard/wildcard_index_basic_index_bounds.js @@ -14,13 +14,13 @@ * assumes_unsharded_collection, * ] */ +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getPlanStages, getRejectedPlan, getRejectedPlans, getWinningPlan -} from "jstests/libs/analyze_plan.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; // Asserts that the given cursors produce identical result sets. function assertResultsEq(cursor1, cursor2) { diff --git a/jstests/core/index/wildcard/wildcard_index_cached_plans.js b/jstests/core/index/wildcard/wildcard_index_cached_plans.js index a5763182413..0e6f662363b 100644 --- a/jstests/core/index/wildcard/wildcard_index_cached_plans.js +++ b/jstests/core/index/wildcard/wildcard_index_cached_plans.js @@ -22,16 +22,16 @@ * does_not_support_multiplanning_single_solutions, * ] */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getPlanCacheKeyFromExplain, getPlanCacheKeyFromShape, getPlanStage, getPlanStages, getWinningPlan, -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.wildcard_cached_plans; diff --git a/jstests/core/index/wildcard/wildcard_index_collation.js b/jstests/core/index/wildcard/wildcard_index_collation.js index 02b6b646f30..409e4a09511 100644 --- a/jstests/core/index/wildcard/wildcard_index_collation.js +++ b/jstests/core/index/wildcard/wildcard_index_collation.js @@ -13,11 +13,11 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan, isIndexOnly} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import {IndexCatalogHelpers} from "jstests/libs/index_catalog_helpers.js"; +import {getPlanStages, getWinningPlan, isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const assertArrayEq = (l, r) => assert(arrayEq(l, r)); diff --git a/jstests/core/index/wildcard/wildcard_index_count.js b/jstests/core/index/wildcard/wildcard_index_count.js index 6468c06a57f..31b33ec4d77 100644 --- a/jstests/core/index/wildcard/wildcard_index_count.js +++ b/jstests/core/index/wildcard/wildcard_index_count.js @@ -8,8 +8,8 @@ // assumes_unsharded_collection, // does_not_support_stepdowns, // ] -import {getAggPlanStage, getPlanStage, isCollscan} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getAggPlanStage, getPlanStage, isCollscan} from "jstests/libs/query/analyze_plan.js"; const coll = db.wildcard_index_count; coll.drop(); diff --git a/jstests/core/index/wildcard/wildcard_index_covered_queries.js b/jstests/core/index/wildcard/wildcard_index_covered_queries.js index 8bea6156c8c..5e176e2266b 100644 --- a/jstests/core/index/wildcard/wildcard_index_covered_queries.js +++ b/jstests/core/index/wildcard/wildcard_index_covered_queries.js @@ -12,8 +12,8 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan, isIndexOnly} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getPlanStages, getWinningPlan, isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const assertArrayEq = (l, r) => assert(arrayEq(l, r)); diff --git a/jstests/core/index/wildcard/wildcard_index_distinct_scan.js b/jstests/core/index/wildcard/wildcard_index_distinct_scan.js index 39a8d05dc94..95b42c3b05a 100644 --- a/jstests/core/index/wildcard/wildcard_index_distinct_scan.js +++ b/jstests/core/index/wildcard/wildcard_index_distinct_scan.js @@ -7,8 +7,8 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStages, getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const assertArrayEq = (l, r) => assert(arrayEq(l, r), tojson(l) + " != " + tojson(r)); diff --git a/jstests/core/index/wildcard/wildcard_index_dup_predicates.js b/jstests/core/index/wildcard/wildcard_index_dup_predicates.js index 4b39fac36bb..27567e789a7 100644 --- a/jstests/core/index/wildcard/wildcard_index_dup_predicates.js +++ b/jstests/core/index/wildcard/wildcard_index_dup_predicates.js @@ -5,8 +5,8 @@ * does_not_support_stepdowns, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.wildcard_index_dup_predicates; coll.drop(); diff --git a/jstests/core/index/wildcard/wildcard_index_filter.js b/jstests/core/index/wildcard/wildcard_index_filter.js index a8f0244c817..f0bb0a21087 100644 --- a/jstests/core/index/wildcard/wildcard_index_filter.js +++ b/jstests/core/index/wildcard/wildcard_index_filter.js @@ -14,8 +14,8 @@ * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.wildcard_index_filter; diff --git a/jstests/core/index/wildcard/wildcard_index_hint.js b/jstests/core/index/wildcard/wildcard_index_hint.js index 7d461201313..a0d3b7c46a9 100644 --- a/jstests/core/index/wildcard/wildcard_index_hint.js +++ b/jstests/core/index/wildcard/wildcard_index_hint.js @@ -6,7 +6,7 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.wildcard_hint; coll.drop(); diff --git a/jstests/core/index/wildcard/wildcard_index_multikey.js b/jstests/core/index/wildcard/wildcard_index_multikey.js index 9e9af46352f..b8c79f78397 100644 --- a/jstests/core/index/wildcard/wildcard_index_multikey.js +++ b/jstests/core/index/wildcard/wildcard_index_multikey.js @@ -7,9 +7,9 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const assertArrayEq = (l, r) => assert(arrayEq(l, r), tojson(l) + " != " + tojson(r)); diff --git a/jstests/core/index/wildcard/wildcard_index_nonblocking_sort.js b/jstests/core/index/wildcard/wildcard_index_nonblocking_sort.js index 249c3627d57..54a8d5de5cd 100644 --- a/jstests/core/index/wildcard/wildcard_index_nonblocking_sort.js +++ b/jstests/core/index/wildcard/wildcard_index_nonblocking_sort.js @@ -4,9 +4,9 @@ // does_not_support_stepdowns, // ] import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.wildcard_nonblocking_sort; coll.drop(); diff --git a/jstests/core/index/wildcard/wildcard_index_partial_index.js b/jstests/core/index/wildcard/wildcard_index_partial_index.js index c34372b3a6e..a4cf58aac84 100644 --- a/jstests/core/index/wildcard/wildcard_index_partial_index.js +++ b/jstests/core/index/wildcard/wildcard_index_partial_index.js @@ -5,8 +5,8 @@ * does_not_support_stepdowns, * ] */ -import {getWinningPlan, isCollscan, isIxscan} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getWinningPlan, isCollscan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const coll = db.wildcard_partial_index; diff --git a/jstests/core/index/wildcard/wildcard_index_projection.js b/jstests/core/index/wildcard/wildcard_index_projection.js index 2272d155a12..6236855f4a8 100644 --- a/jstests/core/index/wildcard/wildcard_index_projection.js +++ b/jstests/core/index/wildcard/wildcard_index_projection.js @@ -8,8 +8,8 @@ * ] */ -import {getQueryPlanner, getRejectedPlan, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getQueryPlanner, getRejectedPlan, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const collName = jsTestName(); const coll = db[collName]; diff --git a/jstests/core/index/wildcard/wildcard_index_type.js b/jstests/core/index/wildcard/wildcard_index_type.js index 1e4e608f2f7..a456bbedc74 100644 --- a/jstests/core/index/wildcard/wildcard_index_type.js +++ b/jstests/core/index/wildcard/wildcard_index_type.js @@ -5,8 +5,8 @@ * does_not_support_stepdowns, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.wildcard_index_type; coll.drop(); diff --git a/jstests/core/query/add_skip_stage_before_fetch.js b/jstests/core/query/add_skip_stage_before_fetch.js index 7d440fd404b..a767c4c537f 100644 --- a/jstests/core/query/add_skip_stage_before_fetch.js +++ b/jstests/core/query/add_skip_stage_before_fetch.js @@ -10,7 +10,7 @@ // does_not_support_stepdowns, // ] -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const coll = db.add_skip_stage_before_fetch; diff --git a/jstests/core/query/agg_hint.js b/jstests/core/query/agg_hint.js index 586b6bcd298..2e1e3c1d621 100644 --- a/jstests/core/query/agg_hint.js +++ b/jstests/core/query/agg_hint.js @@ -7,8 +7,8 @@ // # Explain of a resolved view must be executed by mongos. // directly_against_shardsvrs_incompatible, // ] -import {getAggPlanStages, getPlanStages} from "jstests/libs/analyze_plan.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {getAggPlanStages, getPlanStages} from "jstests/libs/query/analyze_plan.js"; const isHintsToQuerySettingsSuite = TestData.isHintsToQuerySettingsSuite || false; diff --git a/jstests/core/query/api/api_version_test_expression.js b/jstests/core/query/api/api_version_test_expression.js index 49fddefdefa..e7916ec4f5d 100644 --- a/jstests/core/query/api/api_version_test_expression.js +++ b/jstests/core/query/api/api_version_test_expression.js @@ -15,9 +15,9 @@ * ] */ -import {getExecutionStats} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getExecutionStats} from "jstests/libs/query/analyze_plan.js"; const testDb = db.getSiblingDB(jsTestName()); const collName = "api_version_test_expression"; diff --git a/jstests/core/query/api/api_version_unstable_indexes.js b/jstests/core/query/api/api_version_unstable_indexes.js index f59d12f255e..35d194c51da 100644 --- a/jstests/core/query/api/api_version_unstable_indexes.js +++ b/jstests/core/query/api/api_version_unstable_indexes.js @@ -10,8 +10,8 @@ * ] */ -import {getQueryPlanner, getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getQueryPlanner, getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const testDb = db.getSiblingDB(jsTestName()); const collName = "api_verision_unstable_indexes"; diff --git a/jstests/core/query/bittest.js b/jstests/core/query/bittest.js index c71e44ac7c4..c2ca7f131d0 100644 --- a/jstests/core/query/bittest.js +++ b/jstests/core/query/bittest.js @@ -4,7 +4,7 @@ * assumes_read_concern_local, * ] */ -import {getWinningPlan, isCollscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isCollscan} from "jstests/libs/query/analyze_plan.js"; var coll = db.jstests_bitwise; diff --git a/jstests/core/query/boolean_expression_simplification.js b/jstests/core/query/boolean_expression_simplification.js index caf30c53707..f1724a6b546 100644 --- a/jstests/core/query/boolean_expression_simplification.js +++ b/jstests/core/query/boolean_expression_simplification.js @@ -7,7 +7,7 @@ * ] */ -import {getPlanStages, getWinningPlanFromExplain} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlanFromExplain} from "jstests/libs/query/analyze_plan.js"; const parameterName = "internalQueryEnableBooleanExpressionsSimplifier"; const isSImplifierEnabled = diff --git a/jstests/core/query/change_streams_pre_and_post_images_in_create_and_collmod.js b/jstests/core/query/change_streams_pre_and_post_images_in_create_and_collmod.js index 7210083475a..f8387889d37 100644 --- a/jstests/core/query/change_streams_pre_and_post_images_in_create_and_collmod.js +++ b/jstests/core/query/change_streams_pre_and_post_images_in_create_and_collmod.js @@ -6,11 +6,11 @@ * requires_replication, * ] */ +import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; import { assertChangeStreamPreAndPostImagesCollectionOptionIsAbsent, assertChangeStreamPreAndPostImagesCollectionOptionIsEnabled, -} from "jstests/libs/change_stream_util.js"; -import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/change_stream_util.js"; const dbName = 'testDB'; const collName = 'changeStreamPreAndPostImages'; diff --git a/jstests/core/query/collation/collation.js b/jstests/core/query/collation/collation.js index 6993b45b8c9..4ae9c693ba0 100644 --- a/jstests/core/query/collation/collation.js +++ b/jstests/core/query/collation/collation.js @@ -20,6 +20,10 @@ // ] // Integration tests for the collation feature. +import { + ClusteredCollectionUtil +} from "jstests/libs/clustered_collections/clustered_collection_util.js"; +import {IndexCatalogHelpers} from "jstests/libs/index_catalog_helpers.js"; import { getPlanStage, getSingleNodeExplain, @@ -28,11 +32,7 @@ import { isIdhackOrExpress, isIxscan, planHasStage -} from "jstests/libs/analyze_plan.js"; -import { - ClusteredCollectionUtil -} from "jstests/libs/clustered_collections/clustered_collection_util.js"; -import {IndexCatalogHelpers} from "jstests/libs/index_catalog_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; let testDb = db.getSiblingDB("collation_js"); var coll = testDb.collation; diff --git a/jstests/core/query/command_let_variables.js b/jstests/core/query/command_let_variables.js index 7226d6bcd07..81d5ca05a43 100644 --- a/jstests/core/query/command_let_variables.js +++ b/jstests/core/query/command_let_variables.js @@ -7,9 +7,9 @@ // does_not_support_config_fuzzer, // ] // -import {getPlanStage, getSingleNodeExplain, planHasStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanStage, getSingleNodeExplain, planHasStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const testDB = db.getSiblingDB("command_let_variables"); const coll = testDB.command_let_variables; diff --git a/jstests/core/query/cover_null_queries.js b/jstests/core/query/cover_null_queries.js index 6fcb9bc665e..14ccafb8f08 100644 --- a/jstests/core/query/cover_null_queries.js +++ b/jstests/core/query/cover_null_queries.js @@ -10,10 +10,10 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStages, getPlanStages} from "jstests/libs/analyze_plan.js"; import { ClusteredCollectionUtil } from "jstests/libs/clustered_collections/clustered_collection_util.js"; +import {getAggPlanStages, getPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.cover_null_queries; coll.drop(); diff --git a/jstests/core/query/covered_multikey.js b/jstests/core/query/covered_multikey.js index 58d134c96b5..fe02939d30c 100644 --- a/jstests/core/query/covered_multikey.js +++ b/jstests/core/query/covered_multikey.js @@ -16,7 +16,7 @@ import { isIxscan, isIxscanMultikey, planHasStage -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; let coll = db.covered_multikey; coll.drop(); diff --git a/jstests/core/query/covered_query_with_sort.js b/jstests/core/query/covered_query_with_sort.js index 1aa32308331..49d85ea80b2 100644 --- a/jstests/core/query/covered_query_with_sort.js +++ b/jstests/core/query/covered_query_with_sort.js @@ -7,7 +7,7 @@ // assumes_unsharded_collection, // ] -import {getPlanStage, getWinningPlan, isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getWinningPlan, isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const coll = db.covered_query_with_sort; coll.drop(); diff --git a/jstests/core/query/distinct/distinct_compound_index.js b/jstests/core/query/distinct/distinct_compound_index.js index 2d2bc0ac5e7..d976ffd31a1 100644 --- a/jstests/core/query/distinct/distinct_compound_index.js +++ b/jstests/core/query/distinct/distinct_compound_index.js @@ -4,12 +4,12 @@ // # Asserts that some queries use a collection scan. // assumes_no_implicit_index_creation, // ] +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { assertStagesForExplainOfCommand, getWinningPlan, planHasStage -} from "jstests/libs/analyze_plan.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.distinct_multikey_index; diff --git a/jstests/core/query/distinct/distinct_hint.js b/jstests/core/query/distinct/distinct_hint.js index ea7ed1723c9..f1ff1f5f2ba 100644 --- a/jstests/core/query/distinct/distinct_hint.js +++ b/jstests/core/query/distinct/distinct_hint.js @@ -7,8 +7,8 @@ * ] */ -import {getPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; var isHintsToQuerySettingsSuite = TestData.isHintsToQuerySettingsSuite || false; diff --git a/jstests/core/query/distinct/distinct_index1.js b/jstests/core/query/distinct/distinct_index1.js index ae9ea084a20..50f4f4da145 100644 --- a/jstests/core/query/distinct/distinct_index1.js +++ b/jstests/core/query/distinct/distinct_index1.js @@ -5,8 +5,8 @@ * assumes_read_concern_local, * ] */ -import {getPlanStage, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStage, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.distinct_index1; coll.drop(); diff --git a/jstests/core/query/distinct/distinct_multikey.js b/jstests/core/query/distinct/distinct_multikey.js index 36bb5f15207..cf7cb98faed 100644 --- a/jstests/core/query/distinct/distinct_multikey.js +++ b/jstests/core/query/distinct/distinct_multikey.js @@ -4,8 +4,8 @@ * assumes_read_concern_local, * ] */ -import {getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; let coll = db.jstest_distinct_multikey; coll.drop(); diff --git a/jstests/core/query/distinct/distinct_multikey_dotted_path.js b/jstests/core/query/distinct/distinct_multikey_dotted_path.js index 3bbbfd92a8b..caf199fef21 100644 --- a/jstests/core/query/distinct/distinct_multikey_dotted_path.js +++ b/jstests/core/query/distinct/distinct_multikey_dotted_path.js @@ -11,7 +11,7 @@ * does_not_support_stepdowns, * ] */ -import {getAggPlanStages, getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages, getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.distinct_multikey; coll.drop(); diff --git a/jstests/core/query/distinct/distinct_with_hashed_index.js b/jstests/core/query/distinct/distinct_with_hashed_index.js index 203867652aa..910a85b1baf 100644 --- a/jstests/core/query/distinct/distinct_with_hashed_index.js +++ b/jstests/core/query/distinct/distinct_with_hashed_index.js @@ -15,7 +15,7 @@ import { isIndexOnly, isIxscan, planHasStage, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.distinct_with_hashed_index; coll.drop(); diff --git a/jstests/core/query/explain/explain_all_plans_execution_stats.js b/jstests/core/query/explain/explain_all_plans_execution_stats.js index aa26e17fa05..d296e669c4d 100644 --- a/jstests/core/query/explain/explain_all_plans_execution_stats.js +++ b/jstests/core/query/explain/explain_all_plans_execution_stats.js @@ -5,8 +5,8 @@ // assumes_read_concern_local, // ] // -import {getExecutionStats} from "jstests/libs/analyze_plan.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getExecutionStats} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; if (checkSbeRestrictedOrFullyEnabled(db)) { const coll = db.test; diff --git a/jstests/core/query/explain/explain_classic_runtime_planner_for_sbe.js b/jstests/core/query/explain/explain_classic_runtime_planner_for_sbe.js index bc514e3f14a..fffc09ab5e9 100644 --- a/jstests/core/query/explain/explain_classic_runtime_planner_for_sbe.js +++ b/jstests/core/query/explain/explain_classic_runtime_planner_for_sbe.js @@ -10,7 +10,7 @@ import { getExecutionStages, getExecutionStats, getRejectedPlans, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_classic_runtime_planner_for_sbe; coll.drop(); diff --git a/jstests/core/query/explain/explain_count.js b/jstests/core/query/explain/explain_count.js index 4f79dcc0bca..dbfda785685 100644 --- a/jstests/core/query/explain/explain_count.js +++ b/jstests/core/query/explain/explain_count.js @@ -2,8 +2,8 @@ // // @tags: [requires_fastcount] -import {assertExplainCount, getPlanStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {assertExplainCount, getPlanStage} from "jstests/libs/query/analyze_plan.js"; var collName = "jstests_explain_count"; var t = db[collName]; diff --git a/jstests/core/query/explain/explain_delete.js b/jstests/core/query/explain/explain_delete.js index 12f8746b91c..ca377524cc3 100644 --- a/jstests/core/query/explain/explain_delete.js +++ b/jstests/core/query/explain/explain_delete.js @@ -10,7 +10,7 @@ * incompatible_with_preimages_by_default, * ] */ -import {checkNWouldDelete} from "jstests/libs/analyze_plan.js"; +import {checkNWouldDelete} from "jstests/libs/query/analyze_plan.js"; var collName = "jstests_explain_delete"; var t = db[collName]; diff --git a/jstests/core/query/explain/explain_distinct.js b/jstests/core/query/explain/explain_distinct.js index 48ee7ce2087..da5d025d063 100644 --- a/jstests/core/query/explain/explain_distinct.js +++ b/jstests/core/query/explain/explain_distinct.js @@ -14,7 +14,7 @@ import { getWinningPlan, isCollscan, planHasStage -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const collName = "jstests_explain_distinct"; const coll = db[collName]; diff --git a/jstests/core/query/explain/explain_find_trivially_false_predicates.js b/jstests/core/query/explain/explain_find_trivially_false_predicates.js index 3bda0927649..9ff270a2e7b 100644 --- a/jstests/core/query/explain/explain_find_trivially_false_predicates.js +++ b/jstests/core/query/explain/explain_find_trivially_false_predicates.js @@ -7,13 +7,13 @@ * ] */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { assertNoFetchFilter, getPlanStages, getWinningPlanFromExplain, isEofPlan -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/analyze_plan.js"; const collName = "jstests_explain_find_trivially_false_predicates"; diff --git a/jstests/core/query/explain/explain_find_trivially_false_predicates_in_agg_pipelines.js b/jstests/core/query/explain/explain_find_trivially_false_predicates_in_agg_pipelines.js index f47fb87fd5f..59b21f8b5bf 100644 --- a/jstests/core/query/explain/explain_find_trivially_false_predicates_in_agg_pipelines.js +++ b/jstests/core/query/explain/explain_find_trivially_false_predicates_in_agg_pipelines.js @@ -16,14 +16,14 @@ */ import {getExplainPipelineFromAggregationResult} from "jstests/aggregation/extras/utils.js"; +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { aggPlanHasStage, getAggPlanStages, getWinningPlanFromExplain, isEofPlan, planHasStage -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/analyze_plan.js"; function assertPlanIsEOF(plan) { // Explain query output doesn't include planning for the foreign branch hence we use execution diff --git a/jstests/core/query/explain/explain_find_trivially_false_predicates_in_tailables_over_capped_colls.js b/jstests/core/query/explain/explain_find_trivially_false_predicates_in_tailables_over_capped_colls.js index 85c541571aa..b7431afcf88 100644 --- a/jstests/core/query/explain/explain_find_trivially_false_predicates_in_tailables_over_capped_colls.js +++ b/jstests/core/query/explain/explain_find_trivially_false_predicates_in_tailables_over_capped_colls.js @@ -8,8 +8,12 @@ * assumes_read_concern_local * ] */ -import {getPlanStages, getWinningPlanFromExplain, isEofPlan} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import { + getPlanStages, + getWinningPlanFromExplain, + isEofPlan +} from "jstests/libs/query/analyze_plan.js"; const collName = "explain_find_trivially_false_predicates_in_tailables_over_capped_colls"; diff --git a/jstests/core/query/explain/explain_multi_plan.js b/jstests/core/query/explain/explain_multi_plan.js index c5e3f16fe29..6ae93123047 100644 --- a/jstests/core/query/explain/explain_multi_plan.js +++ b/jstests/core/query/explain/explain_multi_plan.js @@ -5,7 +5,7 @@ // does_not_support_causal_consistency, // ] -import {hasRejectedPlans} from "jstests/libs/analyze_plan.js"; +import {hasRejectedPlans} from "jstests/libs/query/analyze_plan.js"; /** * Tests running explain on a variety of explainable commands (find, update, remove, etc.) when diff --git a/jstests/core/query/explain/explain_multi_plan_count.js b/jstests/core/query/explain/explain_multi_plan_count.js index 051bfe3c215..ee4f2d5dcd7 100644 --- a/jstests/core/query/explain/explain_multi_plan_count.js +++ b/jstests/core/query/explain/explain_multi_plan_count.js @@ -16,7 +16,7 @@ import { getWinningPlan, isIndexOnly, isIxscan, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_multi_plan_count; coll.drop(); diff --git a/jstests/core/query/explain/explain_multikey.js b/jstests/core/query/explain/explain_multikey.js index 7dd8bc6aa78..982dcd96c41 100644 --- a/jstests/core/query/explain/explain_multikey.js +++ b/jstests/core/query/explain/explain_multikey.js @@ -5,7 +5,7 @@ // @tags: [ // assumes_unsharded_collection, // ] -import {getPlanStage, getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_multikey; const keyPattern = { diff --git a/jstests/core/query/explain/explain_plan_cache.js b/jstests/core/query/explain/explain_plan_cache.js index 33e22794ef9..7a3aa92d48a 100644 --- a/jstests/core/query/explain/explain_plan_cache.js +++ b/jstests/core/query/explain/explain_plan_cache.js @@ -23,8 +23,8 @@ import { getRejectedPlan, getRejectedPlans, getWinningPlan -} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const shouldGenerateSbePlan = checkSbeFullyEnabled(db); const isUsingSbePlanCache = checkSbeFullFeatureFlagEnabled(db); diff --git a/jstests/core/query/explain/explain_plan_scores.js b/jstests/core/query/explain/explain_plan_scores.js index 6db3b20a5c7..b895e263a6d 100644 --- a/jstests/core/query/explain/explain_plan_scores.js +++ b/jstests/core/query/explain/explain_plan_scores.js @@ -9,7 +9,11 @@ // assumes_against_mongod_not_mongos, // ] -import {getRejectedPlan, getRejectedPlans, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import { + getRejectedPlan, + getRejectedPlans, + getWinningPlan +} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_plan_scores; coll.drop(); diff --git a/jstests/core/query/explain/explain_sample.js b/jstests/core/query/explain/explain_sample.js index 2b001ec8385..7e730b4839b 100644 --- a/jstests/core/query/explain/explain_sample.js +++ b/jstests/core/query/explain/explain_sample.js @@ -4,7 +4,7 @@ * assumes_read_concern_local, * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_sample; coll.drop(); diff --git a/jstests/core/query/explain/explain_shell_helpers.js b/jstests/core/query/explain/explain_shell_helpers.js index b2e1f4e508d..16a218175fc 100644 --- a/jstests/core/query/explain/explain_shell_helpers.js +++ b/jstests/core/query/explain/explain_shell_helpers.js @@ -22,7 +22,7 @@ import { getWinningPlan, isIxscan, planHasStage -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; var t = db.jstests_explain_helpers; t.drop(); diff --git a/jstests/core/query/explain/explain_skip.js b/jstests/core/query/explain/explain_skip.js index 8e3f7c72c1e..bf86f78fa47 100644 --- a/jstests/core/query/explain/explain_skip.js +++ b/jstests/core/query/explain/explain_skip.js @@ -6,7 +6,7 @@ * assumes_against_mongod_not_mongos, * ] */ -import {getPlanStage, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_skip; coll.drop(); diff --git a/jstests/core/query/explain/explain_sort_type.js b/jstests/core/query/explain/explain_sort_type.js index df1ba7b1248..efd72d90191 100644 --- a/jstests/core/query/explain/explain_sort_type.js +++ b/jstests/core/query/explain/explain_sort_type.js @@ -10,7 +10,7 @@ * requires_non_retryable_writes, * ] */ -import {getPlanStage, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_sort_type; coll.drop(); diff --git a/jstests/core/query/explain/explain_winning_plan.js b/jstests/core/query/explain/explain_winning_plan.js index abedf8368a3..b4637c38bb8 100644 --- a/jstests/core/query/explain/explain_winning_plan.js +++ b/jstests/core/query/explain/explain_winning_plan.js @@ -9,7 +9,7 @@ // does_not_support_multiplanning_single_solutions, // ] -import {getExecutionStats} from "jstests/libs/analyze_plan.js"; +import {getExecutionStats} from "jstests/libs/query/analyze_plan.js"; const coll = db.explain_winning_plan; coll.drop(); diff --git a/jstests/core/query/explain/explain_writecmd_nonexistent_collection.js b/jstests/core/query/explain/explain_writecmd_nonexistent_collection.js index 1ce4bc14a7f..b3841828ce0 100644 --- a/jstests/core/query/explain/explain_writecmd_nonexistent_collection.js +++ b/jstests/core/query/explain/explain_writecmd_nonexistent_collection.js @@ -7,7 +7,7 @@ // requires_fcv_81, //] // -import {getPlanStages, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, planHasStage} from "jstests/libs/query/analyze_plan.js"; function assertCollectionDoesNotExist(collName) { const collectionList = db.getCollectionInfos({name: collName}); diff --git a/jstests/core/query/explain/optimized_match_explain.js b/jstests/core/query/explain/optimized_match_explain.js index 28bf6075944..e00e59597f5 100644 --- a/jstests/core/query/explain/optimized_match_explain.js +++ b/jstests/core/query/explain/optimized_match_explain.js @@ -5,7 +5,7 @@ /** * Tests that the explain output for $match reflects any optimizations. */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.match_explain; coll.drop(); diff --git a/jstests/core/query/explode_for_sort_equality_to_array.js b/jstests/core/query/explode_for_sort_equality_to_array.js index 94d5644b371..41ff5ad6263 100644 --- a/jstests/core/query/explode_for_sort_equality_to_array.js +++ b/jstests/core/query/explode_for_sort_equality_to_array.js @@ -10,7 +10,7 @@ * assumes_read_concern_local, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB(jsTestName()); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/core/query/expr/expr.js b/jstests/core/query/expr/expr.js index e8e716235c7..393ac87a3ca 100644 --- a/jstests/core/query/expr/expr.js +++ b/jstests/core/query/expr/expr.js @@ -14,8 +14,8 @@ // does_not_support_multiplanning_single_solutions, // ] -import "jstests/libs/sbe_assert_error_override.js"; -import {getExecutionStats} from "jstests/libs/analyze_plan.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; +import {getExecutionStats} from "jstests/libs/query/analyze_plan.js"; const coll = db.expr; diff --git a/jstests/core/query/expr/expr_index_use.js b/jstests/core/query/expr/expr_index_use.js index 04b4f2a1e2f..97b339115fe 100644 --- a/jstests/core/query/expr/expr_index_use.js +++ b/jstests/core/query/expr/expr_index_use.js @@ -11,7 +11,7 @@ import { getEngine, getPlanStage, hasRejectedPlans -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.expr_index_use; coll.drop(); diff --git a/jstests/core/query/find_with_resume_after_param.js b/jstests/core/query/find_with_resume_after_param.js index 50036ae5dbb..3ef244d5e09 100644 --- a/jstests/core/query/find_with_resume_after_param.js +++ b/jstests/core/query/find_with_resume_after_param.js @@ -20,7 +20,7 @@ import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const sbeFullyEnabled = checkSbeFullyEnabled(db); diff --git a/jstests/core/query/group_lookup_with_canonical_query_prefix.js b/jstests/core/query/group_lookup_with_canonical_query_prefix.js index 6883e938b92..17026172d6d 100644 --- a/jstests/core/query/group_lookup_with_canonical_query_prefix.js +++ b/jstests/core/query/group_lookup_with_canonical_query_prefix.js @@ -19,7 +19,7 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getEngine} from "jstests/libs/analyze_plan.js"; +import {getEngine} from "jstests/libs/query/analyze_plan.js"; function buildErrorString(found, expected) { return "Expected:\n" + tojson(expected) + "\nGot:\n" + tojson(found); diff --git a/jstests/core/query/hashed_partial_and_sparse_index.js b/jstests/core/query/hashed_partial_and_sparse_index.js index ce5feed7b21..9817caaeae8 100644 --- a/jstests/core/query/hashed_partial_and_sparse_index.js +++ b/jstests/core/query/hashed_partial_and_sparse_index.js @@ -7,7 +7,7 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; const coll = db.hashed_partial_index; coll.drop(); diff --git a/jstests/core/query/idhack.js b/jstests/core/query/idhack.js index 650a466cb30..77f8705b9df 100644 --- a/jstests/core/query/idhack.js +++ b/jstests/core/query/idhack.js @@ -4,8 +4,8 @@ // requires_non_retryable_writes, // ] // Include helpers for analyzing explain output. -import {getWinningPlan, isExpress, isIdhackOrExpress} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getWinningPlan, isExpress, isIdhackOrExpress} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const t = db.idhack; t.drop(); diff --git a/jstests/core/query/index_deduplication.js b/jstests/core/query/index_deduplication.js index 8d6b4cf3a86..162a3ed7fac 100644 --- a/jstests/core/query/index_deduplication.js +++ b/jstests/core/query/index_deduplication.js @@ -14,13 +14,13 @@ * requires_fcv_80 * ] */ +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getPlanStages, getQueryPlanner, getRejectedPlans, getWinningPlan -} from "jstests/libs/analyze_plan.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.index_deduplication; coll.drop(); diff --git a/jstests/core/query/internal_hash_eq/expr_rewrites.js b/jstests/core/query/internal_hash_eq/expr_rewrites.js index 503739d1a7b..f20c83224a1 100644 --- a/jstests/core/query/internal_hash_eq/expr_rewrites.js +++ b/jstests/core/query/internal_hash_eq/expr_rewrites.js @@ -13,7 +13,7 @@ import { getPlanStages, isCollscan, isIxscan -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const isHintsToQuerySettingsSuite = TestData.isHintsToQuerySettingsSuite || false; diff --git a/jstests/core/query/internal_hash_eq/match_internal_eq_hash.js b/jstests/core/query/internal_hash_eq/match_internal_eq_hash.js index c904a346a35..bc9271980c9 100644 --- a/jstests/core/query/internal_hash_eq/match_internal_eq_hash.js +++ b/jstests/core/query/internal_hash_eq/match_internal_eq_hash.js @@ -7,7 +7,7 @@ * ] */ import {resultsEq} from "jstests/aggregation/extras/utils.js"; -import {isCollscan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {isCollscan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const coll = db.match_internal_eq_hash; diff --git a/jstests/core/query/internal_strip_invalid_assignment.js b/jstests/core/query/internal_strip_invalid_assignment.js index 64d36e8cbcf..557d6e22903 100644 --- a/jstests/core/query/internal_strip_invalid_assignment.js +++ b/jstests/core/query/internal_strip_invalid_assignment.js @@ -9,7 +9,7 @@ * assumes_read_concern_local, * ] */ -import {planHasStage} from 'jstests/libs/analyze_plan.js'; +import {planHasStage} from 'jstests/libs/query/analyze_plan.js'; const coll = db.getCollection(jsTestName()); diff --git a/jstests/core/query/json_schema/json_schema.js b/jstests/core/query/json_schema/json_schema.js index aef64209dce..26fabac0b02 100644 --- a/jstests/core/query/json_schema/json_schema.js +++ b/jstests/core/query/json_schema/json_schema.js @@ -8,7 +8,7 @@ * Tests for JSON Schema document validation. */ import {assertSchemaMatch} from "jstests/libs/assert_schema_match.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const isSBEEnabled = checkSbeFullyEnabled(db); diff --git a/jstests/core/query/map_reduce/mr_agg_explain.js b/jstests/core/query/map_reduce/mr_agg_explain.js index 3b2a3e850d8..9b9ffc8edcc 100644 --- a/jstests/core/query/map_reduce/mr_agg_explain.js +++ b/jstests/core/query/map_reduce/mr_agg_explain.js @@ -9,7 +9,7 @@ * requires_scripting, * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.mr_explain; coll.drop(); diff --git a/jstests/core/query/mod/mod_special_values.js b/jstests/core/query/mod/mod_special_values.js index 68e92787b9b..e0f3dad83a0 100644 --- a/jstests/core/query/mod/mod_special_values.js +++ b/jstests/core/query/mod/mod_special_values.js @@ -4,7 +4,7 @@ * This test exercises a changed behavior, thus prevent it running in multi-version variants. * @tags: [requires_fcv_51] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const testDB = db.getSiblingDB(jsTestName()); function executeTestCase(collection, testCase) { diff --git a/jstests/core/query/or/or2.js b/jstests/core/query/or/or2.js index 772f4dec2bd..3440dd176be 100644 --- a/jstests/core/query/or/or2.js +++ b/jstests/core/query/or/or2.js @@ -3,7 +3,7 @@ // ] // Include helpers for analyzing explain output. -import {getWinningPlan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const t = db.jstests_or2; t.drop(); diff --git a/jstests/core/query/or/or3.js b/jstests/core/query/or/or3.js index 7502afee49c..e94f7506596 100644 --- a/jstests/core/query/or/or3.js +++ b/jstests/core/query/or/or3.js @@ -3,7 +3,7 @@ // ] // Include helpers for analyzing explain output. -import {getWinningPlan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const t = db.jstests_or3; t.drop(); diff --git a/jstests/core/query/or/or_to_in.js b/jstests/core/query/or/or_to_in.js index 4dbeb71c698..cd452246eb6 100644 --- a/jstests/core/query/or/or_to_in.js +++ b/jstests/core/query/or/or_to_in.js @@ -14,7 +14,7 @@ import { getQueryPlanner, getSingleNodeExplain, getWinningPlanFromExplain -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; var coll = db.orToIn; coll.drop(); diff --git a/jstests/core/query/or/ord.js b/jstests/core/query/or/ord.js index a28386c9802..644d66db88e 100644 --- a/jstests/core/query/or/ord.js +++ b/jstests/core/query/or/ord.js @@ -5,8 +5,8 @@ // # An index drop does not necessarily cause cursors to be killed on the secondary. // does_not_support_causal_consistency, // ] -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.jstests_ord; coll.drop(); diff --git a/jstests/core/query/or_use_clustered_collection.js b/jstests/core/query/or_use_clustered_collection.js index 7424af0baba..d088334d23e 100644 --- a/jstests/core/query/or_use_clustered_collection.js +++ b/jstests/core/query/or_use_clustered_collection.js @@ -11,14 +11,14 @@ * ] */ +import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; import { getAggPlanStages, getPlanStage, getPlanStages, getWinningPlan -} from "jstests/libs/analyze_plan.js"; -import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.or_use_clustered_collection; assertDropCollection(db, coll.getName()); diff --git a/jstests/core/query/partialFilterExpression_with_geoWithin.js b/jstests/core/query/partialFilterExpression_with_geoWithin.js index db72d296503..f30e4254c98 100644 --- a/jstests/core/query/partialFilterExpression_with_geoWithin.js +++ b/jstests/core/query/partialFilterExpression_with_geoWithin.js @@ -1,6 +1,6 @@ // @tags: [requires_non_retryable_writes, requires_fcv_51] -import {getWinningPlan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const coll = db.partialFilterExpression_with_geoWithin; coll.drop(); diff --git a/jstests/core/query/partial_index_logical.js b/jstests/core/query/partial_index_logical.js index a23519b2fd7..3fc4e459d98 100644 --- a/jstests/core/query/partial_index_logical.js +++ b/jstests/core/query/partial_index_logical.js @@ -16,7 +16,7 @@ * tenant_migration_incompatible, * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/core/query/plan_cache/collation_plan_cache.js b/jstests/core/query/plan_cache/collation_plan_cache.js index ba50f2d48dc..1697fb43edc 100644 --- a/jstests/core/query/plan_cache/collation_plan_cache.js +++ b/jstests/core/query/plan_cache/collation_plan_cache.js @@ -21,8 +21,8 @@ // requires_fcv_72, // multiversion_incompatible, // ] -import {getPlanCacheKeyFromExplain} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanCacheKeyFromExplain} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; var coll = db.collation_plan_cache; coll.drop(); diff --git a/jstests/core/query/plan_cache/elem_match_index_diff_types.js b/jstests/core/query/plan_cache/elem_match_index_diff_types.js index 5c0013b9b05..1e432e0aed3 100644 --- a/jstests/core/query/plan_cache/elem_match_index_diff_types.js +++ b/jstests/core/query/plan_cache/elem_match_index_diff_types.js @@ -4,7 +4,7 @@ * when the entry and predicate have different data types which affect index compatibility. */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; const coll = db.elem_match_index_diff_types; const indexCollation = { diff --git a/jstests/core/query/plan_cache/in_expression_plan_cache.js b/jstests/core/query/plan_cache/in_expression_plan_cache.js index dc5bc0c2bd4..4c5bd7594ee 100644 --- a/jstests/core/query/plan_cache/in_expression_plan_cache.js +++ b/jstests/core/query/plan_cache/in_expression_plan_cache.js @@ -29,8 +29,8 @@ import { getPlanCacheShapeHashFromObject, getPlanStages, getWinningPlan -} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const isUsingSbePlanCache = checkSbeFullFeatureFlagEnabled(db); const coll = db.explode_for_sort_plan_cache; diff --git a/jstests/core/query/plan_cache/introspect_hidden_index_plan_cache_entries.js b/jstests/core/query/plan_cache/introspect_hidden_index_plan_cache_entries.js index d2cbc524cda..2328b47acaf 100644 --- a/jstests/core/query/plan_cache/introspect_hidden_index_plan_cache_entries.js +++ b/jstests/core/query/plan_cache/introspect_hidden_index_plan_cache_entries.js @@ -14,7 +14,7 @@ * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; const collName = 'introspect_hidden_index_plan_cache_entries'; const collNotAffectedName = 'introspect_hidden_index_plan_cache_entries_unaffected'; diff --git a/jstests/core/query/plan_cache/plan_cache_clear.js b/jstests/core/query/plan_cache/plan_cache_clear.js index 10312bd28a7..ede71f8b25c 100644 --- a/jstests/core/query/plan_cache/plan_cache_clear.js +++ b/jstests/core/query/plan_cache/plan_cache_clear.js @@ -20,9 +20,12 @@ // references_foreign_collection, // ] -import {getPlanCacheKeyFromPipeline, getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import { + getPlanCacheKeyFromPipeline, + getPlanCacheKeyFromShape +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.jstests_plan_cache_clear; coll.drop(); diff --git a/jstests/core/query/plan_cache/plan_cache_eof.js b/jstests/core/query/plan_cache/plan_cache_eof.js index 0e0b00f9e3b..4d2ad0bac02 100644 --- a/jstests/core/query/plan_cache/plan_cache_eof.js +++ b/jstests/core/query/plan_cache/plan_cache_eof.js @@ -20,8 +20,8 @@ * ] */ -import {getPlanStages, getQueryPlanner, planHasStage} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanStages, getQueryPlanner, planHasStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const isUsingSbePlanCache = checkSbeFullFeatureFlagEnabled(db); if (!isUsingSbePlanCache) { diff --git a/jstests/core/query/plan_cache/plan_cache_list_plans.js b/jstests/core/query/plan_cache/plan_cache_list_plans.js index 776ca1ab8ca..9728824ffb9 100644 --- a/jstests/core/query/plan_cache/plan_cache_list_plans.js +++ b/jstests/core/query/plan_cache/plan_cache_list_plans.js @@ -31,16 +31,16 @@ // multiversion_incompatible, // ] +import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getPlanCacheKeyFromPipeline, getPlanCacheKeyFromShape, getPlanCacheShapeHashFromObject, getPlanStage -} from "jstests/libs/analyze_plan.js"; -import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; let coll = db.jstests_plan_cache_list_plans; coll.drop(); diff --git a/jstests/core/query/plan_cache/plan_cache_list_shapes.js b/jstests/core/query/plan_cache/plan_cache_list_shapes.js index 3c0e1b5c00a..920ead3766a 100644 --- a/jstests/core/query/plan_cache/plan_cache_list_shapes.js +++ b/jstests/core/query/plan_cache/plan_cache_list_shapes.js @@ -14,8 +14,8 @@ // # Plan cache state is node-local and will not get migrated alongside tenant data. // tenant_migration_incompatible, // ] -import {getPlanCacheShapeHashFromObject} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanCacheShapeHashFromObject} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; if (checkSbeFullyEnabled(db)) { jsTest.log("Skipping test because SBE is enabled."); diff --git a/jstests/core/query/plan_cache/plan_cache_sbe.js b/jstests/core/query/plan_cache/plan_cache_sbe.js index 94c2347bf06..6163212ece9 100644 --- a/jstests/core/query/plan_cache/plan_cache_sbe.js +++ b/jstests/core/query/plan_cache/plan_cache_sbe.js @@ -27,7 +27,7 @@ */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.plan_cache_sbe; coll.drop(); diff --git a/jstests/core/query/plan_cache/plan_cache_shell_helpers.js b/jstests/core/query/plan_cache/plan_cache_shell_helpers.js index eaf5ab988d4..050752e2b45 100644 --- a/jstests/core/query/plan_cache/plan_cache_shell_helpers.js +++ b/jstests/core/query/plan_cache/plan_cache_shell_helpers.js @@ -14,8 +14,8 @@ // tenant_migration_incompatible, // ] import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const isSbeEnabled = checkSbeFullyEnabled(db); var coll = db.jstests_plan_cache_shell_helpers; diff --git a/jstests/core/query/plan_cache/plan_cache_stats_shard_and_host.js b/jstests/core/query/plan_cache/plan_cache_stats_shard_and_host.js index 12474abf786..37db372afbc 100644 --- a/jstests/core/query/plan_cache/plan_cache_stats_shard_and_host.js +++ b/jstests/core/query/plan_cache/plan_cache_stats_shard_and_host.js @@ -11,8 +11,8 @@ // # Plan cache state is node-local and will not get migrated alongside tenant data. // tenant_migration_incompatible, // ] -import {getPlanCacheKeyFromExplain} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanCacheKeyFromExplain} from "jstests/libs/query/analyze_plan.js"; const coll = db.plan_cache_stats_shard_and_host; coll.drop(); diff --git a/jstests/core/query/project/computed_projections.js b/jstests/core/query/project/computed_projections.js index 6f833898f44..074156a30f9 100644 --- a/jstests/core/query/project/computed_projections.js +++ b/jstests/core/query/project/computed_projections.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {arrayEq} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/core/query/project/positional_projection.js b/jstests/core/query/project/positional_projection.js index 780cf60f955..6e048e3b54c 100644 --- a/jstests/core/query/project/positional_projection.js +++ b/jstests/core/query/project/positional_projection.js @@ -2,7 +2,7 @@ // @tags: [ // requires_getmore, // ] -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; const coll = db.positional_projection; coll.drop(); diff --git a/jstests/core/query/project/positional_projection_multiple_array_fields.js b/jstests/core/query/project/positional_projection_multiple_array_fields.js index 3d3f4db030d..242cbda6ac5 100644 --- a/jstests/core/query/project/positional_projection_multiple_array_fields.js +++ b/jstests/core/query/project/positional_projection_multiple_array_fields.js @@ -5,7 +5,7 @@ * Note that the user's query/filter document may only contain _ONE_ array field for positional * projection to work correctly. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {documentEq} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/core/query/project/projection_dotted_paths.js b/jstests/core/query/project/projection_dotted_paths.js index 40605816257..be9d9a67a99 100644 --- a/jstests/core/query/project/projection_dotted_paths.js +++ b/jstests/core/query/project/projection_dotted_paths.js @@ -15,7 +15,7 @@ import { isIdhackOrExpress, isIndexOnly, isIxscan -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; let coll = db["projection_dotted_paths"]; coll.drop(); diff --git a/jstests/core/query/project/projection_expr_mod.js b/jstests/core/query/project/projection_expr_mod.js index fdbf6583cd8..6702ff568db 100644 --- a/jstests/core/query/project/projection_expr_mod.js +++ b/jstests/core/query/project/projection_expr_mod.js @@ -1,6 +1,6 @@ // Confirm correctness of $mod evaluation in find projection. -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; diff --git a/jstests/core/query/project/projection_with_hashed_index.js b/jstests/core/query/project/projection_with_hashed_index.js index e563303fb21..7209c6edda4 100644 --- a/jstests/core/query/project/projection_with_hashed_index.js +++ b/jstests/core/query/project/projection_with_hashed_index.js @@ -14,7 +14,7 @@ import { getPlanStage, getShardsFromExplain, getWinningPlanFromExplain, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/core/query/query_hash_stability.js b/jstests/core/query/query_hash_stability.js index 1da1eac3ab8..185eb8e0c47 100644 --- a/jstests/core/query/query_hash_stability.js +++ b/jstests/core/query/query_hash_stability.js @@ -18,13 +18,13 @@ * ] */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { getAllNodeExplains, getPlanCacheKeyFromExplain, getPlanCacheShapeHashFromExplain -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; function groupBy(arr, keyFn) { let dict = {}; diff --git a/jstests/core/query/query_settings/query_settings_and_index_filters.js b/jstests/core/query/query_settings/query_settings_and_index_filters.js index bcc3cd3b016..93c813fb19b 100644 --- a/jstests/core/query/query_settings/query_settings_and_index_filters.js +++ b/jstests/core/query/query_settings/query_settings_and_index_filters.js @@ -14,9 +14,9 @@ // simulate_atlas_proxy_incompatible, // ] -import {getPlanStages, getQueryPlanners, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {getPlanStages, getQueryPlanners, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const coll = assertDropAndRecreateCollection(db, jsTestName()); const qsutils = new QuerySettingsUtils(db, coll.getName()); diff --git a/jstests/core/query/query_settings/query_settings_cmds.js b/jstests/core/query/query_settings/query_settings_cmds.js index 50011feb36b..63338c2a1dc 100644 --- a/jstests/core/query/query_settings/query_settings_cmds.js +++ b/jstests/core/query/query_settings/query_settings_cmds.js @@ -8,7 +8,7 @@ // import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; // Creating the collection, because some sharding passthrough suites are failing when explain // command is issued on the nonexistent database and collection. diff --git a/jstests/core/query/query_settings/query_settings_cmds_validation.js b/jstests/core/query/query_settings/query_settings_cmds_validation.js index f7e07e15b0c..14fd8ddad08 100644 --- a/jstests/core/query/query_settings/query_settings_cmds_validation.js +++ b/jstests/core/query/query_settings/query_settings_cmds_validation.js @@ -7,7 +7,7 @@ // import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const collName = jsTestName(); assertDropAndRecreateCollection(db, collName); diff --git a/jstests/core/query/query_settings/query_settings_debug_query_shape.js b/jstests/core/query/query_settings/query_settings_debug_query_shape.js index 4587fa5a81a..49cfd596622 100644 --- a/jstests/core/query/query_settings/query_settings_debug_query_shape.js +++ b/jstests/core/query/query_settings/query_settings_debug_query_shape.js @@ -7,7 +7,7 @@ // import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const collName = jsTestName(); const qsutils = new QuerySettingsUtils(db, collName); diff --git a/jstests/core/query/query_settings/query_settings_index_application_aggregate.js b/jstests/core/query/query_settings/query_settings_index_application_aggregate.js index 0b7e3754ac6..57e4bc221ff 100644 --- a/jstests/core/query/query_settings/query_settings_index_application_aggregate.js +++ b/jstests/core/query/query_settings/query_settings_index_application_aggregate.js @@ -17,9 +17,9 @@ import { assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {QuerySettingsIndexHintsTests} from "jstests/libs/query_settings_index_hints_tests.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {QuerySettingsIndexHintsTests} from "jstests/libs/query/query_settings_index_hints_tests.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const coll = assertDropAndRecreateCollection(db, jsTestName()); const viewName = "identityView"; diff --git a/jstests/core/query/query_settings/query_settings_index_application_distinct.js b/jstests/core/query/query_settings/query_settings_index_application_distinct.js index 3ab6f9996f9..6afaa5a4c59 100644 --- a/jstests/core/query/query_settings/query_settings_index_application_distinct.js +++ b/jstests/core/query/query_settings/query_settings_index_application_distinct.js @@ -16,8 +16,8 @@ import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsIndexHintsTests} from "jstests/libs/query_settings_index_hints_tests.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsIndexHintsTests} from "jstests/libs/query/query_settings_index_hints_tests.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; // Create the collection, because some sharding passthrough suites are failing when explain // command is issued on the nonexistent database and collection. diff --git a/jstests/core/query/query_settings/query_settings_index_application_find.js b/jstests/core/query/query_settings/query_settings_index_application_find.js index 6bc4a6ea52b..9f916c89b20 100644 --- a/jstests/core/query/query_settings/query_settings_index_application_find.js +++ b/jstests/core/query/query_settings/query_settings_index_application_find.js @@ -15,8 +15,8 @@ import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsIndexHintsTests} from "jstests/libs/query_settings_index_hints_tests.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsIndexHintsTests} from "jstests/libs/query/query_settings_index_hints_tests.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; // Create the collection, because some sharding passthrough suites are failing when explain // command is issued on the nonexistent database and collection. diff --git a/jstests/core/query/query_settings/query_settings_lost_update.js b/jstests/core/query/query_settings/query_settings_lost_update.js index f703847d8d5..ee600c4c0eb 100644 --- a/jstests/core/query/query_settings/query_settings_lost_update.js +++ b/jstests/core/query/query_settings/query_settings_lost_update.js @@ -15,7 +15,7 @@ import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recr import {configureFailPoint} from "jstests/libs/fail_point_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import {funWithArgs} from "jstests/libs/parallel_shell_helpers.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; // Early exit in case we are running on standalone mongod. Standalone mongod does not contain a // functioning 'VectorClock' instance. The check we have introduced in this change relies on a diff --git a/jstests/core/query/query_settings/query_settings_plan_cache.js b/jstests/core/query/query_settings/query_settings_plan_cache.js index f5ba0d6321c..ba29e377b37 100644 --- a/jstests/core/query/query_settings/query_settings_plan_cache.js +++ b/jstests/core/query/query_settings/query_settings_plan_cache.js @@ -14,9 +14,9 @@ // simulate_atlas_proxy_incompatible, // ] -import {getPlanCacheKeyFromExplain} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {getPlanCacheKeyFromExplain} from "jstests/libs/query/analyze_plan.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const coll = assertDropAndRecreateCollection(db, jsTestName()); const qsutils = new QuerySettingsUtils(db, coll.getName()); diff --git a/jstests/core/query/query_settings/query_settings_query_framework.js b/jstests/core/query/query_settings/query_settings_query_framework.js index 08ae606f1aa..f18480389f6 100644 --- a/jstests/core/query/query_settings/query_settings_query_framework.js +++ b/jstests/core/query/query_settings/query_settings_query_framework.js @@ -7,7 +7,7 @@ // import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; // Create the collection, because some sharding passthrough suites are failing when explain // command is issued on the nonexistent database and collection. diff --git a/jstests/core/query/query_settings/query_settings_reject_application.js b/jstests/core/query/query_settings/query_settings_reject_application.js index 41859657e09..7af9e7e737e 100644 --- a/jstests/core/query/query_settings/query_settings_reject_application.js +++ b/jstests/core/query/query_settings/query_settings_reject_application.js @@ -9,7 +9,7 @@ // import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; // Creating the collection. const coll = assertDropAndRecreateCollection(db, jsTestName()); diff --git a/jstests/core/query/query_settings/query_settings_reject_application_bypass.js b/jstests/core/query/query_settings/query_settings_reject_application_bypass.js index 698ea8114ad..a0ed696373c 100644 --- a/jstests/core/query/query_settings/query_settings_reject_application_bypass.js +++ b/jstests/core/query/query_settings/query_settings_reject_application_bypass.js @@ -13,7 +13,7 @@ import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {configureFailPoint} from "jstests/libs/fail_point_util.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; // Creating the collection. const coll = assertDropAndRecreateCollection(db, jsTestName()); diff --git a/jstests/core/query/query_settings/query_settings_size_limits.js b/jstests/core/query/query_settings/query_settings_size_limits.js index f2c4dc7bdfc..54a21ace2c4 100644 --- a/jstests/core/query/query_settings/query_settings_size_limits.js +++ b/jstests/core/query/query_settings/query_settings_size_limits.js @@ -11,7 +11,7 @@ * ] */ import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const dbName = db.getName(); const collName = jsTestName(); diff --git a/jstests/core/query/query_settings/query_settings_strictness.js b/jstests/core/query/query_settings/query_settings_strictness.js index 1dab222f3ab..f61e33a6a4b 100644 --- a/jstests/core/query/query_settings/query_settings_strictness.js +++ b/jstests/core/query/query_settings/query_settings_strictness.js @@ -12,7 +12,7 @@ */ import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const coll = assertDropAndRecreateCollection(db, jsTestName()); const qsutils = new QuerySettingsUtils(db, coll.getName()); diff --git a/jstests/core/query/query_settings/query_shape_hash_in_current_op.js b/jstests/core/query/query_settings/query_shape_hash_in_current_op.js index c4ff950b8d4..3c8e712774e 100644 --- a/jstests/core/query/query_settings/query_shape_hash_in_current_op.js +++ b/jstests/core/query/query_settings/query_shape_hash_in_current_op.js @@ -18,7 +18,7 @@ import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recr import {waitForCurOpByFailPoint} from "jstests/libs/curop_helpers.js"; import {configureFailPoint} from "jstests/libs/fail_point_util.js"; import {funWithArgs} from "jstests/libs/parallel_shell_helpers.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const coll = assertDropAndRecreateCollection(db, jsTestName()); const qsutils = new QuerySettingsUtils(db, coll.getName()); diff --git a/jstests/core/query/query_settings/query_shape_hash_in_profiler.js b/jstests/core/query/query_settings/query_shape_hash_in_profiler.js index 4466d683f07..e99106d5ac4 100644 --- a/jstests/core/query/query_settings/query_shape_hash_in_profiler.js +++ b/jstests/core/query/query_settings/query_shape_hash_in_profiler.js @@ -10,7 +10,7 @@ // simulate_atlas_proxy_incompatible, // requires_fcv_80, // ] -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const collName = "test"; const qsutils = new QuerySettingsUtils(db, collName); diff --git a/jstests/core/query/query_settings/query_shape_hash_in_slow_query_logs.js b/jstests/core/query/query_settings/query_shape_hash_in_slow_query_logs.js index fb136d6f7e9..9645a13bf8b 100644 --- a/jstests/core/query/query_settings/query_shape_hash_in_slow_query_logs.js +++ b/jstests/core/query/query_settings/query_shape_hash_in_slow_query_logs.js @@ -16,7 +16,7 @@ // simulate_atlas_proxy_incompatible, // requires_fcv_80, // ] -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const collName = "test"; const qsutils = new QuerySettingsUtils(db, collName); diff --git a/jstests/core/query/queryable_encryption/query_settings_fle.js b/jstests/core/query/queryable_encryption/query_settings_fle.js index 68ad7f03fc7..f4110d03cc5 100644 --- a/jstests/core/query/queryable_encryption/query_settings_fle.js +++ b/jstests/core/query/queryable_encryption/query_settings_fle.js @@ -13,7 +13,7 @@ * ] */ import {EncryptedClient, kSafeContentField} from "jstests/fle2/libs/encrypted_client_util.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const buildInfo = assert.commandWorked(db.runCommand({"buildInfo": 1})); diff --git a/jstests/core/query/record_store_count.js b/jstests/core/query/record_store_count.js index 0047e5c419b..60b7e1e7a17 100644 --- a/jstests/core/query/record_store_count.js +++ b/jstests/core/query/record_store_count.js @@ -6,8 +6,8 @@ * ] */ -import {planHasStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; var coll = db.record_store_count; coll.drop(); diff --git a/jstests/core/query/regex/regex.js b/jstests/core/query/regex/regex.js index d5c61114fa6..c8b57f07976 100644 --- a/jstests/core/query/regex/regex.js +++ b/jstests/core/query/regex/regex.js @@ -1,7 +1,7 @@ // @tags: [ // assumes_read_concern_local, // ] -import {getQueryPlanner} from "jstests/libs/analyze_plan.js"; +import {getQueryPlanner} from "jstests/libs/query/analyze_plan.js"; const t = db.jstests_regex; diff --git a/jstests/core/query/regex/regex_distinct.js b/jstests/core/query/regex/regex_distinct.js index 2f46681a740..9290603f3f6 100644 --- a/jstests/core/query/regex/regex_distinct.js +++ b/jstests/core/query/regex/regex_distinct.js @@ -7,8 +7,8 @@ * ] */ -import {getPlanStages} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.regex_distinct; coll.drop(); diff --git a/jstests/core/query/return_key.js b/jstests/core/query/return_key.js index c23ff7800c0..a29764bd37b 100644 --- a/jstests/core/query/return_key.js +++ b/jstests/core/query/return_key.js @@ -8,7 +8,7 @@ /** * Tests for returnKey. */ -import {isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly} from "jstests/libs/query/analyze_plan.js"; var results; var explain; diff --git a/jstests/core/query/sbe/plan_cache_sbe_with_or_queries.js b/jstests/core/query/sbe/plan_cache_sbe_with_or_queries.js index 7853be1202e..1af9457f6d8 100644 --- a/jstests/core/query/sbe/plan_cache_sbe_with_or_queries.js +++ b/jstests/core/query/sbe/plan_cache_sbe_with_or_queries.js @@ -15,7 +15,11 @@ // featureFlagSbeFull, // ] -import {getPlanCacheKeyFromShape, getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import { + getPlanCacheKeyFromShape, + getWinningPlan, + planHasStage +} from "jstests/libs/query/analyze_plan.js"; function getPlanCacheEntries(query, collection, db) { const planCacheKey = getPlanCacheKeyFromShape({query, collection, db}); diff --git a/jstests/core/query/sbe/sbe_explain_rejected_plans.js b/jstests/core/query/sbe/sbe_explain_rejected_plans.js index 25e9dfdc4b8..0d6cbed1af8 100644 --- a/jstests/core/query/sbe/sbe_explain_rejected_plans.js +++ b/jstests/core/query/sbe/sbe_explain_rejected_plans.js @@ -5,16 +5,16 @@ * requires_fcv_63, * ] */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import { getExecutionStages, getPlanStages, getRejectedPlan, getRejectedPlans, getWinningPlan, -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const isSBEEnabled = checkSbeFullyEnabled(db); if (!isSBEEnabled) { diff --git a/jstests/core/query/sbe/sbe_ixscan_explain.js b/jstests/core/query/sbe/sbe_ixscan_explain.js index e108afc8fba..d5a3cbb4225 100644 --- a/jstests/core/query/sbe/sbe_ixscan_explain.js +++ b/jstests/core/query/sbe/sbe_ixscan_explain.js @@ -8,7 +8,7 @@ // featureFlagSbeFull, // ] -import {getPlanStages, getQueryPlanner, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getQueryPlanner, isIxscan} from "jstests/libs/query/analyze_plan.js"; function assertStageContainsIndexName(stage) { assert(stage.hasOwnProperty("indexName")); diff --git a/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_collscan.js b/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_collscan.js index 40035c552b5..453a0c0585f 100644 --- a/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_collscan.js +++ b/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_collscan.js @@ -20,7 +20,7 @@ * featureFlagSbeFull, * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; const coll = db.sbe_plan_cache_autoparameterize_collscan; coll.drop(); diff --git a/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_ixscan.js b/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_ixscan.js index 6c5e430d7d4..67449cacb1e 100644 --- a/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_ixscan.js +++ b/jstests/core/query/sbe/sbe_plan_cache_autoparameterize_ixscan.js @@ -22,7 +22,7 @@ import { getPlanCacheKeyFromExplain, getPlanCacheShapeHashFromExplain, getPlanCacheShapeHashFromObject -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/core/query/sbe/sbe_plan_cache_duplicate_or_clauses.js b/jstests/core/query/sbe/sbe_plan_cache_duplicate_or_clauses.js index 6daea253c75..40cbf17adef 100644 --- a/jstests/core/query/sbe/sbe_plan_cache_duplicate_or_clauses.js +++ b/jstests/core/query/sbe/sbe_plan_cache_duplicate_or_clauses.js @@ -22,11 +22,11 @@ * ] */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { getPlanCacheShapeHashFromExplain, getPlanCacheShapeHashFromObject -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = assertDropAndRecreateCollection(db, "sbe_plan_cache_duplicate_or_clauses"); const planCacheShapeHashSet = new Set(); diff --git a/jstests/core/query/single_field_hashed_index.js b/jstests/core/query/single_field_hashed_index.js index 63fa3e9d42a..ef8c1b277dc 100644 --- a/jstests/core/query/single_field_hashed_index.js +++ b/jstests/core/query/single_field_hashed_index.js @@ -7,7 +7,7 @@ * requires_fastcount, * ] */ -import {getWinningPlan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const t = db.single_field_hashed_index; t.drop(); diff --git a/jstests/core/query/sort/sort_array.js b/jstests/core/query/sort/sort_array.js index 3dd52164c84..b7c43b0d711 100644 --- a/jstests/core/query/sort/sort_array.js +++ b/jstests/core/query/sort/sort_array.js @@ -6,7 +6,7 @@ /** * Tests for sorting documents by fields that contain arrays. */ -import {aggPlanHasStage, isQueryPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage, isQueryPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; let coll = db.jstests_array_sort; diff --git a/jstests/core/query/sort/sort_merge.js b/jstests/core/query/sort/sort_merge.js index d31fd5bc508..ad8f3a9affb 100644 --- a/jstests/core/query/sort/sort_merge.js +++ b/jstests/core/query/sort/sort_merge.js @@ -5,8 +5,13 @@ * assumes_read_concern_local, * ] */ -import {getPlanStage, getPlanStages, isIndexOnly, isIxscan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + getPlanStage, + getPlanStages, + isIndexOnly, + isIxscan +} from "jstests/libs/query/analyze_plan.js"; const collNamePrefix = 'sort_merge_'; let collCount = 0; diff --git a/jstests/core/query/sort/sort_merge_collation.js b/jstests/core/query/sort/sort_merge_collation.js index 015b41fedd8..8ada8678f36 100644 --- a/jstests/core/query/sort/sort_merge_collation.js +++ b/jstests/core/query/sort/sort_merge_collation.js @@ -5,7 +5,7 @@ * assumes_no_implicit_collection_creation_after_drop, * ] */ -import {getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; const numericOrdering = { collation: {locale: "en_US", numericOrdering: true} diff --git a/jstests/core/query/sparse_index_supports_ne_null.js b/jstests/core/query/sparse_index_supports_ne_null.js index dcdd45adfb0..9d3da14e256 100644 --- a/jstests/core/query/sparse_index_supports_ne_null.js +++ b/jstests/core/query/sparse_index_supports_ne_null.js @@ -11,7 +11,7 @@ * requires_fcv_80, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.sparse_index_supports_ne_null; coll.drop(); diff --git a/jstests/core/query/text_covered_matching.js b/jstests/core/query/text_covered_matching.js index 446502e8763..19f2077f8d6 100644 --- a/jstests/core/query/text_covered_matching.js +++ b/jstests/core/query/text_covered_matching.js @@ -12,7 +12,7 @@ // assumes_read_concern_local, // ] -import {getPlanStages, getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.text_covered_matching; diff --git a/jstests/core/query/type/null_undefined.js b/jstests/core/query/type/null_undefined.js index e7b3a3dafc4..71ae3d65e0a 100644 --- a/jstests/core/query/type/null_undefined.js +++ b/jstests/core/query/type/null_undefined.js @@ -9,7 +9,7 @@ */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {isCollscan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {isCollscan, isIxscan} from "jstests/libs/query/analyze_plan.js"; const coll = db[jsTestName()]; coll.drop(); diff --git a/jstests/core/timeseries/bucket_unpacking_group_reorder_fixed_buckets.js b/jstests/core/timeseries/bucket_unpacking_group_reorder_fixed_buckets.js index dd7a1410d76..e27676e14b1 100644 --- a/jstests/core/timeseries/bucket_unpacking_group_reorder_fixed_buckets.js +++ b/jstests/core/timeseries/bucket_unpacking_group_reorder_fixed_buckets.js @@ -24,7 +24,7 @@ * ] */ -import {getAggPlanStage, getEngine, getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getEngine, getPlanStage} from "jstests/libs/query/analyze_plan.js"; (function() { "use strict"; diff --git a/jstests/core/timeseries/bucket_unpacking_with_match_fixed_buckets.js b/jstests/core/timeseries/bucket_unpacking_with_match_fixed_buckets.js index 4a638e7fd00..ff19b9738e1 100644 --- a/jstests/core/timeseries/bucket_unpacking_with_match_fixed_buckets.js +++ b/jstests/core/timeseries/bucket_unpacking_with_match_fixed_buckets.js @@ -18,7 +18,7 @@ * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.bucket_unpack_with_match_fixed_buckets; const metaField = "mt"; diff --git a/jstests/core/timeseries/bucket_unpacking_with_sort_extended_range.js b/jstests/core/timeseries/bucket_unpacking_with_sort_extended_range.js index 0a1c9792fb8..fec296c8f26 100644 --- a/jstests/core/timeseries/bucket_unpacking_with_sort_extended_range.js +++ b/jstests/core/timeseries/bucket_unpacking_with_sort_extended_range.js @@ -20,8 +20,8 @@ * requires_getmore, * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; function getNonConfigShards() { const shards = db.getSiblingDB('config').shards.find({_id: {$ne: "config"}}).toArray(); diff --git a/jstests/core/timeseries/bucket_unpacking_with_sort_plan_cache.js b/jstests/core/timeseries/bucket_unpacking_with_sort_plan_cache.js index f495014d6e0..393f6c95672 100644 --- a/jstests/core/timeseries/bucket_unpacking_with_sort_plan_cache.js +++ b/jstests/core/timeseries/bucket_unpacking_with_sort_plan_cache.js @@ -23,12 +23,12 @@ * assumes_balancer_off, * ] */ +import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; import { getAggPlanStage, getAggPlanStages, getPlanCacheKeyFromExplain -} from "jstests/libs/analyze_plan.js"; -import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +} from "jstests/libs/query/analyze_plan.js"; const fields = ["a", "b", "i"]; diff --git a/jstests/core/timeseries/libs/timeseries_sort_util.js b/jstests/core/timeseries/libs/timeseries_sort_util.js index e91a25ae390..f6d31ba22b7 100644 --- a/jstests/core/timeseries/libs/timeseries_sort_util.js +++ b/jstests/core/timeseries/libs/timeseries_sort_util.js @@ -4,7 +4,7 @@ import {getExplainedPipelineFromAggregation} from "jstests/aggregation/extras/utils.js"; import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; export const forwardCollscan = { stage: "COLLSCAN", diff --git a/jstests/core/timeseries/libs/timeseries_writes_util.js b/jstests/core/timeseries/libs/timeseries_writes_util.js index 1793c7a6c98..c7499e615f7 100644 --- a/jstests/core/timeseries/libs/timeseries_writes_util.js +++ b/jstests/core/timeseries/libs/timeseries_writes_util.js @@ -2,7 +2,11 @@ * Helpers for testing timeseries arbitrary writes. */ -import {getExecutionStages, getPlanStage, getQueryPlanner} from "jstests/libs/analyze_plan.js"; +import { + getExecutionStages, + getPlanStage, + getQueryPlanner +} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; export const timeFieldName = "time"; diff --git a/jstests/core/timeseries/nondefault_collation.js b/jstests/core/timeseries/nondefault_collation.js index 8fe75d386b5..b76665eef71 100644 --- a/jstests/core/timeseries/nondefault_collation.js +++ b/jstests/core/timeseries/nondefault_collation.js @@ -22,7 +22,7 @@ * cannot_run_during_upgrade_downgrade, * ] */ -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_nondefault_collation; const bucketsColl = db.getCollection('system.buckets.' + coll.getName()); diff --git a/jstests/core/timeseries/partialFilterExpression_with_internalBucketGeoWithin.js b/jstests/core/timeseries/partialFilterExpression_with_internalBucketGeoWithin.js index a16a580ad3a..d7486212e66 100644 --- a/jstests/core/timeseries/partialFilterExpression_with_internalBucketGeoWithin.js +++ b/jstests/core/timeseries/partialFilterExpression_with_internalBucketGeoWithin.js @@ -11,8 +11,8 @@ * ] */ -import {getWinningPlan, isCollscan, isIxscan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getWinningPlan, isCollscan, isIxscan} from "jstests/libs/query/analyze_plan.js"; import {IndexBuildTest} from "jstests/noPassthrough/libs/index_build.js"; const timeFieldName = "timestamp"; diff --git a/jstests/core/timeseries/timeseries_block_explain.js b/jstests/core/timeseries/timeseries_block_explain.js index 143534412aa..886b94d798d 100644 --- a/jstests/core/timeseries/timeseries_block_explain.js +++ b/jstests/core/timeseries/timeseries_block_explain.js @@ -11,10 +11,10 @@ * directly_against_shardsvrs_incompatible, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {getSbePlanStages} from "jstests/libs/sbe_explain_helpers.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {getSbePlanStages} from "jstests/libs/query/sbe_explain_helpers.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const sbeEnabled = checkSbeFullyEnabled(db) && FeatureFlagUtil.isPresentAndEnabled(db.getMongo(), 'TimeSeriesInSbe'); diff --git a/jstests/core/timeseries/timeseries_bucket_index.js b/jstests/core/timeseries/timeseries_bucket_index.js index a0fa51d258c..622b9c770f6 100644 --- a/jstests/core/timeseries/timeseries_bucket_index.js +++ b/jstests/core/timeseries/timeseries_bucket_index.js @@ -11,7 +11,7 @@ * ] */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getWinningPlan, isIdhackOrExpress, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isIdhackOrExpress, planHasStage} from "jstests/libs/query/analyze_plan.js"; TimeseriesTest.run((insert) => { const coll = db.timeseries_bucket_index; diff --git a/jstests/core/timeseries/timeseries_bucket_level_filter.js b/jstests/core/timeseries/timeseries_bucket_level_filter.js index bc0aa506cdc..71ef6da1b0f 100644 --- a/jstests/core/timeseries/timeseries_bucket_level_filter.js +++ b/jstests/core/timeseries/timeseries_bucket_level_filter.js @@ -12,8 +12,8 @@ * ] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStage, getEngine} from "jstests/libs/analyze_plan.js"; -import {getSbePlanStages} from "jstests/libs/sbe_explain_helpers.js"; +import {getAggPlanStage, getEngine} from "jstests/libs/query/analyze_plan.js"; +import {getSbePlanStages} from "jstests/libs/query/sbe_explain_helpers.js"; const coll = db.timeseries_bucket_level_filter; coll.drop(); diff --git a/jstests/core/timeseries/timeseries_delete_with_meta.js b/jstests/core/timeseries/timeseries_delete_with_meta.js index 060c7f4fd61..cc6ebf8769e 100644 --- a/jstests/core/timeseries/timeseries_delete_with_meta.js +++ b/jstests/core/timeseries/timeseries_delete_with_meta.js @@ -12,8 +12,8 @@ * ] */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {planHasStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB(jsTestName()); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/core/timeseries/timeseries_explain_delete.js b/jstests/core/timeseries/timeseries_explain_delete.js index 9eeceb97be3..d13cf4ec8a6 100644 --- a/jstests/core/timeseries/timeseries_explain_delete.js +++ b/jstests/core/timeseries/timeseries_explain_delete.js @@ -9,8 +9,8 @@ * ] */ -import {getExecutionStages, getPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getExecutionStages, getPlanStage} from "jstests/libs/query/analyze_plan.js"; const timeFieldName = "time"; const metaFieldName = "tag"; diff --git a/jstests/core/timeseries/timeseries_explain_update.js b/jstests/core/timeseries/timeseries_explain_update.js index 1c89438ae60..db064f37e8f 100644 --- a/jstests/core/timeseries/timeseries_explain_update.js +++ b/jstests/core/timeseries/timeseries_explain_update.js @@ -20,7 +20,7 @@ import { prepareCollection, timeFieldName } from "jstests/core/timeseries/libs/timeseries_writes_util.js"; -import {getExecutionStages, getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getExecutionStages, getPlanStage} from "jstests/libs/query/analyze_plan.js"; const dateTime = ISODate("2021-07-12T16:00:00Z"); diff --git a/jstests/core/timeseries/timeseries_findAndModify_deletes_hints.js b/jstests/core/timeseries/timeseries_findAndModify_deletes_hints.js index 0a681e2287e..ebc3112fccd 100644 --- a/jstests/core/timeseries/timeseries_findAndModify_deletes_hints.js +++ b/jstests/core/timeseries/timeseries_findAndModify_deletes_hints.js @@ -10,7 +10,7 @@ * does_not_support_retryable_writes * ] */ -import {getWinningPlanFromExplain} from 'jstests/libs/analyze_plan.js'; +import {getWinningPlanFromExplain} from 'jstests/libs/query/analyze_plan.js'; const timeFieldName = "time"; const metaFieldName = "tag"; diff --git a/jstests/core/timeseries/timeseries_findAndModify_updates_hints.js b/jstests/core/timeseries/timeseries_findAndModify_updates_hints.js index 5c473491f3a..8e4612d8930 100644 --- a/jstests/core/timeseries/timeseries_findAndModify_updates_hints.js +++ b/jstests/core/timeseries/timeseries_findAndModify_updates_hints.js @@ -11,7 +11,7 @@ * ] */ -import {getWinningPlanFromExplain} from 'jstests/libs/analyze_plan.js'; +import {getWinningPlanFromExplain} from 'jstests/libs/query/analyze_plan.js'; const timeFieldName = "time"; const metaFieldName = "tag"; diff --git a/jstests/core/timeseries/timeseries_geonear_measurements.js b/jstests/core/timeseries/timeseries_geonear_measurements.js index d5434a1ab03..aee092cdf77 100644 --- a/jstests/core/timeseries/timeseries_geonear_measurements.js +++ b/jstests/core/timeseries/timeseries_geonear_measurements.js @@ -25,9 +25,9 @@ * ] */ -import {aggPlanHasStage, getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {aggPlanHasStage, getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; Random.setRandomSeed(); diff --git a/jstests/core/timeseries/timeseries_group.js b/jstests/core/timeseries/timeseries_group.js index 2659098ec7e..006abd96880 100644 --- a/jstests/core/timeseries/timeseries_group.js +++ b/jstests/core/timeseries/timeseries_group.js @@ -14,22 +14,22 @@ * ] */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getEngine, getQueryPlanner, getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getEngine, getQueryPlanner, getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; import { blockProcessingTestCases, generateMetaVals -} from "jstests/libs/block_processing_test_cases.js"; -import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +} from "jstests/libs/query/block_processing_test_cases.js"; import { checkSbeFullFeatureFlagEnabled, checkSbeStatus, kSbeDisabled, kSbeFullyEnabled -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; TimeseriesTest.run((insert) => { const datePrefix = 1680912440; diff --git a/jstests/core/timeseries/timeseries_hint.js b/jstests/core/timeseries/timeseries_hint.js index 2711a72ae5e..4a00306a80d 100644 --- a/jstests/core/timeseries/timeseries_hint.js +++ b/jstests/core/timeseries/timeseries_hint.js @@ -13,8 +13,8 @@ * requires_timeseries, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {exhaustFindCursorAndReturnResults} from "jstests/libs/find_cmd_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_hint; coll.drop(); diff --git a/jstests/core/timeseries/timeseries_id_range.js b/jstests/core/timeseries/timeseries_id_range.js index f540008e946..43721ae53b7 100644 --- a/jstests/core/timeseries/timeseries_id_range.js +++ b/jstests/core/timeseries/timeseries_id_range.js @@ -19,7 +19,11 @@ * ] */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getAggPlanStage, getPlanStage, getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import { + getAggPlanStage, + getPlanStage, + getSingleNodeExplain +} from "jstests/libs/query/analyze_plan.js"; TimeseriesTest.run((insert) => { // These dates will all be inserted into individual buckets. diff --git a/jstests/core/timeseries/timeseries_index_partial.js b/jstests/core/timeseries/timeseries_index_partial.js index 85ef2461b5d..1d2b387b69d 100644 --- a/jstests/core/timeseries/timeseries_index_partial.js +++ b/jstests/core/timeseries/timeseries_index_partial.js @@ -14,14 +14,14 @@ * cannot_run_during_upgrade_downgrade, * ] */ +import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getAggPlanStage, getPlanStages, getRejectedPlan, getRejectedPlans -} from "jstests/libs/analyze_plan.js"; -import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_index_partial; const timeField = 'time'; diff --git a/jstests/core/timeseries/timeseries_index_use.js b/jstests/core/timeseries/timeseries_index_use.js index 1b555d763ed..a0877b86167 100644 --- a/jstests/core/timeseries/timeseries_index_use.js +++ b/jstests/core/timeseries/timeseries_index_use.js @@ -14,13 +14,13 @@ * ] */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; +import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; import { getAggPlanStage, getPlanStages, getRejectedPlan, getRejectedPlans -} from "jstests/libs/analyze_plan.js"; -import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +} from "jstests/libs/query/analyze_plan.js"; const generateTest = (useHint) => { return (insert) => { diff --git a/jstests/core/timeseries/timeseries_internal_bounded_sort.js b/jstests/core/timeseries/timeseries_internal_bounded_sort.js index f55ff51a2e5..4ba40575089 100644 --- a/jstests/core/timeseries/timeseries_internal_bounded_sort.js +++ b/jstests/core/timeseries/timeseries_internal_bounded_sort.js @@ -19,7 +19,7 @@ * ] */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_internal_bounded_sort; const buckets = db['system.buckets.' + coll.getName()]; diff --git a/jstests/core/timeseries/timeseries_internal_bounded_sort_compound.js b/jstests/core/timeseries/timeseries_internal_bounded_sort_compound.js index eef65d939be..dee92a84385 100644 --- a/jstests/core/timeseries/timeseries_internal_bounded_sort_compound.js +++ b/jstests/core/timeseries/timeseries_internal_bounded_sort_compound.js @@ -20,7 +20,7 @@ * ] */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_internal_bounded_sort_compound; const buckets = db['system.buckets.' + coll.getName()]; diff --git a/jstests/core/timeseries/timeseries_internal_bounded_sort_compound_mixed_types.js b/jstests/core/timeseries/timeseries_internal_bounded_sort_compound_mixed_types.js index 06f34adb651..edc23786e9a 100644 --- a/jstests/core/timeseries/timeseries_internal_bounded_sort_compound_mixed_types.js +++ b/jstests/core/timeseries/timeseries_internal_bounded_sort_compound_mixed_types.js @@ -12,7 +12,7 @@ * requires_getmore, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_internal_bounded_sort_compound_mixed_types; const buckets = db['system.buckets.' + coll.getName()]; diff --git a/jstests/core/timeseries/timeseries_internal_bounded_sort_overflow.js b/jstests/core/timeseries/timeseries_internal_bounded_sort_overflow.js index 9731b1311c7..8393fbf9156 100644 --- a/jstests/core/timeseries/timeseries_internal_bounded_sort_overflow.js +++ b/jstests/core/timeseries/timeseries_internal_bounded_sort_overflow.js @@ -11,7 +11,7 @@ * requires_timeseries, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_internal_bounded_sort_overflow; const buckets = db['system.buckets.' + coll.getName()]; diff --git a/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js b/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js index 610893ff4f2..02ecb5f14f0 100644 --- a/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js +++ b/jstests/core/timeseries/timeseries_internal_bucket_geo_within.js @@ -18,7 +18,7 @@ * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_internal_bucket_geo_within; coll.drop(); diff --git a/jstests/core/timeseries/timeseries_lastpoint.js b/jstests/core/timeseries/timeseries_lastpoint.js index 43d8eea2f47..8af9c1d1c72 100644 --- a/jstests/core/timeseries/timeseries_lastpoint.js +++ b/jstests/core/timeseries/timeseries_lastpoint.js @@ -47,7 +47,7 @@ import { getPlanStage, getSingleNodeExplain, isAggregationPlan -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_lastpoint; const bucketsColl = db.system.buckets.timeseries_lastpoint; diff --git a/jstests/core/timeseries/timeseries_lastpoint_common_sort_key.js b/jstests/core/timeseries/timeseries_lastpoint_common_sort_key.js index 1d142848100..8e674a52ab7 100644 --- a/jstests/core/timeseries/timeseries_lastpoint_common_sort_key.js +++ b/jstests/core/timeseries/timeseries_lastpoint_common_sort_key.js @@ -20,7 +20,7 @@ */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getEngine, getPlanStage, getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import {getEngine, getPlanStage, getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_lastpoint_common_sort_key; const bucketsColl = db.system.buckets.timeseries_lastpoint_common_sort_key; diff --git a/jstests/core/timeseries/timeseries_match.js b/jstests/core/timeseries/timeseries_match.js index b005245e7d4..cab990c699e 100644 --- a/jstests/core/timeseries/timeseries_match.js +++ b/jstests/core/timeseries/timeseries_match.js @@ -16,9 +16,9 @@ */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getEngine, getQueryPlanner, getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getEngine, getQueryPlanner, getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; TimeseriesTest.run((insert) => { const datePrefix = 1680912440; diff --git a/jstests/core/timeseries/timeseries_match_pushdown.js b/jstests/core/timeseries/timeseries_match_pushdown.js index 567d7adcef0..8b4a2f874f8 100644 --- a/jstests/core/timeseries/timeseries_match_pushdown.js +++ b/jstests/core/timeseries/timeseries_match_pushdown.js @@ -9,7 +9,7 @@ * directly_against_shardsvrs_incompatible, * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_match_pushdown; const timeField = 'time'; diff --git a/jstests/core/timeseries/timeseries_match_pushdown_with_project.js b/jstests/core/timeseries/timeseries_match_pushdown_with_project.js index 92439bb32fe..c2224f75203 100644 --- a/jstests/core/timeseries/timeseries_match_pushdown_with_project.js +++ b/jstests/core/timeseries/timeseries_match_pushdown_with_project.js @@ -8,8 +8,8 @@ * directly_against_shardsvrs_incompatible, * ] */ -import {getAggPlanStages, getEngine, getPlanStage} from "jstests/libs/analyze_plan.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStages, getEngine, getPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db.timeseries_match_pushdown_with_project; const timeField = 'time'; diff --git a/jstests/core/timeseries/timeseries_metric_index_2dsphere.js b/jstests/core/timeseries/timeseries_metric_index_2dsphere.js index d6b031a4b6a..5d7ad563185 100644 --- a/jstests/core/timeseries/timeseries_metric_index_2dsphere.js +++ b/jstests/core/timeseries/timeseries_metric_index_2dsphere.js @@ -17,7 +17,7 @@ */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; TimeseriesTest.run((insert) => { const testdb = db.getSiblingDB("timeseries_metric_index_2dsphere_db"); diff --git a/jstests/core/timeseries/timeseries_partial_index_opt.js b/jstests/core/timeseries/timeseries_partial_index_opt.js index 40c649bb61f..fb04b8f4185 100644 --- a/jstests/core/timeseries/timeseries_partial_index_opt.js +++ b/jstests/core/timeseries/timeseries_partial_index_opt.js @@ -14,7 +14,7 @@ * requires_fcv_70, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.timeseries_partial_index_opt; diff --git a/jstests/core/timeseries/timeseries_sbe.js b/jstests/core/timeseries/timeseries_sbe.js index 041075a8874..cbb580b22ad 100644 --- a/jstests/core/timeseries/timeseries_sbe.js +++ b/jstests/core/timeseries/timeseries_sbe.js @@ -15,9 +15,13 @@ * assumes_standalone_mongod * ] */ -import {getAggPlanStages, getEngine} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeStatus, kFeatureFlagSbeFullEnabled, kSbeDisabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStages, getEngine} from "jstests/libs/query/analyze_plan.js"; +import { + checkSbeStatus, + kFeatureFlagSbeFullEnabled, + kSbeDisabled +} from "jstests/libs/query/sbe_util.js"; // We pushdown unpack when checkSbeRestrictedOrFullyEnabled is true and when // featureFlagTimeSeriesInSbe is set. diff --git a/jstests/core/timeseries/timeseries_special_indexes_metadata.js b/jstests/core/timeseries/timeseries_special_indexes_metadata.js index 34044c160ed..170121f6c63 100644 --- a/jstests/core/timeseries/timeseries_special_indexes_metadata.js +++ b/jstests/core/timeseries/timeseries_special_indexes_metadata.js @@ -16,8 +16,8 @@ */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getPlanStage, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStage, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; TimeseriesTest.run((insert) => { const testdb = db.getSiblingDB("timeseries_special_indexes_db"); diff --git a/jstests/core/timeseries/timeseries_streaming_group.js b/jstests/core/timeseries/timeseries_streaming_group.js index 9498ca19c02..99eac1bd551 100644 --- a/jstests/core/timeseries/timeseries_streaming_group.js +++ b/jstests/core/timeseries/timeseries_streaming_group.js @@ -10,7 +10,7 @@ * requires_timeseries, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const ts = db.timeseries_streaming_group; ts.drop(); diff --git a/jstests/core/timeseries/top_k_sort_optimization.js b/jstests/core/timeseries/top_k_sort_optimization.js index aaf628276f9..02d46da78b5 100644 --- a/jstests/core/timeseries/top_k_sort_optimization.js +++ b/jstests/core/timeseries/top_k_sort_optimization.js @@ -47,7 +47,7 @@ import { getEngine, getPlanStages, getSingleNodeExplain -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const testDB = db.getSiblingDB(jsTestName()); assert.commandWorked(testDB.dropDatabase()); diff --git a/jstests/core/validate_commands_after_coll_drop.js b/jstests/core/validate_commands_after_coll_drop.js index a20d2372715..a225f2458e2 100644 --- a/jstests/core/validate_commands_after_coll_drop.js +++ b/jstests/core/validate_commands_after_coll_drop.js @@ -13,7 +13,7 @@ * ] */ -import {getWinningPlanFromExplain, isEofPlan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlanFromExplain, isEofPlan} from "jstests/libs/query/analyze_plan.js"; const docs = [{a: 1}, {a: 2}, {a: 2}, {a: 3}]; const dbName = "validate_commands_after_coll_drop_db"; diff --git a/jstests/core/views/views_aggregation.js b/jstests/core/views/views_aggregation.js index 0eca91f76b9..9aa9e3f3574 100644 --- a/jstests/core/views/views_aggregation.js +++ b/jstests/core/views/views_aggregation.js @@ -23,11 +23,11 @@ import {assertMergeFailsForAllModesWithCode} from "jstests/aggregation/extras/merge_helpers.js"; import {arrayEq, assertErrorCode, orderedArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; import { FixtureHelpers } from "jstests/libs/fixture_helpers.js"; // For arrayEq, assertErrorCode, and -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const sbeEnabled = checkSbeFullyEnabled(db); diff --git a/jstests/core/views/views_collation.js b/jstests/core/views/views_collation.js index 5fd538a794e..256c9ea26c0 100644 --- a/jstests/core/views/views_collation.js +++ b/jstests/core/views/views_collation.js @@ -10,7 +10,7 @@ /** * Tests the behavior of operations when interacting with a view's default collation. */ -import {getAggPlanStage, getAllNodeExplains} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getAllNodeExplains} from "jstests/libs/query/analyze_plan.js"; let viewsDB = db.getSiblingDB("views_collation"); assert.commandWorked(viewsDB.dropDatabase()); diff --git a/jstests/core/views/views_count.js b/jstests/core/views/views_count.js index b04c80e871e..f9a70c020c0 100644 --- a/jstests/core/views/views_count.js +++ b/jstests/core/views/views_count.js @@ -8,8 +8,8 @@ // requires_fcv_63, // ] -import {getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const sbeEnabled = checkSbeRestrictedOrFullyEnabled(db); diff --git a/jstests/core/views/views_distinct.js b/jstests/core/views/views_distinct.js index 6402a011d77..f9bd0c4675f 100644 --- a/jstests/core/views/views_distinct.js +++ b/jstests/core/views/views_distinct.js @@ -16,7 +16,7 @@ import { getPlanStage, getWinningPlan, hasRejectedPlans -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; const isHintsToQuerySettingsSuite = TestData.isHintsToQuerySettingsSuite || false; diff --git a/jstests/core/views/views_find.js b/jstests/core/views/views_find.js index 916a5107db0..e84b7b3a88c 100644 --- a/jstests/core/views/views_find.js +++ b/jstests/core/views/views_find.js @@ -10,7 +10,7 @@ * ] */ import {arrayEq, orderedArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import {getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; let viewsDB = db.getSiblingDB("views_find"); assert.commandWorked(viewsDB.dropDatabase()); diff --git a/jstests/core/write/delete/delete_hint.js b/jstests/core/write/delete/delete_hint.js index 9d1e6eb88f5..7171c0fce17 100644 --- a/jstests/core/write/delete/delete_hint.js +++ b/jstests/core/write/delete/delete_hint.js @@ -10,7 +10,7 @@ * ] */ -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; function assertCommandUsesIndex(command, expectedHintKeyPattern) { const out = assert.commandWorked(coll.runCommand({explain: command})); diff --git a/jstests/core/write/find_and_modify/find_and_modify_hint.js b/jstests/core/write/find_and_modify/find_and_modify_hint.js index 0350000f533..d85c08170ea 100644 --- a/jstests/core/write/find_and_modify/find_and_modify_hint.js +++ b/jstests/core/write/find_and_modify/find_and_modify_hint.js @@ -9,7 +9,7 @@ * ] */ -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; function assertCommandUsesIndex(command, expectedHintKeyPattern) { const out = assert.commandWorked(coll.runCommand({explain: command})); diff --git a/jstests/core/write/find_and_modify/find_and_modify_pipeline_update.js b/jstests/core/write/find_and_modify/find_and_modify_pipeline_update.js index 07afce00e2a..fcca3d92606 100644 --- a/jstests/core/write/find_and_modify/find_and_modify_pipeline_update.js +++ b/jstests/core/write/find_and_modify/find_and_modify_pipeline_update.js @@ -2,8 +2,8 @@ * Tests the pipeline-style update is accepted by the findAndModify command. * @tags: [requires_non_retryable_writes] */ -import {getPlanStage, planHasStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStage, planHasStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.find_and_modify_pipeline_update; coll.drop(); diff --git a/jstests/core/write/update/updateOne_sort.js b/jstests/core/write/update/updateOne_sort.js index bde215b7cf4..653d6785372 100644 --- a/jstests/core/write/update/updateOne_sort.js +++ b/jstests/core/write/update/updateOne_sort.js @@ -11,7 +11,7 @@ * ] */ import {isMongos} from "jstests/concurrency/fsm_workload_helpers/server_types.js"; -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; var coll = db.getCollection("update_sort_test"); diff --git a/jstests/core/write/update/update_hint.js b/jstests/core/write/update/update_hint.js index a834fd0bb46..52d0643e23b 100644 --- a/jstests/core/write/update/update_hint.js +++ b/jstests/core/write/update/update_hint.js @@ -7,7 +7,7 @@ * @tags: [assumes_unsharded_collection, requires_multi_updates, requires_non_retryable_writes] */ -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; function assertCommandUsesIndex(command, expectedHintKeyPattern) { const out = assert.commandWorked(coll.runCommand({explain: command})); diff --git a/jstests/core/write/update/update_pipeline_shell_helpers.js b/jstests/core/write/update/update_pipeline_shell_helpers.js index 867b1229b87..35fb6f81d0c 100644 --- a/jstests/core/write/update/update_pipeline_shell_helpers.js +++ b/jstests/core/write/update/update_pipeline_shell_helpers.js @@ -8,8 +8,8 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStage, planHasStage} from "jstests/libs/analyze_plan.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {getPlanStage, planHasStage} from "jstests/libs/query/analyze_plan.js"; // Make sure that the test collection is empty before starting the test. const testColl = db.update_pipeline_shell_helpers_test; diff --git a/jstests/core/write/write_change_stream_pit_preimage.js b/jstests/core/write/write_change_stream_pit_preimage.js index 3f2278d62a0..f3ad4fd2a16 100644 --- a/jstests/core/write/write_change_stream_pit_preimage.js +++ b/jstests/core/write/write_change_stream_pit_preimage.js @@ -9,16 +9,16 @@ // no_selinux, // incompatible_with_preimages_by_default, // ] -import { - assertChangeStreamPreAndPostImagesCollectionOptionIsAbsent, - assertChangeStreamPreAndPostImagesCollectionOptionIsEnabled, - preImagesForOps, -} from "jstests/libs/change_stream_util.js"; import { ClusteredCollectionUtil } from "jstests/libs/clustered_collections/clustered_collection_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import { + assertChangeStreamPreAndPostImagesCollectionOptionIsAbsent, + assertChangeStreamPreAndPostImagesCollectionOptionIsEnabled, + preImagesForOps, +} from "jstests/libs/query/change_stream_util.js"; // Pre-images are only recorded in the replica set mode. if (!FixtureHelpers.isReplSet(db)) { diff --git a/jstests/disk/libs/wt_file_helper.js b/jstests/disk/libs/wt_file_helper.js index 41695e61db0..03289c22f83 100644 --- a/jstests/disk/libs/wt_file_helper.js +++ b/jstests/disk/libs/wt_file_helper.js @@ -4,7 +4,7 @@ import { getWinningPlan, isExpress, isIxscan -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; /** * Get the URI of the wt collection file given the collection name. diff --git a/jstests/libs/begin_golden_test.js b/jstests/libs/begin_golden_test.js index 6b4b3009081..882317a4acd 100644 --- a/jstests/libs/begin_golden_test.js +++ b/jstests/libs/begin_golden_test.js @@ -1,4 +1,4 @@ -import {checkSbeStatus} from "jstests/libs/sbe_util.js"; +import {checkSbeStatus} from "jstests/libs/query/sbe_util.js"; // Run any set-up necessary for a golden jstest. This function should be called from the suite // definition, so that individual tests don't need to remember to call it. diff --git a/jstests/libs/ce_stats_utils.js b/jstests/libs/ce_stats_utils.js index 5bddaefe221..cf99a035933 100644 --- a/jstests/libs/ce_stats_utils.js +++ b/jstests/libs/ce_stats_utils.js @@ -3,7 +3,7 @@ import { extractLogicalCEFromNode, getPlanSkeleton, navigateToRootNode, -} from "jstests/libs/optimizer_utils.js"; +} from "jstests/libs/query/optimizer_utils.js"; /** * Returns a simplified skeleton of the physical plan including intervals & logical CE. diff --git a/jstests/libs/clustered_collections/clustered_collection_bounded_scan_common.js b/jstests/libs/clustered_collections/clustered_collection_bounded_scan_common.js index bf837e918c9..4573f7e653d 100644 --- a/jstests/libs/clustered_collections/clustered_collection_bounded_scan_common.js +++ b/jstests/libs/clustered_collections/clustered_collection_bounded_scan_common.js @@ -1,8 +1,8 @@ /** * Validate bounded collection scans on a clustered collection. */ -import {getExecutionStats, getPlanStage} from "jstests/libs/analyze_plan.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {getExecutionStats, getPlanStage} from "jstests/libs/query/analyze_plan.js"; export const testClusteredCollectionBoundedScan = function(coll, clusterKey) { const batchSize = 100; diff --git a/jstests/libs/clustered_collections/clustered_collection_hint_common.js b/jstests/libs/clustered_collections/clustered_collection_hint_common.js index abea9154101..8458fe9319b 100644 --- a/jstests/libs/clustered_collections/clustered_collection_hint_common.js +++ b/jstests/libs/clustered_collections/clustered_collection_hint_common.js @@ -1,8 +1,8 @@ /** * Validate $hint on a clustered collection. */ -import {getPlanStage, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {getPlanStage, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; export function testClusteredCollectionHint(coll, clusterKey, clusterKeyName) { const clusterKeyFieldName = Object.keys(clusterKey)[0]; diff --git a/jstests/libs/override_methods/implicit_query_settings_fallback.js b/jstests/libs/override_methods/implicit_query_settings_fallback.js index 6fdb9e8079d..c72c6a9058c 100644 --- a/jstests/libs/override_methods/implicit_query_settings_fallback.js +++ b/jstests/libs/override_methods/implicit_query_settings_fallback.js @@ -1,8 +1,3 @@ -import { - everyWinningPlan, - getNestedProperties, - isIdhackOrExpress -} from "jstests/libs/analyze_plan.js"; import { getCollectionName, getCommandName, @@ -12,8 +7,13 @@ import { isSystemCollectionName } from "jstests/libs/cmd_object_utils.js"; import {OverrideHelpers} from "jstests/libs/override_methods/override_helpers.js"; -import {QuerySettingsIndexHintsTests} from "jstests/libs/query_settings_index_hints_tests.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import { + everyWinningPlan, + getNestedProperties, + isIdhackOrExpress +} from "jstests/libs/query/analyze_plan.js"; +import {QuerySettingsIndexHintsTests} from "jstests/libs/query/query_settings_index_hints_tests.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; /** * Override which applies 'bad' query settings over supported commands in order to test the fallback diff --git a/jstests/libs/override_methods/implicit_whole_cluster_changestreams.js b/jstests/libs/override_methods/implicit_whole_cluster_changestreams.js index dafa13de449..81740d275cc 100644 --- a/jstests/libs/override_methods/implicit_whole_cluster_changestreams.js +++ b/jstests/libs/override_methods/implicit_whole_cluster_changestreams.js @@ -10,7 +10,7 @@ // For the whole_cluster passthrough, we simply override the necessary methods in the whole_db // passthrough's ChangeStreamPassthroughHelpers. import "jstests/libs/override_methods/implicit_whole_db_changestreams.js"; -import {ChangeStreamWatchMode} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamWatchMode} from "jstests/libs/query/change_stream_util.js"; // Any valid single-collection or single-database request is upconvertable to cluster-wide. globalThis.ChangeStreamPassthroughHelpers.isUpconvertableChangeStreamRequest = diff --git a/jstests/libs/override_methods/implicit_whole_db_changestreams.js b/jstests/libs/override_methods/implicit_whole_db_changestreams.js index d23ca35edfa..cf0fb217b48 100644 --- a/jstests/libs/override_methods/implicit_whole_db_changestreams.js +++ b/jstests/libs/override_methods/implicit_whole_db_changestreams.js @@ -7,8 +7,8 @@ * 'noPassthrough' flag, are passed through as-is. */ -import {ChangeStreamWatchMode} from "jstests/libs/change_stream_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; +import {ChangeStreamWatchMode} from "jstests/libs/query/change_stream_util.js"; // Helper function which tests can call to explicitly request that the command not be modified by // the passthrough code. When defined, ChangeStreamTest will adopt this as its default runCommand diff --git a/jstests/libs/override_methods/make_cursor_hints_into_query_settings.js b/jstests/libs/override_methods/make_cursor_hints_into_query_settings.js index 3a8a65efd4b..0bfe19906f4 100644 --- a/jstests/libs/override_methods/make_cursor_hints_into_query_settings.js +++ b/jstests/libs/override_methods/make_cursor_hints_into_query_settings.js @@ -1,4 +1,3 @@ -import {everyWinningPlan, isIdhackOrExpress} from "jstests/libs/analyze_plan.js"; import { getCollectionName, getCommandName, @@ -6,7 +5,8 @@ import { getInnerCommand } from "jstests/libs/cmd_object_utils.js"; import {OverrideHelpers} from "jstests/libs/override_methods/override_helpers.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {everyWinningPlan, isIdhackOrExpress} from "jstests/libs/query/analyze_plan.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; function isMinMaxQuery(cmdObj) { // When using min()/max() a hint of which index to use must be provided. diff --git a/jstests/libs/override_methods/make_index_filters_into_query_settings.js b/jstests/libs/override_methods/make_index_filters_into_query_settings.js index 9a5855cb7ab..7a629c87e08 100644 --- a/jstests/libs/override_methods/make_index_filters_into_query_settings.js +++ b/jstests/libs/override_methods/make_index_filters_into_query_settings.js @@ -1,6 +1,6 @@ -import {everyWinningPlan, isIdhackOrExpress} from "jstests/libs/analyze_plan.js"; import {getExplainCommand} from "jstests/libs/cmd_object_utils.js"; import {OverrideHelpers} from "jstests/libs/override_methods/override_helpers.js"; +import {everyWinningPlan, isIdhackOrExpress} from "jstests/libs/query/analyze_plan.js"; function addOptionalQueryFields(src, dst) { for (let field of ["projection", "sort", "collation"]) { diff --git a/jstests/libs/pretty_md.js b/jstests/libs/pretty_md.js index 50a8bc87edc..984cbe48adc 100644 --- a/jstests/libs/pretty_md.js +++ b/jstests/libs/pretty_md.js @@ -4,10 +4,10 @@ */ /* eslint-disable no-undef */ +import {normalizeArray, tojsonMultiLineSortKeys} from "jstests/libs/golden_test.js"; import { formatExplainRoot, -} from "jstests/libs/analyze_plan.js"; -import {normalizeArray, tojsonMultiLineSortKeys} from "jstests/libs/golden_test.js"; +} from "jstests/libs/query/analyze_plan.js"; let sectionCount = 1; export function section(msg) { diff --git a/jstests/libs/property_test_helpers/query_properties.js b/jstests/libs/property_test_helpers/query_properties.js index 449e8586f7c..c05366c3d5d 100644 --- a/jstests/libs/property_test_helpers/query_properties.js +++ b/jstests/libs/property_test_helpers/query_properties.js @@ -1,9 +1,9 @@ -import {getRejectedPlans} from "jstests/libs/analyze_plan.js"; import { aggPipelineModel, aggPipelineNoOrsModel, } from "jstests/libs/property_test_helpers/query_models.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getRejectedPlans} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; /* * Properties take the collection we're testing, a list of queries to use during the property test, diff --git a/jstests/libs/query/OWNERS.yml b/jstests/libs/query/OWNERS.yml new file mode 100644 index 00000000000..0c5cef84f6a --- /dev/null +++ b/jstests/libs/query/OWNERS.yml @@ -0,0 +1,32 @@ +version: 1.0.0 +filters: + - "*": + approvers: + - 10gen/query + - "analyze_plan.js": + approvers: + - 10gen/query-optimization + - "aggregation_pipeline_utils.js": + approvers: + - 10gen/query + - "change_stream*.js": + approvers: + - 10gen/query-execution + - "geo*.js": + approvers: + - 10gen/query-integration + - "group_to_distinct_scan_utils.js": + approvers: + - 10gen/query-integration + - "optimizer_utils.js": + approvers: + - 10gen/query-optimization + - "query_settings*.js": + approvers: + - 10gen/query-execution + - "sbe*.js": + approvers: + - 10gen/query-execution + - "wildcard_index_helpers.js": + approvers: + - 10gen/query-optimization diff --git a/jstests/libs/aggregation_pipeline_utils.js b/jstests/libs/query/aggregation_pipeline_utils.js similarity index 100% rename from jstests/libs/aggregation_pipeline_utils.js rename to jstests/libs/query/aggregation_pipeline_utils.js diff --git a/jstests/libs/analyze_plan.js b/jstests/libs/query/analyze_plan.js similarity index 100% rename from jstests/libs/analyze_plan.js rename to jstests/libs/query/analyze_plan.js diff --git a/jstests/libs/block_processing_test_cases.js b/jstests/libs/query/block_processing_test_cases.js similarity index 100% rename from jstests/libs/block_processing_test_cases.js rename to jstests/libs/query/block_processing_test_cases.js diff --git a/jstests/libs/change_stream_rewrite_util.js b/jstests/libs/query/change_stream_rewrite_util.js similarity index 100% rename from jstests/libs/change_stream_rewrite_util.js rename to jstests/libs/query/change_stream_rewrite_util.js diff --git a/jstests/libs/change_stream_util.js b/jstests/libs/query/change_stream_util.js similarity index 100% rename from jstests/libs/change_stream_util.js rename to jstests/libs/query/change_stream_util.js diff --git a/jstests/libs/geo_math.js b/jstests/libs/query/geo_math.js similarity index 100% rename from jstests/libs/geo_math.js rename to jstests/libs/query/geo_math.js diff --git a/jstests/libs/geo_near_random.js b/jstests/libs/query/geo_near_random.js similarity index 100% rename from jstests/libs/geo_near_random.js rename to jstests/libs/query/geo_near_random.js diff --git a/jstests/libs/group_to_distinct_scan_utils.js b/jstests/libs/query/group_to_distinct_scan_utils.js similarity index 98% rename from jstests/libs/group_to_distinct_scan_utils.js rename to jstests/libs/query/group_to_distinct_scan_utils.js index 09c41604dbe..5378874a56d 100644 --- a/jstests/libs/group_to_distinct_scan_utils.js +++ b/jstests/libs/query/group_to_distinct_scan_utils.js @@ -2,7 +2,7 @@ * Common utility functions variables for $group to DISTINCT_SCAN optimization. */ -import {getAggPlanStages, getQueryPlanner} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages, getQueryPlanner} from "jstests/libs/query/analyze_plan.js"; export let coll; diff --git a/jstests/libs/mql_model_mongod_test_runner.js b/jstests/libs/query/mql_model_mongod_test_runner.js similarity index 100% rename from jstests/libs/mql_model_mongod_test_runner.js rename to jstests/libs/query/mql_model_mongod_test_runner.js diff --git a/jstests/libs/optimizer_utils.js b/jstests/libs/query/optimizer_utils.js similarity index 99% rename from jstests/libs/optimizer_utils.js rename to jstests/libs/query/optimizer_utils.js index 2359a70abb9..96fc880b199 100644 --- a/jstests/libs/optimizer_utils.js +++ b/jstests/libs/query/optimizer_utils.js @@ -1,6 +1,10 @@ -import {getAggPlanStage, getQueryPlanner, isAggregationPlan} from "jstests/libs/analyze_plan.js"; import {DiscoverTopology} from "jstests/libs/discover_topology.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import { + getAggPlanStage, + getQueryPlanner, + isAggregationPlan +} from "jstests/libs/query/analyze_plan.js"; import {setParameterOnAllHosts} from "jstests/noPassthrough/libs/server_parameter_helpers.js"; /** diff --git a/jstests/libs/plan_cache_utils.js b/jstests/libs/query/plan_cache_utils.js similarity index 98% rename from jstests/libs/plan_cache_utils.js rename to jstests/libs/query/plan_cache_utils.js index 898d08ff8e7..3d0dcdb7c46 100644 --- a/jstests/libs/plan_cache_utils.js +++ b/jstests/libs/query/plan_cache_utils.js @@ -2,13 +2,13 @@ * Utility methods for reading planCache counters */ +import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; import { getCachedPlan, getEngine, getPlanCacheShapeHashFromObject, getPlanStage -} from "jstests/libs/analyze_plan.js"; -import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +} from "jstests/libs/query/analyze_plan.js"; export function getPlanCacheSize(db) { return db.serverStatus().metrics.query.planCache.totalSizeEstimateBytes; diff --git a/jstests/libs/query_settings_index_hints_tests.js b/jstests/libs/query/query_settings_index_hints_tests.js similarity index 99% rename from jstests/libs/query_settings_index_hints_tests.js rename to jstests/libs/query/query_settings_index_hints_tests.js index 23fe393f681..e007b21db50 100644 --- a/jstests/libs/query_settings_index_hints_tests.js +++ b/jstests/libs/query/query_settings_index_hints_tests.js @@ -1,3 +1,4 @@ +import {getExplainCommand} from "jstests/libs/cmd_object_utils.js"; import { everyWinningPlan, flattenQueryPlanTree, @@ -10,12 +11,11 @@ import { isEofPlan, isIdhackOrExpress, planHasStage, -} from "jstests/libs/analyze_plan.js"; -import {getExplainCommand} from "jstests/libs/cmd_object_utils.js"; +} from "jstests/libs/query/analyze_plan.js"; import { checkSbeFullFeatureFlagEnabled, checkSbeRestrictedOrFullyEnabled -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; /** * Class containing common test functions used in query_settings_index_application_* tests. diff --git a/jstests/libs/query_settings_utils.js b/jstests/libs/query/query_settings_utils.js similarity index 99% rename from jstests/libs/query_settings_utils.js rename to jstests/libs/query/query_settings_utils.js index f0bfe358851..2db22cbead3 100644 --- a/jstests/libs/query_settings_utils.js +++ b/jstests/libs/query/query_settings_utils.js @@ -1,14 +1,14 @@ /** * Utility class for testing query settings. */ +import {getCommandName, getExplainCommand} from "jstests/libs/cmd_object_utils.js"; import { getAggPlanStages, getEngine, getPlanStages, getQueryPlanners, getWinningPlanFromExplain -} from "jstests/libs/analyze_plan.js"; -import {getCommandName, getExplainCommand} from "jstests/libs/cmd_object_utils.js"; +} from "jstests/libs/query/analyze_plan.js"; export class QuerySettingsUtils { /** diff --git a/jstests/libs/query_stats_utils.js b/jstests/libs/query/query_stats_utils.js similarity index 100% rename from jstests/libs/query_stats_utils.js rename to jstests/libs/query/query_stats_utils.js diff --git a/jstests/libs/sbe_assert_error_override.js b/jstests/libs/query/sbe_assert_error_override.js similarity index 100% rename from jstests/libs/sbe_assert_error_override.js rename to jstests/libs/query/sbe_assert_error_override.js diff --git a/jstests/libs/sbe_explain_helpers.js b/jstests/libs/query/sbe_explain_helpers.js similarity index 97% rename from jstests/libs/sbe_explain_helpers.js rename to jstests/libs/query/sbe_explain_helpers.js index 92d27adf5b9..6e4e5c580af 100644 --- a/jstests/libs/sbe_explain_helpers.js +++ b/jstests/libs/query/sbe_explain_helpers.js @@ -3,7 +3,7 @@ */ // Include helpers for analyzing explain output. -import {getPlanStage, getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getPlanStages} from "jstests/libs/query/analyze_plan.js"; export function isIdIndexScan(db, root, expectedParentStageForIxScan) { const parentStage = getPlanStage(root, expectedParentStageForIxScan); diff --git a/jstests/libs/sbe_util.js b/jstests/libs/query/sbe_util.js similarity index 100% rename from jstests/libs/sbe_util.js rename to jstests/libs/query/sbe_util.js diff --git a/jstests/libs/wildcard_index_helpers.js b/jstests/libs/query/wildcard_index_helpers.js similarity index 97% rename from jstests/libs/wildcard_index_helpers.js rename to jstests/libs/query/wildcard_index_helpers.js index df712192fe9..372e13858b4 100644 --- a/jstests/libs/wildcard_index_helpers.js +++ b/jstests/libs/query/wildcard_index_helpers.js @@ -1,7 +1,7 @@ /** * Common utility functions for testing functionality of Wildcard Indexes. */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; export const WildcardIndexHelpers = (function() { /** diff --git a/jstests/libs/shard_targeting_util.js b/jstests/libs/shard_targeting_util.js index cba03b07733..19f49fe218b 100644 --- a/jstests/libs/shard_targeting_util.js +++ b/jstests/libs/shard_targeting_util.js @@ -1,6 +1,6 @@ // Contains utilities and helper functions for testing shard targeting of aggregate commands. import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; import {CreateShardedCollectionUtil} from "jstests/sharding/libs/create_sharded_collection_util.js"; /** diff --git a/jstests/multiVersion/genericBinVersion/feature_flag_query_stats_count_distinct_upgrade_downgrade.js b/jstests/multiVersion/genericBinVersion/feature_flag_query_stats_count_distinct_upgrade_downgrade.js index e9badea111b..ec52a128769 100644 --- a/jstests/multiVersion/genericBinVersion/feature_flag_query_stats_count_distinct_upgrade_downgrade.js +++ b/jstests/multiVersion/genericBinVersion/feature_flag_query_stats_count_distinct_upgrade_downgrade.js @@ -5,7 +5,7 @@ import "jstests/multiVersion/libs/multi_rs.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {getLatestQueryStatsEntry, getQueryStats} from "jstests/libs/query_stats_utils.js"; +import {getLatestQueryStatsEntry, getQueryStats} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; // Start up a replica set with the last-lts binary version. diff --git a/jstests/multiVersion/genericBinVersion/query_stats_key_hash_version_consistency.js b/jstests/multiVersion/genericBinVersion/query_stats_key_hash_version_consistency.js index 87fb83d7ac8..1fa8df04a1b 100644 --- a/jstests/multiVersion/genericBinVersion/query_stats_key_hash_version_consistency.js +++ b/jstests/multiVersion/genericBinVersion/query_stats_key_hash_version_consistency.js @@ -4,7 +4,10 @@ */ import "jstests/multiVersion/libs/multi_rs.js"; -import {getQueryStatsFindCmd, getQueryStatsKeyHashes} from "jstests/libs/query_stats_utils.js"; +import { + getQueryStatsFindCmd, + getQueryStatsKeyHashes +} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; const rst = new ReplSetTest({ diff --git a/jstests/noPassthrough/clustered_collections/clustered_collection_sorted_scan.js b/jstests/noPassthrough/clustered_collections/clustered_collection_sorted_scan.js index 3a241a2e09d..090e3d51376 100644 --- a/jstests/noPassthrough/clustered_collections/clustered_collection_sorted_scan.js +++ b/jstests/noPassthrough/clustered_collections/clustered_collection_sorted_scan.js @@ -2,7 +2,7 @@ * Tests that clustered collections can be used for sorted scanning without inserting * a blocking scan operator. */ -import {getPlanStage, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, planHasStage} from "jstests/libs/query/analyze_plan.js"; Random.setRandomSeed(); diff --git a/jstests/noPassthrough/crud/batched_multi_deletes.js b/jstests/noPassthrough/crud/batched_multi_deletes.js index 093bdc39a28..e2a88242838 100644 --- a/jstests/noPassthrough/crud/batched_multi_deletes.js +++ b/jstests/noPassthrough/crud/batched_multi_deletes.js @@ -7,7 +7,7 @@ * ] */ -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; function validateBatchedDeletes(conn) { diff --git a/jstests/noPassthrough/currentop_query.js b/jstests/noPassthrough/currentop_query.js index 26bcde5d4db..413b69ed0e5 100644 --- a/jstests/noPassthrough/currentop_query.js +++ b/jstests/noPassthrough/currentop_query.js @@ -9,7 +9,7 @@ */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // This test runs manual getMores using different connections, which will not inherit the diff --git a/jstests/noPassthrough/external_data_source.js b/jstests/noPassthrough/external_data_source.js index 9962d5da48f..070013cbb74 100644 --- a/jstests/noPassthrough/external_data_source.js +++ b/jstests/noPassthrough/external_data_source.js @@ -7,7 +7,7 @@ * requires_external_data_source, * ] */ -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage} from "jstests/libs/query/analyze_plan.js"; // Runs tests on a standalone mongod. let conn = MongoRunner.runMongod({setParameter: {enableComputeMode: true}}); diff --git a/jstests/noPassthrough/external_sort_find.js b/jstests/noPassthrough/external_sort_find.js index 6e5ea84ae7c..404d9f2f194 100644 --- a/jstests/noPassthrough/external_sort_find.js +++ b/jstests/noPassthrough/external_sort_find.js @@ -1,8 +1,8 @@ /** * Test that the find command can spill to disk while executing a blocking sort. */ -import {getAggPlanStage, getPlanStage} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage, getPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; // Only allow blocking sort execution to use 100 kB of memory. const kMaxMemoryUsageKB = 100; diff --git a/jstests/noPassthrough/fast_path_counters.js b/jstests/noPassthrough/fast_path_counters.js index e54c7b694dc..a47ef6b62d5 100644 --- a/jstests/noPassthrough/fast_path_counters.js +++ b/jstests/noPassthrough/fast_path_counters.js @@ -2,8 +2,13 @@ * Tests that query planning fast path counters are updated correctly. */ -import {getWinningPlan, isExpress, isIdhack, isIdhackOrExpress} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import { + getWinningPlan, + isExpress, + isIdhack, + isIdhackOrExpress +} from "jstests/libs/query/analyze_plan.js"; const collName = jsTestName(); const conn = MongoRunner.runMongod({}); diff --git a/jstests/noPassthrough/index_builds/hybrid_multikey.js b/jstests/noPassthrough/index_builds/hybrid_multikey.js index 53ec1de305c..4821637a6d0 100644 --- a/jstests/noPassthrough/index_builds/hybrid_multikey.js +++ b/jstests/noPassthrough/index_builds/hybrid_multikey.js @@ -2,7 +2,7 @@ * Tests that hybrid index builds result in a consistent state and correct multikey behavior across * various index types. */ -import {getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan} from "jstests/libs/query/analyze_plan.js"; import {IndexBuildTest} from "jstests/noPassthrough/libs/index_build.js"; const conn = MongoRunner.runMongod(); diff --git a/jstests/noPassthrough/libs/change_stream_pre_image_truncate_after_shutdown.js b/jstests/noPassthrough/libs/change_stream_pre_image_truncate_after_shutdown.js index 86c327d529b..216e0d52b43 100644 --- a/jstests/noPassthrough/libs/change_stream_pre_image_truncate_after_shutdown.js +++ b/jstests/noPassthrough/libs/change_stream_pre_image_truncate_after_shutdown.js @@ -23,13 +23,13 @@ * truncateAfterShutdownTest.teardown(); */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { getPreImages, getPreImagesCollection, kPreImagesCollectionDatabase, kPreImagesCollectionName -} from "jstests/libs/change_stream_util.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {getFirstOplogEntry, getLatestOp} from "jstests/replsets/rslib.js"; diff --git a/jstests/noPassthrough/query/agg/agg_explain_read_concern.js b/jstests/noPassthrough/query/agg/agg_explain_read_concern.js index 545026f7ef7..910a49a28b9 100644 --- a/jstests/noPassthrough/query/agg/agg_explain_read_concern.js +++ b/jstests/noPassthrough/query/agg/agg_explain_read_concern.js @@ -2,7 +2,7 @@ * Test that explained aggregation commands behave correctly with the readConcern option. */ -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/noPassthrough/query/and_hash.js b/jstests/noPassthrough/query/and_hash.js index 967882c8f9d..718e1ab2c73 100644 --- a/jstests/noPassthrough/query/and_hash.js +++ b/jstests/noPassthrough/query/and_hash.js @@ -1,6 +1,6 @@ // Tests for whether the query solution correctly used an AND_HASH for index intersection. import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/and_sorted.js b/jstests/noPassthrough/query/and_sorted.js index 6a5242ce272..30e217cd2c3 100644 --- a/jstests/noPassthrough/query/and_sorted.js +++ b/jstests/noPassthrough/query/and_sorted.js @@ -1,6 +1,6 @@ // Tests for whether the query solution correctly used an AND_SORTED stage for index intersection. import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/change_streams/change_stream_end_of_multi_shard_transaction.js b/jstests/noPassthrough/query/change_streams/change_stream_end_of_multi_shard_transaction.js index 6b641a9c9ac..711a42a935a 100644 --- a/jstests/noPassthrough/query/change_streams/change_stream_end_of_multi_shard_transaction.js +++ b/jstests/noPassthrough/query/change_streams/change_stream_end_of_multi_shard_transaction.js @@ -8,8 +8,8 @@ * ] */ -import {assertEndOfTransaction, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {assertEndOfTransaction, ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/noPassthrough/query/change_streams/change_stream_failover.js b/jstests/noPassthrough/query/change_streams/change_stream_failover.js index 0b4f8fda1e3..81e64ad5356 100644 --- a/jstests/noPassthrough/query/change_streams/change_stream_failover.js +++ b/jstests/noPassthrough/query/change_streams/change_stream_failover.js @@ -5,8 +5,8 @@ // requires_majority_read_concern, // requires_replication, // ] -import {ChangeStreamTest, ChangeStreamWatchMode} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest, ChangeStreamWatchMode} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; const rst = new ReplSetTest({nodes: 3}); diff --git a/jstests/noPassthrough/query/change_streams/change_stream_pre_images_with_ttl.js b/jstests/noPassthrough/query/change_streams/change_stream_pre_images_with_ttl.js index 595789582b6..5e5a8eae5c0 100644 --- a/jstests/noPassthrough/query/change_streams/change_stream_pre_images_with_ttl.js +++ b/jstests/noPassthrough/query/change_streams/change_stream_pre_images_with_ttl.js @@ -4,8 +4,8 @@ * * @tags: [requires_fcv_72] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; const rst = new ReplSetTest({ diff --git a/jstests/noPassthrough/query/change_streams/change_stream_preimages_standalone_mode.js b/jstests/noPassthrough/query/change_streams/change_stream_preimages_standalone_mode.js index a98fd745cd3..cfea823545f 100644 --- a/jstests/noPassthrough/query/change_streams/change_stream_preimages_standalone_mode.js +++ b/jstests/noPassthrough/query/change_streams/change_stream_preimages_standalone_mode.js @@ -12,11 +12,11 @@ * ] */ -import {preImagesForOps} from "jstests/libs/change_stream_util.js"; +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {preImagesForOps} from "jstests/libs/query/change_stream_util.js"; import { assertChangeStreamPreAndPostImagesCollectionOptionIsEnabled -} from "jstests/libs/change_stream_util.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; /** diff --git a/jstests/noPassthrough/query/change_streams/change_streams_collation_chunk_migration.js b/jstests/noPassthrough/query/change_streams/change_streams_collation_chunk_migration.js index 7ea8ce76ea2..b94e9cf6588 100644 --- a/jstests/noPassthrough/query/change_streams/change_streams_collation_chunk_migration.js +++ b/jstests/noPassthrough/query/change_streams/change_streams_collation_chunk_migration.js @@ -5,8 +5,8 @@ * requires_replication, * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/noPassthrough/query/change_streams/change_streams_oplog_rollover.js b/jstests/noPassthrough/query/change_streams/change_streams_oplog_rollover.js index 98134684db9..2f501bea281 100644 --- a/jstests/noPassthrough/query/change_streams/change_streams_oplog_rollover.js +++ b/jstests/noPassthrough/query/change_streams/change_streams_oplog_rollover.js @@ -4,7 +4,7 @@ // requires_majority_read_concern, // uses_change_streams, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {getFirstOplogEntry, getLatestOp} from "jstests/replsets/rslib.js"; diff --git a/jstests/noPassthrough/query/change_streams/change_streams_require_majority_read_concern.js b/jstests/noPassthrough/query/change_streams/change_streams_require_majority_read_concern.js index cc8654fe5e0..115b6dc9264 100644 --- a/jstests/noPassthrough/query/change_streams/change_streams_require_majority_read_concern.js +++ b/jstests/noPassthrough/query/change_streams/change_streams_require_majority_read_concern.js @@ -3,8 +3,8 @@ // requires_majority_read_concern, // uses_change_streams, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {getCollectionNameFromFullNamespace} from "jstests/libs/namespace_utils.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import { restartReplicationOnSecondaries, diff --git a/jstests/noPassthrough/query/explain/explain_execution_time_in_nanoseconds.js b/jstests/noPassthrough/query/explain/explain_execution_time_in_nanoseconds.js index 21d1071d390..ab7a247151b 100644 --- a/jstests/noPassthrough/query/explain/explain_execution_time_in_nanoseconds.js +++ b/jstests/noPassthrough/query/explain/explain_execution_time_in_nanoseconds.js @@ -2,7 +2,7 @@ // includes "executionTimeMicros"/"executionTimeNanos" only if requested. // "executionTimeMillisEstimate" will always be present in the explain output. // Check that "queryPlanner" has "optimizationTimeMillis". -import {getAllPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAllPlanStages} from "jstests/libs/query/analyze_plan.js"; let conn = MongoRunner.runMongod({}); assert.neq(conn, null, "mongod failed to start up"); diff --git a/jstests/noPassthrough/query/explain/explain_group_stage_exec_stats.js b/jstests/noPassthrough/query/explain/explain_group_stage_exec_stats.js index fd7c1babda6..1d7316f8ad1 100644 --- a/jstests/noPassthrough/query/explain/explain_group_stage_exec_stats.js +++ b/jstests/noPassthrough/query/explain/explain_group_stage_exec_stats.js @@ -2,8 +2,8 @@ * Tests that $group stage reports memory footprint per accumulator when explain is run with * verbosities "executionStats" and "allPlansExecution". */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const testDB = conn.getDB('test'); diff --git a/jstests/noPassthrough/query/explain/explain_output_truncation.js b/jstests/noPassthrough/query/explain/explain_output_truncation.js index c7a89bc60f9..8b1fb0de7ce 100644 --- a/jstests/noPassthrough/query/explain/explain_output_truncation.js +++ b/jstests/noPassthrough/query/explain/explain_output_truncation.js @@ -1,7 +1,7 @@ /** * Test that explain output is correctly truncated when it grows too large. */ -import {getPlanStage, getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; const dbName = "test"; const collName = jsTestName(); diff --git a/jstests/noPassthrough/query/explain/explain_sort_exec_stats.js b/jstests/noPassthrough/query/explain/explain_sort_exec_stats.js index b6538e8e6ff..4a09f7ece00 100644 --- a/jstests/noPassthrough/query/explain/explain_sort_exec_stats.js +++ b/jstests/noPassthrough/query/explain/explain_sort_exec_stats.js @@ -2,8 +2,8 @@ * Tests that $sort stage reports the correct stats when explain is run with * different verbosities. */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/explain/explain_unionwith_lookup_sharded.js b/jstests/noPassthrough/query/explain/explain_unionwith_lookup_sharded.js index cf63e49d255..532659aa40c 100644 --- a/jstests/noPassthrough/query/explain/explain_unionwith_lookup_sharded.js +++ b/jstests/noPassthrough/query/explain/explain_unionwith_lookup_sharded.js @@ -4,7 +4,7 @@ * * This test was originally designed to reproduce SERVER-71636. */ -import {getAggPlanStage, getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "test"; diff --git a/jstests/noPassthrough/query/explain/explain_unionwith_sharded_view.js b/jstests/noPassthrough/query/explain/explain_unionwith_sharded_view.js index 295e994ae9e..5de78571b8b 100644 --- a/jstests/noPassthrough/query/explain/explain_unionwith_sharded_view.js +++ b/jstests/noPassthrough/query/explain/explain_unionwith_sharded_view.js @@ -1,11 +1,11 @@ /** * Test that explain of $unionWith resolves views on sharded collections correctly. */ -import {getAllNodeExplains} from "jstests/libs/analyze_plan.js"; import { assertDropAndRecreateCollection, assertDropCollection } from "jstests/libs/collection_drop_recreate.js"; +import {getAllNodeExplains} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "test"; diff --git a/jstests/noPassthrough/query/geo/geo_full.js b/jstests/noPassthrough/query/geo/geo_full.js index 6fa1e048ee2..f42146c84e4 100644 --- a/jstests/noPassthrough/query/geo/geo_full.js +++ b/jstests/noPassthrough/query/geo/geo_full.js @@ -18,7 +18,7 @@ // test fails, and hard-wiring that as the test number. // -import {deg2rad, rad2deg} from "jstests/libs/geo_math.js"; +import {deg2rad, rad2deg} from "jstests/libs/query/geo_math.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod failed to start."); diff --git a/jstests/noPassthrough/query/geo/geo_near_random1.js b/jstests/noPassthrough/query/geo/geo_near_random1.js index 0d5df2ebe1d..462f7dfccd2 100644 --- a/jstests/noPassthrough/query/geo/geo_near_random1.js +++ b/jstests/noPassthrough/query/geo/geo_near_random1.js @@ -1,10 +1,10 @@ // this tests all points using $near -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod failed to start."); -var test = new GeoNearRandomTest("weekly.geo_near_random1", conn.getDB("test")); +var test = new GeoNearRandomTest("weekly.query/geo_near_random1", conn.getDB("test")); test.insertPts(1000); diff --git a/jstests/noPassthrough/query/geo/geo_near_random2.js b/jstests/noPassthrough/query/geo/geo_near_random2.js index b2cc0ece946..a03137a5adf 100644 --- a/jstests/noPassthrough/query/geo/geo_near_random2.js +++ b/jstests/noPassthrough/query/geo/geo_near_random2.js @@ -1,10 +1,10 @@ // this tests 1% of all points using $near and $nearSphere -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod failed to start."); -var test = new GeoNearRandomTest("weekly.geo_near_random2", conn.getDB("test")); +var test = new GeoNearRandomTest("weekly.query/geo_near_random2", conn.getDB("test")); test.insertPts(50000); diff --git a/jstests/noPassthrough/query/group/group_spill_long_keys.js b/jstests/noPassthrough/query/group/group_spill_long_keys.js index 08a6abb9547..da33b2298b6 100644 --- a/jstests/noPassthrough/query/group/group_spill_long_keys.js +++ b/jstests/noPassthrough/query/group/group_spill_long_keys.js @@ -1,7 +1,7 @@ /** * Test a $group query which has a large number of group-by fields and needs to spill to disk. */ -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; const MEM_LIMIT_KB = 2; diff --git a/jstests/noPassthrough/query/group/group_spill_metrics.js b/jstests/noPassthrough/query/group/group_spill_metrics.js index 3f6f768d916..474fc02471a 100644 --- a/jstests/noPassthrough/query/group/group_spill_metrics.js +++ b/jstests/noPassthrough/query/group/group_spill_metrics.js @@ -7,8 +7,8 @@ * requires_persistence, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB('test'); diff --git a/jstests/noPassthrough/query/group/grouped_match_push_down.js b/jstests/noPassthrough/query/group/grouped_match_push_down.js index 721f751ec6f..a8389b15baf 100644 --- a/jstests/noPassthrough/query/group/grouped_match_push_down.js +++ b/jstests/noPassthrough/query/group/grouped_match_push_down.js @@ -1,7 +1,7 @@ // Tests classic planner rule to push-down $match with filters on renamed fields with dotted paths // over $group and $project in aggregation pipelines. -import {getEngine, getWinningPlanFromExplain} from "jstests/libs/analyze_plan.js"; +import {getEngine, getWinningPlanFromExplain} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB('test'); diff --git a/jstests/noPassthrough/query/lookup/lookup_max_intermediate_size.js b/jstests/noPassthrough/query/lookup/lookup_max_intermediate_size.js index e5fc7241718..cc9b2dc020a 100644 --- a/jstests/noPassthrough/query/lookup/lookup_max_intermediate_size.js +++ b/jstests/noPassthrough/query/lookup/lookup_max_intermediate_size.js @@ -5,7 +5,7 @@ // ] import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Used by testPipeline to sort result documents. All _ids must be primitives. diff --git a/jstests/noPassthrough/query/lookup/lookup_pushdown.js b/jstests/noPassthrough/query/lookup/lookup_pushdown.js index a13483cd929..915029a34d8 100644 --- a/jstests/noPassthrough/query/lookup/lookup_pushdown.js +++ b/jstests/noPassthrough/query/lookup/lookup_pushdown.js @@ -9,10 +9,10 @@ import { getAggPlanStages, hasRejectedPlans, planHasStage, -} from "jstests/libs/analyze_plan.js"; -import {assertEngine} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {assertEngine} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const JoinAlgorithm = { diff --git a/jstests/noPassthrough/query/lookup/lookup_with_limit_sharded.js b/jstests/noPassthrough/query/lookup/lookup_with_limit_sharded.js index 8c1bed5071a..9da9be10ee2 100644 --- a/jstests/noPassthrough/query/lookup/lookup_with_limit_sharded.js +++ b/jstests/noPassthrough/query/lookup/lookup_with_limit_sharded.js @@ -19,7 +19,7 @@ import { getPlanStage, getSingleNodeExplain, getWinningPlan, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 2, config: 1}); diff --git a/jstests/noPassthrough/query/multiplanner/multiplanner_tie_breaking.js b/jstests/noPassthrough/query/multiplanner/multiplanner_tie_breaking.js index 628ce958668..4065556af4d 100644 --- a/jstests/noPassthrough/query/multiplanner/multiplanner_tie_breaking.js +++ b/jstests/noPassthrough/query/multiplanner/multiplanner_tie_breaking.js @@ -5,7 +5,7 @@ "use strict"; -import {getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; function testTieBreaking(breakTies, expectedPlanCount, checkAgainstOriginal) { const expectedDocsExamined = 1; diff --git a/jstests/noPassthrough/query/multiplanner/multiplanning_stats.js b/jstests/noPassthrough/query/multiplanner/multiplanning_stats.js index 0f8fdbc7133..d18809d0421 100644 --- a/jstests/noPassthrough/query/multiplanner/multiplanning_stats.js +++ b/jstests/noPassthrough/query/multiplanner/multiplanning_stats.js @@ -4,8 +4,8 @@ // used when replanning the find part of the query using the SBE planner, so we expect them to be // roughly equal to ensure we are using the correct statistic. -import {getAllPlanStages} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {getAllPlanStages} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; function runExplain(coll, filter, proj, sort) { diff --git a/jstests/noPassthrough/query/multiplanner/tie_breaking_index_prefix.js b/jstests/noPassthrough/query/multiplanner/tie_breaking_index_prefix.js index 58d9b2cc82a..921f28f022f 100644 --- a/jstests/noPassthrough/query/multiplanner/tie_breaking_index_prefix.js +++ b/jstests/noPassthrough/query/multiplanner/tie_breaking_index_prefix.js @@ -4,7 +4,7 @@ "use strict"; -import {getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; // Test initialization. diff --git a/jstests/noPassthrough/query/nested_sort_merge.js b/jstests/noPassthrough/query/nested_sort_merge.js index 464ee2d0ace..174ce6f42bd 100644 --- a/jstests/noPassthrough/query/nested_sort_merge.js +++ b/jstests/noPassthrough/query/nested_sort_merge.js @@ -2,7 +2,7 @@ * Verifies that nested SORT_MERGE plans are handled correctly by the SBE stage builder. * Intended to reproduce SERVER-61496. */ -import {getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/noFetchBonus.js b/jstests/noPassthrough/query/noFetchBonus.js index 3c172f7f588..6c029766692 100644 --- a/jstests/noPassthrough/query/noFetchBonus.js +++ b/jstests/noPassthrough/query/noFetchBonus.js @@ -2,7 +2,7 @@ // requires_replication, // requires_sharding, // ] -import {getRejectedPlans, isIndexOnly, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getRejectedPlans, isIndexOnly, planHasStage} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 1, rs: {nodes: 1}, config: 1}); diff --git a/jstests/noPassthrough/query/non_multikey_ixscan_on_path_with_positional_component.js b/jstests/noPassthrough/query/non_multikey_ixscan_on_path_with_positional_component.js index 0bedb3cff36..f4a34fbda56 100644 --- a/jstests/noPassthrough/query/non_multikey_ixscan_on_path_with_positional_component.js +++ b/jstests/noPassthrough/query/non_multikey_ixscan_on_path_with_positional_component.js @@ -3,7 +3,7 @@ * a positional component. This test was designed to reproduce SERVER-52589. */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; // Configure 'internalQueryExecYieldIterations' such that operations will yield on each PlanExecutor // iteration. diff --git a/jstests/noPassthrough/query/notablescan.js b/jstests/noPassthrough/query/notablescan.js index c493b06632e..9950649be7c 100644 --- a/jstests/noPassthrough/query/notablescan.js +++ b/jstests/noPassthrough/query/notablescan.js @@ -16,8 +16,8 @@ // tenant_migration_incompatible, // ] -import {isIdhackOrExpress} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {isIdhackOrExpress} from "jstests/libs/query/analyze_plan.js"; function checkError(err) { assert.includes(err.toString(), "'notablescan'"); diff --git a/jstests/noPassthrough/query/optimize_sharded_sample_with_orphaned_docs.js b/jstests/noPassthrough/query/optimize_sharded_sample_with_orphaned_docs.js index 0ae646287f8..c5909b52f52 100644 --- a/jstests/noPassthrough/query/optimize_sharded_sample_with_orphaned_docs.js +++ b/jstests/noPassthrough/query/optimize_sharded_sample_with_orphaned_docs.js @@ -6,7 +6,7 @@ * requires_replication, * ] */ -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Deliberately inserts orphans outside of migration. diff --git a/jstests/noPassthrough/query/pipeline_optimization_failpoint.js b/jstests/noPassthrough/query/pipeline_optimization_failpoint.js index 6c5bb123db8..17b5dd683de 100644 --- a/jstests/noPassthrough/query/pipeline_optimization_failpoint.js +++ b/jstests/noPassthrough/query/pipeline_optimization_failpoint.js @@ -1,6 +1,6 @@ // Tests that pipeline optimization works properly when the failpoint isn't triggered, and is // disabled properly when it is triggered. -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage} from "jstests/libs/query/analyze_plan.js"; Random.setRandomSeed(); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_counters.js b/jstests/noPassthrough/query/plan_cache/plan_cache_counters.js index bd9e602d7fc..8a7501308ea 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_counters.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_counters.js @@ -2,7 +2,7 @@ * Test that the plan cache hits, misses and skipped serverStatus' counters are updated correctly * when serving queries. */ -import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod({}); const db = conn.getDB("plan_cache_hits_and_misses_metrics"); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_index_create.js b/jstests/noPassthrough/query/plan_cache/plan_cache_index_create.js index e4b4ea4123f..cb3dc475705 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_index_create.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_index_create.js @@ -5,9 +5,9 @@ * requires_replication, * ] */ -import {getCachedPlan} from "jstests/libs/analyze_plan.js"; +import {getCachedPlan} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; const dbName = "test"; const collName = "coll"; diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_invalidation.js b/jstests/noPassthrough/query/plan_cache/plan_cache_invalidation.js index b8690870c12..3feb21bda3e 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_invalidation.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_invalidation.js @@ -5,7 +5,7 @@ * ] */ -import {getPlanCacheNumEntries, getPlanCacheSize} from "jstests/libs/plan_cache_utils.js"; +import {getPlanCacheNumEntries, getPlanCacheSize} from "jstests/libs/query/plan_cache_utils.js"; const conn = MongoRunner.runMongod(); assert.neq(conn, null, "mongod failed to start"); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_list_failed_plans.js b/jstests/noPassthrough/query/plan_cache/plan_cache_list_failed_plans.js index 4b552cb2492..7a096f7edbd 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_list_failed_plans.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_list_failed_plans.js @@ -1,5 +1,5 @@ // Confirms the $planCacheStats output format includes information about failed plans. -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod was unable to start up"); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_memory_debug_info.js b/jstests/noPassthrough/query/plan_cache/plan_cache_memory_debug_info.js index eb0446268a9..929959992ce 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_memory_debug_info.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_memory_debug_info.js @@ -2,8 +2,8 @@ * Tests that detailed debug information is excluded from new plan cache entries once the estimated * cumulative size of the system's plan caches exceeds a pre-configured threshold. */ -import {getPlanCacheSize} from "jstests/libs/plan_cache_utils.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanCacheSize} from "jstests/libs/query/plan_cache_utils.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; /** * Creates two indexes for the given collection. In order for plans to be cached, there need to be diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_metrics.js b/jstests/noPassthrough/query/plan_cache/plan_cache_metrics.js index 7b5e69ba4df..0fbcad82a7c 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_metrics.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_metrics.js @@ -3,7 +3,7 @@ * and cleared from the cache. */ -import {getPlanCacheSize} from "jstests/libs/plan_cache_utils.js"; +import {getPlanCacheSize} from "jstests/libs/query/plan_cache_utils.js"; const conn = MongoRunner.runMongod({}); const db = conn.getDB('test'); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_replan_group_lookup.js b/jstests/noPassthrough/query/plan_cache/plan_cache_replan_group_lookup.js index 9dba2395603..edb3695c412 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_replan_group_lookup.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_replan_group_lookup.js @@ -4,13 +4,13 @@ * requires_profiling, * ] */ -import {getAggPlanStages, getEngine, getPlanStage} from "jstests/libs/analyze_plan.js"; -import {assertCacheUsage, setUpActiveCacheEntry} from "jstests/libs/plan_cache_utils.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +import {getAggPlanStages, getEngine, getPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {assertCacheUsage, setUpActiveCacheEntry} from "jstests/libs/query/plan_cache_utils.js"; import { checkSbeFullFeatureFlagEnabled, checkSbeRestrictedOrFullyEnabled, -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_replan_sort.js b/jstests/noPassthrough/query/plan_cache/plan_cache_replan_sort.js index 186a08eccc8..65ddcd1ac93 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_replan_sort.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_replan_sort.js @@ -5,9 +5,9 @@ * requires_profiling, * ] */ -import {getCachedPlan} from "jstests/libs/analyze_plan.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import {getCachedPlan} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod({setParameter: {allowDiskUseByDefault: false}}); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_replan_unwind.js b/jstests/noPassthrough/query/plan_cache/plan_cache_replan_unwind.js index 1e95a897a3b..33fead112ec 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_replan_unwind.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_replan_unwind.js @@ -4,11 +4,11 @@ * requires_profiling, * ] */ -import {assertCacheUsage, setUpActiveCacheEntry} from "jstests/libs/plan_cache_utils.js"; +import {assertCacheUsage, setUpActiveCacheEntry} from "jstests/libs/query/plan_cache_utils.js"; import { checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled, -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/plan_cache/plan_cache_stats_agg_source.js b/jstests/noPassthrough/query/plan_cache/plan_cache_stats_agg_source.js index d57d5ac263c..906d8e06c45 100644 --- a/jstests/noPassthrough/query/plan_cache/plan_cache_stats_agg_source.js +++ b/jstests/noPassthrough/query/plan_cache/plan_cache_stats_agg_source.js @@ -7,8 +7,8 @@ import { getPlanCacheKeyFromShape, getPlanStage, getPlanStages, -} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod failed to start up"); diff --git a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_api_version.js b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_api_version.js index 1e37921f915..82f3b1a54b3 100644 --- a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_api_version.js +++ b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_api_version.js @@ -3,7 +3,7 @@ * aggregate command. */ -import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod({}); assert.neq(conn, null, "mongod failed to start"); diff --git a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_clear_on_param_change.js b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_clear_on_param_change.js index 1a0d2a1ab80..290ed0b390a 100644 --- a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_clear_on_param_change.js +++ b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_clear_on_param_change.js @@ -6,7 +6,7 @@ * featureFlagSbeFull, * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; // Lists the names of the setParameters which should result in the SBE plan cache being cleared when // the parameter is modified. Along with each parameter, includes a valid new value of the parameter diff --git a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_key_reporting.js b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_key_reporting.js index eae299b72fc..b27fef14608 100644 --- a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_key_reporting.js +++ b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_key_reporting.js @@ -8,9 +8,9 @@ * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; import {findMatchingLogLine} from "jstests/libs/log.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod({}); assert.neq(conn, null, "mongod failed to start"); diff --git a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_memory_debug_info.js b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_memory_debug_info.js index 49cae1d9c0d..e776bb61a09 100644 --- a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_memory_debug_info.js +++ b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_memory_debug_info.js @@ -8,8 +8,8 @@ * featureFlagSbeFull * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; -import {getPlanCacheSize} from "jstests/libs/plan_cache_utils.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; +import {getPlanCacheSize} from "jstests/libs/query/plan_cache_utils.js"; const conn = MongoRunner.runMongod({}); assert.neq(conn, null, "mongod failed to start"); diff --git a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_size_metric.js b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_size_metric.js index e954c4f387c..2666a17dadd 100644 --- a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_size_metric.js +++ b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_size_metric.js @@ -12,8 +12,8 @@ * ] */ -import {getPlanCacheShapeHashFromExplain} from "jstests/libs/analyze_plan.js"; -import {getPlanCacheNumEntries, getPlanCacheSize} from "jstests/libs/plan_cache_utils.js"; +import {getPlanCacheShapeHashFromExplain} from "jstests/libs/query/analyze_plan.js"; +import {getPlanCacheNumEntries, getPlanCacheSize} from "jstests/libs/query/plan_cache_utils.js"; const conn = MongoRunner.runMongod(); assert.neq(conn, null, "mongod failed to start"); diff --git a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_with_const_let_var.js b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_with_const_let_var.js index c27aab6fea5..2aa3397be09 100644 --- a/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_with_const_let_var.js +++ b/jstests/noPassthrough/query/plan_cache/sbe_plan_cache_with_const_let_var.js @@ -12,7 +12,7 @@ * ] */ -import {getPlanCacheKeyFromExplain} from "jstests/libs/analyze_plan.js"; +import {getPlanCacheKeyFromExplain} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/plan_cache/sbe_uses_correct_plan_cache.js b/jstests/noPassthrough/query/plan_cache/sbe_uses_correct_plan_cache.js index 771bcec3d2f..b5b40134c00 100644 --- a/jstests/noPassthrough/query/plan_cache/sbe_uses_correct_plan_cache.js +++ b/jstests/noPassthrough/query/plan_cache/sbe_uses_correct_plan_cache.js @@ -5,9 +5,9 @@ * requires_profiling, * ] */ -import {assertCacheUsage, setUpActiveCacheEntry} from "jstests/libs/plan_cache_utils.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import {assertCacheUsage, setUpActiveCacheEntry} from "jstests/libs/query/plan_cache_utils.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/profile/profile_operation_metrics.js b/jstests/noPassthrough/query/profile/profile_operation_metrics.js index fa8fa3427fe..0901ceef2ea 100644 --- a/jstests/noPassthrough/query/profile/profile_operation_metrics.js +++ b/jstests/noPassthrough/query/profile/profile_operation_metrics.js @@ -11,8 +11,8 @@ */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; import {isLinux} from "jstests/libs/os_helpers.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; const dbName = jsTestName(); const collName = 'coll'; diff --git a/jstests/noPassthrough/query/queryStats/agg_cmd_one_way_tokenization.js b/jstests/noPassthrough/query/queryStats/agg_cmd_one_way_tokenization.js index 9c99504c0ee..aaf222f0ad7 100644 --- a/jstests/noPassthrough/query/queryStats/agg_cmd_one_way_tokenization.js +++ b/jstests/noPassthrough/query/queryStats/agg_cmd_one_way_tokenization.js @@ -8,7 +8,7 @@ import { getQueryStats, getQueryStatsAggCmd, kShellApplicationName -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const kHashedDbName = "iDlS7h5jf5HHxWPJpeHRbA+jLTNNZaqxVVkplrEkfko="; diff --git a/jstests/noPassthrough/query/queryStats/application_name_find.js b/jstests/noPassthrough/query/queryStats/application_name_find.js index 1a81bd5f7da..385bc4b58af 100644 --- a/jstests/noPassthrough/query/queryStats/application_name_find.js +++ b/jstests/noPassthrough/query/queryStats/application_name_find.js @@ -2,7 +2,7 @@ * Test that applicationName and namespace appear in queryStats for the find command. * @tags: [requires_fcv_71] */ -import {getQueryStats, getQueryStatsFindCmd} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats, getQueryStatsFindCmd} from "jstests/libs/query/query_stats_utils.js"; const kApplicationName = "MongoDB Shell"; diff --git a/jstests/noPassthrough/query/queryStats/clear_query_stats_store.js b/jstests/noPassthrough/query/queryStats/clear_query_stats_store.js index a99d795746b..006ff494654 100644 --- a/jstests/noPassthrough/query/queryStats/clear_query_stats_store.js +++ b/jstests/noPassthrough/query/queryStats/clear_query_stats_store.js @@ -2,7 +2,7 @@ * Test that the query stats store can be cleared when the cache size is reset to 0. * @tags: [requires_fcv_72] */ -import {getQueryStats} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats} from "jstests/libs/query/query_stats_utils.js"; // Turn on the collecting of queryStats metrics. let options = { diff --git a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_explain.js b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_explain.js index b55b3a5c991..1a9000c6a8e 100644 --- a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_explain.js +++ b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_explain.js @@ -4,7 +4,7 @@ * @tags: [requires_fcv_81] */ -import {getQueryStats, withQueryStatsEnabled} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats, withQueryStatsEnabled} from "jstests/libs/query/query_stats_utils.js"; withQueryStatsEnabled(jsTestName(), (coll) => { const testDB = coll.getDB(); diff --git a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_key.js b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_key.js index 4d220bd4d95..c7d346e482b 100644 --- a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_key.js +++ b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_key.js @@ -8,7 +8,7 @@ import { runCommandAndValidateQueryStats, withQueryStatsEnabled -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); const countCommand = { diff --git a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_metrics.js b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_metrics.js index 34378af63b0..4e1ddca2761 100644 --- a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_metrics.js +++ b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_metrics.js @@ -15,7 +15,7 @@ import { getQueryStats, resetQueryStatsStore, withQueryStatsEnabled -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; /** * Initialize collection for tests. diff --git a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_one_way_tokenization.js b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_one_way_tokenization.js index 6d30d2a42cc..cdade1e36e8 100644 --- a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_one_way_tokenization.js +++ b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_one_way_tokenization.js @@ -4,7 +4,10 @@ * @tags: [requires_fcv_81] */ -import {getQueryStatsCountCmd, withQueryStatsEnabled} from "jstests/libs/query_stats_utils.js"; +import { + getQueryStatsCountCmd, + withQueryStatsEnabled +} from "jstests/libs/query/query_stats_utils.js"; withQueryStatsEnabled(jsTestName(), (coll) => { const testDB = coll.getDB(); diff --git a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_view.js b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_view.js index ec70b386033..ddb32805f12 100644 --- a/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_view.js +++ b/jstests/noPassthrough/query/queryStats/count/query_stats_count_cmd_view.js @@ -11,7 +11,7 @@ import { getQueryStats, resetQueryStatsStore, withQueryStatsEnabled, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; withQueryStatsEnabled(jsTestName(), (coll) => { // Insert documents into a collection. diff --git a/jstests/noPassthrough/query/queryStats/distinct_cmd_one_way_tokenization.js b/jstests/noPassthrough/query/queryStats/distinct_cmd_one_way_tokenization.js index c050792eba0..3851345495b 100644 --- a/jstests/noPassthrough/query/queryStats/distinct_cmd_one_way_tokenization.js +++ b/jstests/noPassthrough/query/queryStats/distinct_cmd_one_way_tokenization.js @@ -3,7 +3,10 @@ * * @tags: [requires_fcv_81] */ -import {getQueryStatsDistinctCmd, withQueryStatsEnabled} from "jstests/libs/query_stats_utils.js"; +import { + getQueryStatsDistinctCmd, + withQueryStatsEnabled +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/documentSourceQueryStats_redaction_parameters.js b/jstests/noPassthrough/query/queryStats/documentSourceQueryStats_redaction_parameters.js index 0201bafdb57..d580dc5fe99 100644 --- a/jstests/noPassthrough/query/queryStats/documentSourceQueryStats_redaction_parameters.js +++ b/jstests/noPassthrough/query/queryStats/documentSourceQueryStats_redaction_parameters.js @@ -4,7 +4,7 @@ */ import {assertAdminDBErrCodeAndErrMsgContains} from "jstests/aggregation/extras/utils.js"; -import {getQueryStatsFindCmd} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsFindCmd} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Assert the expected queryStats key with no hmac. diff --git a/jstests/noPassthrough/query/queryStats/find_cmd_one_way_tokenization.js b/jstests/noPassthrough/query/queryStats/find_cmd_one_way_tokenization.js index 989de4f53db..5b9956325b9 100644 --- a/jstests/noPassthrough/query/queryStats/find_cmd_one_way_tokenization.js +++ b/jstests/noPassthrough/query/queryStats/find_cmd_one_way_tokenization.js @@ -1,7 +1,7 @@ /** * Test that $queryStats properly tokenizes find commands, on mongod and mongos. */ -import {getQueryStatsFindCmd} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsFindCmd} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const kHashedFieldName = "lU7Z0mLRPRUL+RfAD5jhYPRRpXBsZBxS/20EzDwfOG4="; diff --git a/jstests/noPassthrough/query/queryStats/query_settings_with_query_shape_hash.js b/jstests/noPassthrough/query/queryStats/query_settings_with_query_shape_hash.js index 5130abc18ff..f21000ecf18 100644 --- a/jstests/noPassthrough/query/queryStats/query_settings_with_query_shape_hash.js +++ b/jstests/noPassthrough/query/queryStats/query_settings_with_query_shape_hash.js @@ -6,13 +6,13 @@ // ] import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; import { getQueryStatsFindCmd, getQueryStatsShapeHashes, resetQueryStatsStore, runOnReplsetAndShardedCluster -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; runOnReplsetAndShardedCluster((conn, test) => { const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_agg_cmd_collect_on_mongos.js b/jstests/noPassthrough/query/queryStats/query_stats_agg_cmd_collect_on_mongos.js index 4a2644957be..34235c6b8bc 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_agg_cmd_collect_on_mongos.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_agg_cmd_collect_on_mongos.js @@ -8,7 +8,7 @@ import { getLatestQueryStatsEntry, getQueryStats, getQueryStatsAggCmd -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/noPassthrough/query/queryStats/query_stats_agg_key.js b/jstests/noPassthrough/query/queryStats/query_stats_agg_key.js index b6504b059da..86dda647d81 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_agg_key.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_agg_key.js @@ -6,7 +6,7 @@ import { runCommandAndValidateQueryStats, withQueryStatsEnabled -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); const aggregateCommandObj = { diff --git a/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream.js b/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream.js index 1be44985624..cc563699d6f 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream.js @@ -8,7 +8,7 @@ import { getLatestQueryStatsEntry, getValueAtPath, runCommandAndValidateQueryStats, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream_passthrough_shard.js b/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream_passthrough_shard.js index 66859bfb1f0..d973a125698 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream_passthrough_shard.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_agg_key_change_stream_passthrough_shard.js @@ -9,7 +9,7 @@ import { runCommandAndValidateQueryStats, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_agg_key_explain.js b/jstests/noPassthrough/query/queryStats/query_stats_agg_key_explain.js index 7e7b36c838f..52ee5622d5f 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_agg_key_explain.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_agg_key_explain.js @@ -6,7 +6,7 @@ import { runCommandAndValidateQueryStats, withQueryStatsEnabled -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_analyze_cmd.js b/jstests/noPassthrough/query/queryStats/query_stats_analyze_cmd.js index 5703bc9abc1..78d19ba14f2 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_analyze_cmd.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_analyze_cmd.js @@ -3,7 +3,7 @@ */ import { getQueryStats, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const conn = MongoRunner.runMongod({ setParameter: {internalQueryStatsRateLimit: -1, internalQueryStatsErrorsAreCommandFatal: true} diff --git a/jstests/noPassthrough/query/queryStats/query_stats_change_stream.js b/jstests/noPassthrough/query/queryStats/query_stats_change_stream.js index ef5ae1af82b..e496812528b 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_change_stream.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_change_stream.js @@ -13,7 +13,7 @@ import { checkChangeStreamEntry, getLatestQueryStatsEntry, getNumberOfGetMoresUntilNextDocForChangeStream -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_change_stream_evict.js b/jstests/noPassthrough/query/queryStats/query_stats_change_stream_evict.js index 2a8ed43ebf2..f676b0bdc6f 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_change_stream_evict.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_change_stream_evict.js @@ -15,7 +15,7 @@ import { getLatestQueryStatsEntry, getQueryStats, resetQueryStatsStore -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_change_stream_per_shard_cursor.js b/jstests/noPassthrough/query/queryStats/query_stats_change_stream_per_shard_cursor.js index 7389d3a6e84..cead9472d3f 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_change_stream_per_shard_cursor.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_change_stream_per_shard_cursor.js @@ -9,7 +9,7 @@ import { checkChangeStreamEntry, getLatestQueryStatsEntry, getNumberOfGetMoresUntilNextDocForChangeStream, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_collectionType.js b/jstests/noPassthrough/query/queryStats/query_stats_collectionType.js index a133624482e..23b379f0565 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_collectionType.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_collectionType.js @@ -4,7 +4,7 @@ * in query_stats_changeStreams.js. * @tags: [requires_fcv_72] */ -import {getQueryStats} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; function runTest(conn) { diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disable_after_initial_request.js b/jstests/noPassthrough/query/queryStats/query_stats_disable_after_initial_request.js index 4ef1ae814f8..535afb26009 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disable_after_initial_request.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disable_after_initial_request.js @@ -6,7 +6,7 @@ * requires_fcv_71, * ] */ -import {getQueryStatsFindCmd} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsFindCmd} from "jstests/libs/query/query_stats_utils.js"; // Test that no query stats entry is written when (1) dispatching an initial find query, (2) // disabling query stats, then (3) completing the command. Below, we run variations of this test diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_deep_pipelines.js b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_deep_pipelines.js index 45271cfe3d8..c687d682b47 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_deep_pipelines.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_deep_pipelines.js @@ -12,7 +12,7 @@ import { exhaustCursorAndGetQueryStats, getAggregateQueryStatsKey, runForEachDeployment, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; let collId = 0; function getNewCollectionName() { diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_find.js b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_find.js index eb0e3326c9d..e85590d60ae 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_find.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_find.js @@ -9,7 +9,7 @@ import { exhaustCursorAndGetQueryStats, getFindQueryStatsKey, runForEachDeployment, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; function makeUnshardedCollection(conn) { const coll = conn.getDB("test")[jsTestName()]; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_nested_pipelines.js b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_nested_pipelines.js index 7136021be9a..9d4fac458a7 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_nested_pipelines.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_nested_pipelines.js @@ -12,8 +12,8 @@ import { exhaustCursorAndGetQueryStats, getAggregateQueryStatsKey, runForEachDeployment, -} from "jstests/libs/query_stats_utils.js"; -import {checkSbeCompletelyDisabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/query_stats_utils.js"; +import {checkSbeCompletelyDisabled} from "jstests/libs/query/sbe_util.js"; let collId = 0; function getNewCollectionName() { diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_plan_cache.js b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_plan_cache.js index ab5e8d5402d..860cd0990b9 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_plan_cache.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_plan_cache.js @@ -9,7 +9,7 @@ import { exhaustCursorAndGetQueryStats, getFindQueryStatsKey, runForEachDeployment, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; function makeUnshardedCollection(conn) { const coll = conn.getDB("test")[jsTestName()]; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_sharded.js b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_sharded.js index ef8e545a2c7..5c07f4f7c4b 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_sharded.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_sharded.js @@ -10,7 +10,7 @@ import { clearPlanCacheAndQueryStatsStore, exhaustCursorAndGetQueryStats, getAggregateQueryStatsKey, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; let collId = 0; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_simple_pipelines.js b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_simple_pipelines.js index 507990893ea..923a121b188 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_simple_pipelines.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_simple_pipelines.js @@ -10,7 +10,7 @@ import { exhaustCursorAndGetQueryStats, getAggregateQueryStatsKey, runForEachDeployment, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; function makeUnshardedCollection(conn) { const coll = conn.getDB("test")[jsTestName()]; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_storage.js b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_storage.js index 2f4ae421ce0..3d17af9f47d 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_storage.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_disk_usage_storage.js @@ -17,7 +17,7 @@ import { getFindQueryStatsKey, getQueryStatsCountCmd, getQueryStatsDistinctCmd -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_explain.js b/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_explain.js index 284c1148bf1..d111dd26d91 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_explain.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_explain.js @@ -3,7 +3,10 @@ * * @tags: [requires_fcv_81] */ -import {getQueryStatsDistinctCmd, withQueryStatsEnabled} from "jstests/libs/query_stats_utils.js"; +import { + getQueryStatsDistinctCmd, + withQueryStatsEnabled +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); const viewName = "testView"; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_metrics.js b/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_metrics.js index 1ca9e425d70..506cbeb5670 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_metrics.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_metrics.js @@ -9,7 +9,7 @@ import { assertExpectedResults, getLatestQueryStatsEntry, withQueryStatsEnabled -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_non_existent_db.js b/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_non_existent_db.js index 5010eacda0f..e779477ec7c 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_non_existent_db.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_distinct_cmd_non_existent_db.js @@ -4,7 +4,10 @@ * @tags: [requires_fcv_81] */ -import {getLatestQueryStatsEntry, withQueryStatsEnabled} from "jstests/libs/query_stats_utils.js"; +import { + getLatestQueryStatsEntry, + withQueryStatsEnabled +} from "jstests/libs/query/query_stats_utils.js"; const collName = "anything"; const viewName = "testView"; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_distinct_key.js b/jstests/noPassthrough/query/queryStats/query_stats_distinct_key.js index 3edc82ebc50..93712de69e2 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_distinct_key.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_distinct_key.js @@ -7,7 +7,7 @@ import { runCommandAndValidateQueryStats, withQueryStatsEnabled -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_distinct_view.js b/jstests/noPassthrough/query/queryStats/query_stats_distinct_view.js index 2b5c8a9bc3a..a9a3aac6701 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_distinct_view.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_distinct_view.js @@ -8,7 +8,7 @@ import { assertAggregatedMetricsSingleExec, assertExpectedResults, getLatestQueryStatsEntry, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const collName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_explain_cmd_agg.js b/jstests/noPassthrough/query/queryStats/query_stats_explain_cmd_agg.js index 82730e8fd1d..aedd1bfa801 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_explain_cmd_agg.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_explain_cmd_agg.js @@ -8,7 +8,7 @@ import { getLatestQueryStatsEntry, getValueAtPath, withQueryStatsEnabled, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const testColl = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_expressions.js b/jstests/noPassthrough/query/queryStats/query_stats_expressions.js index 268e967b605..6c1f98d7c94 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_expressions.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_expressions.js @@ -3,7 +3,7 @@ * proper query shape without issues during re-parsing. * @tags: [requires_fcv_71] */ -import {getQueryStats, resetQueryStatsStore} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats, resetQueryStatsStore} from "jstests/libs/query/query_stats_utils.js"; // Turn on the collecting of queryStats metrics. let options = { diff --git a/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_collect_on_mongos.js b/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_collect_on_mongos.js index a7c6a6ed69c..137b09dc9d1 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_collect_on_mongos.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_collect_on_mongos.js @@ -8,7 +8,7 @@ import { getLatestQueryStatsEntry, getQueryStats, getQueryStatsFindCmd -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_view.js b/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_view.js index ebe224b5764..fe07321c054 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_view.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_find_cmd_view.js @@ -12,7 +12,7 @@ import { getQueryStats, resetQueryStatsStore, withQueryStatsEnabled, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; withQueryStatsEnabled(jsTestName(), (coll) => { // Insert documents into a collection. diff --git a/jstests/noPassthrough/query/queryStats/query_stats_find_key.js b/jstests/noPassthrough/query/queryStats/query_stats_find_key.js index 351fb393ec2..578ce5e5f13 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_find_key.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_find_key.js @@ -7,7 +7,7 @@ import { getLatestQueryStatsEntry, runCommandAndValidateQueryStats, withQueryStatsEnabled -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const collName = jsTestName(); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_json_schema.js b/jstests/noPassthrough/query/queryStats/query_stats_json_schema.js index 827a3c6a501..a89c6b97fd8 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_json_schema.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_json_schema.js @@ -3,7 +3,7 @@ * mongod and mongos. * @tags: [requires_fcv_81] */ -import {getQueryStatsAggCmd, kShellApplicationName} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsAggCmd, kShellApplicationName} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const kHashedDbName = "iDlS7h5jf5HHxWPJpeHRbA+jLTNNZaqxVVkplrEkfko="; diff --git a/jstests/noPassthrough/query/queryStats/query_stats_key_shape_hash.js b/jstests/noPassthrough/query/queryStats/query_stats_key_shape_hash.js index 2f35a750f2a..0a10661e155 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_key_shape_hash.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_key_shape_hash.js @@ -6,7 +6,7 @@ import { getQueryStatsFindCmd, getQueryStatsKeyHashes, getQueryStatsShapeHashes -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; const replTest = new ReplSetTest({name: 'queryStatsKeyShapeHashTest', nodes: 2}); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_metrics_across_getMore_calls.js b/jstests/noPassthrough/query/queryStats/query_stats_metrics_across_getMore_calls.js index 8e2f79f7f10..d24c04a366f 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_metrics_across_getMore_calls.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_metrics_across_getMore_calls.js @@ -3,7 +3,7 @@ * calls, for agg commands. * @tags: [requires_fcv_72] */ -import {getQueryStatsAggCmd, verifyMetrics} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsAggCmd, verifyMetrics} from "jstests/libs/query/query_stats_utils.js"; // Turn on the collecting of queryStats metrics. let options = { diff --git a/jstests/noPassthrough/query/queryStats/query_stats_optimizer_metrics.js b/jstests/noPassthrough/query/queryStats/query_stats_optimizer_metrics.js index 6b4a6dadd75..fab4bfc2d95 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_optimizer_metrics.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_optimizer_metrics.js @@ -2,7 +2,7 @@ * This test validates optimizer metrics in query stats supplemental metrics section. * @tags: [requires_fcv_71] */ -import {getQueryStats} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats} from "jstests/libs/query/query_stats_utils.js"; const conn = MongoRunner.runMongod( {setParameter: {internalQueryCollectOptimizerMetrics: true, internalQueryStatsRateLimit: -1}}); diff --git a/jstests/noPassthrough/query/queryStats/query_stats_regex.js b/jstests/noPassthrough/query/queryStats/query_stats_regex.js index 50ef2e71c3a..0b93b264b9a 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_regex.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_regex.js @@ -2,7 +2,7 @@ * Test that queryStats works properly for a find command that uses regex. * @tags: [requires_fcv_71] */ -import {getLatestQueryStatsEntry} from "jstests/libs/query_stats_utils.js"; +import {getLatestQueryStatsEntry} from "jstests/libs/query/query_stats_utils.js"; // Turn on the collecting of queryStats metrics. let options = { diff --git a/jstests/noPassthrough/query/queryStats/query_stats_sampling_rate.js b/jstests/noPassthrough/query/queryStats/query_stats_sampling_rate.js index 49ed28ad8d7..9499e7913ab 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_sampling_rate.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_sampling_rate.js @@ -3,7 +3,7 @@ * if feature flag is on. * @tags: [requires_fcv_71] */ -import {getQueryStats} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats} from "jstests/libs/query/query_stats_utils.js"; let options = { setParameter: {internalQueryStatsRateLimit: 0}, diff --git a/jstests/noPassthrough/query/queryStats/query_stats_sub_pipelines.js b/jstests/noPassthrough/query/queryStats/query_stats_sub_pipelines.js index fc22ffb11fe..e66d9ffd324 100644 --- a/jstests/noPassthrough/query/queryStats/query_stats_sub_pipelines.js +++ b/jstests/noPassthrough/query/queryStats/query_stats_sub_pipelines.js @@ -5,7 +5,7 @@ */ import { getLatestQueryStatsEntry, -} from "jstests/libs/query_stats_utils.js"; +} from "jstests/libs/query/query_stats_utils.js"; const conn = MongoRunner.runMongod({ setParameter: { diff --git a/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_log.js b/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_log.js index 25f144a49b2..710a66f5f83 100644 --- a/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_log.js +++ b/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_log.js @@ -3,7 +3,7 @@ * @tags: [requires_fcv_71] */ -import {getQueryStatsFindCmd} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsFindCmd} from "jstests/libs/query/query_stats_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const checkLogForHmacKey = function(conn) { diff --git a/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_profile.js b/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_profile.js index 7d95f7620ec..8829f1606cb 100644 --- a/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_profile.js +++ b/jstests/noPassthrough/query/queryStats/redact_sensitive_fields_in_profile.js @@ -3,7 +3,7 @@ * @tags: [requires_fcv_71] */ import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; -import {getQueryStatsFindCmd} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsFindCmd} from "jstests/libs/query/query_stats_utils.js"; const conn = MongoRunner.runMongod({setParameter: {internalQueryStatsRateLimit: -1}, profile: 2}); const adminDB = conn.getDB("admin"); diff --git a/jstests/noPassthrough/query/queryStats/repl_set_query_stats_key.js b/jstests/noPassthrough/query/queryStats/repl_set_query_stats_key.js index a6a86bb57fa..4e86ab3926a 100644 --- a/jstests/noPassthrough/query/queryStats/repl_set_query_stats_key.js +++ b/jstests/noPassthrough/query/queryStats/repl_set_query_stats_key.js @@ -4,7 +4,7 @@ * versioning are included for good measure. * @tags: [requires_fcv_71] */ -import {getLatestQueryStatsEntry} from "jstests/libs/query_stats_utils.js"; +import {getLatestQueryStatsEntry} from "jstests/libs/query/query_stats_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; const replTest = new ReplSetTest({ diff --git a/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_agg_cmd.js b/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_agg_cmd.js index 486e5f20d6e..897f5b8aaa2 100644 --- a/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_agg_cmd.js +++ b/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_agg_cmd.js @@ -3,7 +3,7 @@ * results fit into a single batch (and thus don't require a cursor), for agg commands. * @tags: [requires_fcv_72] */ -import {getQueryStatsAggCmd, verifyMetrics} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsAggCmd, verifyMetrics} from "jstests/libs/query/query_stats_utils.js"; // Turn on the collecting of queryStats metrics. let options = { diff --git a/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_find_cmd.js b/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_find_cmd.js index 96bbe5622e6..4806a72b960 100644 --- a/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_find_cmd.js +++ b/jstests/noPassthrough/query/queryStats/single_batch_on_mongod_find_cmd.js @@ -3,7 +3,7 @@ * results fit into a single batch (and thus don't require a cursor), for find commands. * @tags: [requires_fcv_71] */ -import {getQueryStatsFindCmd, verifyMetrics} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsFindCmd, verifyMetrics} from "jstests/libs/query/query_stats_utils.js"; // Turn on the collecting of queryStats metrics. let options = { diff --git a/jstests/noPassthrough/query/query_exponential_cursor_batch_size.js b/jstests/noPassthrough/query/query_exponential_cursor_batch_size.js index 93fad92c3b3..561f0d4f989 100644 --- a/jstests/noPassthrough/query/query_exponential_cursor_batch_size.js +++ b/jstests/noPassthrough/query/query_exponential_cursor_batch_size.js @@ -2,7 +2,7 @@ * Test query knobs internalDocumentSourceCursorInitialBatchSize control DocumentSourceCursor batch * size, starting from a very small number and grows exponentially. */ -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/query_knobs_validation.js b/jstests/noPassthrough/query/query_knobs_validation.js index 32900630d31..bb91e3606da 100644 --- a/jstests/noPassthrough/query/query_knobs_validation.js +++ b/jstests/noPassthrough/query/query_knobs_validation.js @@ -7,7 +7,7 @@ import { getExpectedPipelineLimit, -} from "jstests/libs/optimizer_utils.js"; +} from "jstests/libs/query/optimizer_utils.js"; const conn = MongoRunner.runMongod(); const testDB = conn.getDB("admin"); diff --git a/jstests/noPassthrough/query/query_oplogreplay.js b/jstests/noPassthrough/query/query_oplogreplay.js index 75b45970944..7fc3da09b2e 100644 --- a/jstests/noPassthrough/query/query_oplogreplay.js +++ b/jstests/noPassthrough/query/query_oplogreplay.js @@ -1,7 +1,7 @@ // Test oplog queries that can be optimized with oplogReplay. // @tags: [requires_replication, requires_capped] -import {getPlanStage, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; let replSet = new ReplSetTest({nodes: 1}); diff --git a/jstests/noPassthrough/query/query_settings_server_status.js b/jstests/noPassthrough/query/query_settings_server_status.js index e3ace9aafce..f6db0e83e5b 100644 --- a/jstests/noPassthrough/query/query_settings_server_status.js +++ b/jstests/noPassthrough/query/query_settings_server_status.js @@ -14,7 +14,7 @@ import "jstests/multiVersion/libs/multi_cluster.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({name: jsTestName(), shards: 2, mongos: 2, rs: {nodes: 3}}); diff --git a/jstests/noPassthrough/query/query_settings_through_cluster_parameters.js b/jstests/noPassthrough/query/query_settings_through_cluster_parameters.js index e3c9322bc5f..94718ae0d06 100644 --- a/jstests/noPassthrough/query/query_settings_through_cluster_parameters.js +++ b/jstests/noPassthrough/query/query_settings_through_cluster_parameters.js @@ -9,7 +9,7 @@ // ] import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/noPassthrough/query/regex_collations.js b/jstests/noPassthrough/query/regex_collations.js index 793ecf847fd..c6765233dc4 100644 --- a/jstests/noPassthrough/query/regex_collations.js +++ b/jstests/noPassthrough/query/regex_collations.js @@ -2,13 +2,13 @@ * Tests how regex filters are satisfied with different index + query collation combinations */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { getPlanStage, getWinningPlanFromExplain, isCollscan, isIxscan -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB(jsTestName()); diff --git a/jstests/noPassthrough/query/sample_pushdown_transaction.js b/jstests/noPassthrough/query/sample_pushdown_transaction.js index da5a10429c5..745aca7da28 100644 --- a/jstests/noPassthrough/query/sample_pushdown_transaction.js +++ b/jstests/noPassthrough/query/sample_pushdown_transaction.js @@ -5,7 +5,7 @@ * Requires random cursor support. * @tags: [requires_replication] */ -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; // Set up. diff --git a/jstests/noPassthrough/query/sample_pushdown_with_set_cluster_param.js b/jstests/noPassthrough/query/sample_pushdown_with_set_cluster_param.js index e5e6edcf481..5a7631424ba 100644 --- a/jstests/noPassthrough/query/sample_pushdown_with_set_cluster_param.js +++ b/jstests/noPassthrough/query/sample_pushdown_with_set_cluster_param.js @@ -5,7 +5,7 @@ * Requires random cursor support. * @tags: [requires_replication] */ -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; const numDocs = 1000; diff --git a/jstests/noPassthrough/query/sbe_subplanning.js b/jstests/noPassthrough/query/sbe_subplanning.js index 1b1b85a41ab..ba1a998a1ee 100644 --- a/jstests/noPassthrough/query/sbe_subplanning.js +++ b/jstests/noPassthrough/query/sbe_subplanning.js @@ -5,12 +5,12 @@ * requires_profiling, * ] */ -import {assertCacheUsage} from "jstests/libs/plan_cache_utils.js"; import {getLatestProfilerEntry} from "jstests/libs/profiler.js"; +import {assertCacheUsage} from "jstests/libs/query/plan_cache_utils.js"; import { checkSbeFullFeatureFlagEnabled, checkSbeRestrictedOrFullyEnabled, -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/shard_filtering.js b/jstests/noPassthrough/query/shard_filtering.js index 54e82e83f64..a375e0a6997 100644 --- a/jstests/noPassthrough/query/shard_filtering.js +++ b/jstests/noPassthrough/query/shard_filtering.js @@ -6,7 +6,7 @@ * requires_sharding, * ] */ -import {isIndexOnly, isIxscan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {isIndexOnly, isIxscan, planHasStage} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Deliberately inserts orphans outside of migration. diff --git a/jstests/noPassthrough/query/sort_spill_estimate_data_size.js b/jstests/noPassthrough/query/sort_spill_estimate_data_size.js index cd3e16727c5..12b274f324e 100644 --- a/jstests/noPassthrough/query/sort_spill_estimate_data_size.js +++ b/jstests/noPassthrough/query/sort_spill_estimate_data_size.js @@ -3,7 +3,7 @@ * * This test was originally designed to reproduce SERVER-53760. */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod was unable to start up"); diff --git a/jstests/noPassthrough/query/spill_to_disk_secondary_read.js b/jstests/noPassthrough/query/spill_to_disk_secondary_read.js index b596b44d0cc..40ff9033d8a 100644 --- a/jstests/noPassthrough/query/spill_to_disk_secondary_read.js +++ b/jstests/noPassthrough/query/spill_to_disk_secondary_read.js @@ -3,9 +3,9 @@ * writeConcern greater than w:1. * @tags: [requires_replication, requires_majority_read_concern, requires_persistence] */ +import {getSbePlanStages} from "jstests/libs/query/sbe_explain_helpers.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; -import {getSbePlanStages} from "jstests/libs/sbe_explain_helpers.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; const kNumNodes = 3; const replTest = new ReplSetTest({ diff --git a/jstests/noPassthrough/query/spill_to_disk_server_status.js b/jstests/noPassthrough/query/spill_to_disk_server_status.js index 120486e50e4..0122d8c1542 100644 --- a/jstests/noPassthrough/query/spill_to_disk_server_status.js +++ b/jstests/noPassthrough/query/spill_to_disk_server_status.js @@ -4,10 +4,10 @@ // @tags: [ // requires_persistence, // ] -import {getPlanStages, getQueryPlanner, getWinningPlan} from "jstests/libs/analyze_plan.js"; import {configureFailPoint} from "jstests/libs/fail_point_util.js"; import {funWithArgs} from "jstests/libs/parallel_shell_helpers.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanStages, getQueryPlanner, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const db = conn.getDB("test"); diff --git a/jstests/noPassthrough/query/views_count_distinct_disk_use.js b/jstests/noPassthrough/query/views_count_distinct_disk_use.js index 941b3a710a4..6b8b7bda41a 100644 --- a/jstests/noPassthrough/query/views_count_distinct_disk_use.js +++ b/jstests/noPassthrough/query/views_count_distinct_disk_use.js @@ -1,7 +1,7 @@ // Test count and distinct on views use with different values of the allowDiskUseByDefault // parameter. -import {checkSbeCompletelyDisabled} from "jstests/libs/sbe_util.js"; +import {checkSbeCompletelyDisabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod was unable to start up"); diff --git a/jstests/noPassthrough/query/write_change_stream_pit_preimage_in_transaction.js b/jstests/noPassthrough/query/write_change_stream_pit_preimage_in_transaction.js index 8d3f31ec69e..8b755ea44ed 100644 --- a/jstests/noPassthrough/query/write_change_stream_pit_preimage_in_transaction.js +++ b/jstests/noPassthrough/query/write_change_stream_pit_preimage_in_transaction.js @@ -12,8 +12,8 @@ * ] */ import {PrepareHelpers} from "jstests/core/txns/libs/prepare_helpers.js"; -import {getPreImagesCollection, preImagesForOps} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {getPreImagesCollection, preImagesForOps} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {TransactionsUtil} from "jstests/libs/transactions_util.js"; diff --git a/jstests/noPassthrough/query/write_conflict_wildcard.js b/jstests/noPassthrough/query/write_conflict_wildcard.js index 9ba6c0dad96..982c2169e70 100644 --- a/jstests/noPassthrough/query/write_conflict_wildcard.js +++ b/jstests/noPassthrough/query/write_conflict_wildcard.js @@ -5,7 +5,7 @@ * TODO SERVER-56443: This test is specific to the classic engine. If/when the classic engine is * deleted, this test should be removed as well. */ -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); const testDB = conn.getDB("test"); diff --git a/jstests/noPassthrough/read_write_concern/read_majority.js b/jstests/noPassthrough/read_write_concern/read_majority.js index 7f0169d24ba..c77a7ae9178 100644 --- a/jstests/noPassthrough/read_write_concern/read_majority.js +++ b/jstests/noPassthrough/read_write_concern/read_majority.js @@ -19,7 +19,7 @@ * ] */ -import {getWinningPlan, isCollscan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isCollscan, isIxscan} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; // Tests the functionality for committed reads for the given read concern level. diff --git a/jstests/noPassthrough/read_write_concern/read_only_allow_disk_use.js b/jstests/noPassthrough/read_write_concern/read_only_allow_disk_use.js index a10c7435d21..f6fb2a2e4c9 100644 --- a/jstests/noPassthrough/read_write_concern/read_only_allow_disk_use.js +++ b/jstests/noPassthrough/read_write_concern/read_only_allow_disk_use.js @@ -10,8 +10,8 @@ * requires_scripting * ] */ +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; const memoryLimitMb = 1; const memoryLimitBytes = 1 * 1024 * 1024; diff --git a/jstests/noPassthrough/replication/snapshot_reads_pre_images_and_change_collections.js b/jstests/noPassthrough/replication/snapshot_reads_pre_images_and_change_collections.js index edc74f5ff5c..7478493e56a 100644 --- a/jstests/noPassthrough/replication/snapshot_reads_pre_images_and_change_collections.js +++ b/jstests/noPassthrough/replication/snapshot_reads_pre_images_and_change_collections.js @@ -3,7 +3,7 @@ * */ -import {getPreImagesCollection} from "jstests/libs/change_stream_util.js"; +import {getPreImagesCollection} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import { ChangeStreamMultitenantReplicaSetTest diff --git a/jstests/noPassthrough/storage_execution/pre_image_truncates_within_rollback.js b/jstests/noPassthrough/storage_execution/pre_image_truncates_within_rollback.js index b9294680e7d..ca9731666f6 100644 --- a/jstests/noPassthrough/storage_execution/pre_image_truncates_within_rollback.js +++ b/jstests/noPassthrough/storage_execution/pre_image_truncates_within_rollback.js @@ -6,8 +6,8 @@ * requires_mongobridge, * ] */ -import {getPreImagesCollection} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {getPreImagesCollection} from "jstests/libs/query/change_stream_util.js"; import {RollbackTest} from "jstests/replsets/libs/rollback_test.js"; const nodeOptions = { diff --git a/jstests/noPassthrough/timeseries/timeseries_concurrent.js b/jstests/noPassthrough/timeseries/timeseries_concurrent.js index 890ceffccb0..060c86d6eee 100644 --- a/jstests/noPassthrough/timeseries/timeseries_concurrent.js +++ b/jstests/noPassthrough/timeseries/timeseries_concurrent.js @@ -10,10 +10,10 @@ */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getEngine, getQueryPlanner, getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; import {Thread} from "jstests/libs/parallelTester.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getEngine, getQueryPlanner, getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; function runAndAssertAggregation(coll, pred, ids) { const pipe = [{$match: pred}, {$project: {_id: 1}}]; diff --git a/jstests/noPassthrough/timeseries/timeseries_group_block_metrics.js b/jstests/noPassthrough/timeseries/timeseries_group_block_metrics.js index bbc4054bba2..ff0916119d0 100644 --- a/jstests/noPassthrough/timeseries/timeseries_group_block_metrics.js +++ b/jstests/noPassthrough/timeseries/timeseries_group_block_metrics.js @@ -7,7 +7,7 @@ * requires_persistence, * ] */ -import {getAggPlanStage, getEngine} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getEngine} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod( {setParameter: {featureFlagSbeFull: true, featureFlagTimeSeriesInSbe: true}}); diff --git a/jstests/noPassthrough/timeseries/timeseries_group_bson_types.js b/jstests/noPassthrough/timeseries/timeseries_group_bson_types.js index a292e0eb787..0da54b02329 100644 --- a/jstests/noPassthrough/timeseries/timeseries_group_bson_types.js +++ b/jstests/noPassthrough/timeseries/timeseries_group_bson_types.js @@ -6,7 +6,7 @@ import { blockProcessingTestCases, generateMetaVals -} from "jstests/libs/block_processing_test_cases.js"; +} from "jstests/libs/query/block_processing_test_cases.js"; import {leafs} from "jstests/query_golden/libs/example_data.js"; const scalarConn = MongoRunner.runMongod(); diff --git a/jstests/noPassthrough/timeseries/timeseries_group_spill_metrics.js b/jstests/noPassthrough/timeseries/timeseries_group_spill_metrics.js index 351b8f1f671..55c57b4a8d7 100644 --- a/jstests/noPassthrough/timeseries/timeseries_group_spill_metrics.js +++ b/jstests/noPassthrough/timeseries/timeseries_group_spill_metrics.js @@ -7,7 +7,7 @@ * requires_persistence, * ] */ -import {getAggPlanStage, getEngine} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getEngine} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod( {setParameter: {featureFlagSbeFull: true, featureFlagTimeSeriesInSbe: true}}); diff --git a/jstests/noPassthrough/timeseries/timeseries_in_sbe_uses_plan_cache.js b/jstests/noPassthrough/timeseries/timeseries_in_sbe_uses_plan_cache.js index c1a119ec20e..16d2f2dc55a 100644 --- a/jstests/noPassthrough/timeseries/timeseries_in_sbe_uses_plan_cache.js +++ b/jstests/noPassthrough/timeseries/timeseries_in_sbe_uses_plan_cache.js @@ -1,8 +1,8 @@ /** * Ensures that SBE-eligible time series queries use the classic plan cache. */ -import {assertCacheUsage} from "jstests/libs/plan_cache_utils.js"; -import {checkSbeStatus, kSbeRestricted} from "jstests/libs/sbe_util.js"; +import {assertCacheUsage} from "jstests/libs/query/plan_cache_utils.js"; +import {checkSbeStatus, kSbeRestricted} from "jstests/libs/query/sbe_util.js"; // Start a single mongoD using MongoRunner. const conn = MongoRunner.runMongod(); diff --git a/jstests/noPassthrough/timeseries/timeseries_internal_bounded_sort_spilling.js b/jstests/noPassthrough/timeseries/timeseries_internal_bounded_sort_spilling.js index 75d3760e553..f0e19afccfc 100644 --- a/jstests/noPassthrough/timeseries/timeseries_internal_bounded_sort_spilling.js +++ b/jstests/noPassthrough/timeseries/timeseries_internal_bounded_sort_spilling.js @@ -7,7 +7,7 @@ * does_not_support_stepdowns, * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; const kSmallMemoryLimit = 1024; const conn = MongoRunner.runMongod( diff --git a/jstests/noPassthrough/timeseries/timeseries_multi_update_spill_to_disk.js b/jstests/noPassthrough/timeseries/timeseries_multi_update_spill_to_disk.js index 1f7568991e1..591753d4004 100644 --- a/jstests/noPassthrough/timeseries/timeseries_multi_update_spill_to_disk.js +++ b/jstests/noPassthrough/timeseries/timeseries_multi_update_spill_to_disk.js @@ -6,7 +6,7 @@ * ] */ -import {getExecutionStages} from "jstests/libs/analyze_plan.js"; +import {getExecutionStages} from "jstests/libs/query/analyze_plan.js"; const dateTime = ISODate("2021-07-12T16:00:00Z"); const buckets = ["A", "B", "C", "D", "E", "F", "G"]; diff --git a/jstests/noPassthrough/timeseries/timeseries_query_knob_sbe.js b/jstests/noPassthrough/timeseries/timeseries_query_knob_sbe.js index 5cecd0a982f..858c6e58e35 100644 --- a/jstests/noPassthrough/timeseries/timeseries_query_knob_sbe.js +++ b/jstests/noPassthrough/timeseries/timeseries_query_knob_sbe.js @@ -10,9 +10,9 @@ * ] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; const conn = MongoRunner.runMongod(); assert.neq(null, conn, "mongod was unable to start up"); diff --git a/jstests/noPassthrough/timeseries/timeseries_sample.js b/jstests/noPassthrough/timeseries/timeseries_sample.js index 3a5f69824f2..fbcc64d39af 100644 --- a/jstests/noPassthrough/timeseries/timeseries_sample.js +++ b/jstests/noPassthrough/timeseries/timeseries_sample.js @@ -2,7 +2,7 @@ * Tests inserting sample data into the time-series buckets collection. This test is for the * exercising the optimized $sample implementation for $_internalUnpackBucket. */ -import {aggPlanHasStage, getAggPlanStage, getPlanStage} from "jstests/libs/analyze_plan.js"; +import {aggPlanHasStage, getAggPlanStage, getPlanStage} from "jstests/libs/query/analyze_plan.js"; let conn = MongoRunner.runMongod({setParameter: {timeseriesBucketMaxCount: 100}}); diff --git a/jstests/noPassthrough/timeseries/timeseries_sort.js b/jstests/noPassthrough/timeseries/timeseries_sort.js index 643e335e851..e886a3e88ed 100644 --- a/jstests/noPassthrough/timeseries/timeseries_sort.js +++ b/jstests/noPassthrough/timeseries/timeseries_sort.js @@ -6,8 +6,8 @@ * requires_sharding, * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; Random.setRandomSeed(); diff --git a/jstests/noPassthrough/validate/validate_adjust_multikey.js b/jstests/noPassthrough/validate/validate_adjust_multikey.js index 9df4e728854..bdc965dc5aa 100644 --- a/jstests/noPassthrough/validate/validate_adjust_multikey.js +++ b/jstests/noPassthrough/validate/validate_adjust_multikey.js @@ -1,7 +1,7 @@ /** * Tests foreground validation's ability to fix up allowable multikey metadata problems. */ -import {getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const conn = MongoRunner.runMongod(); const dbName = jsTestName(); diff --git a/jstests/noPassthroughWithMongod/cbr_infrastructure.js b/jstests/noPassthroughWithMongod/cbr_infrastructure.js index b6c4595a180..0d2b937fb84 100644 --- a/jstests/noPassthroughWithMongod/cbr_infrastructure.js +++ b/jstests/noPassthroughWithMongod/cbr_infrastructure.js @@ -6,9 +6,9 @@ import { canonicalizePlan, getRejectedPlans, getWinningPlanFromExplain -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; // TODO SERVER-92589: Remove this exemption if (checkSbeFullyEnabled(db)) { diff --git a/jstests/noPassthroughWithMongod/query/geo/geo_near_random1.js b/jstests/noPassthroughWithMongod/query/geo/geo_near_random1.js index 5e88df25ca1..78ad9419797 100644 --- a/jstests/noPassthroughWithMongod/query/geo/geo_near_random1.js +++ b/jstests/noPassthroughWithMongod/query/geo/geo_near_random1.js @@ -1,5 +1,5 @@ // this tests all points using $near -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; var test = new GeoNearRandomTest("nightly.geo_near_random1"); diff --git a/jstests/noPassthroughWithMongod/query/geo/geo_near_random2.js b/jstests/noPassthroughWithMongod/query/geo/geo_near_random2.js index f28dd9edc51..ad9b46fea7a 100644 --- a/jstests/noPassthroughWithMongod/query/geo/geo_near_random2.js +++ b/jstests/noPassthroughWithMongod/query/geo/geo_near_random2.js @@ -1,5 +1,5 @@ // this tests 1% of all points using $near and $nearSphere -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; var test = new GeoNearRandomTest("nightly.geo_near_random2"); diff --git a/jstests/noPassthroughWithMongod/query/group_pushdown.js b/jstests/noPassthroughWithMongod/query/group_pushdown.js index afc541a9186..5de27c7f6f2 100644 --- a/jstests/noPassthroughWithMongod/query/group_pushdown.js +++ b/jstests/noPassthroughWithMongod/query/group_pushdown.js @@ -3,7 +3,7 @@ * * @tags: [featureFlagSbeFull] */ -import {getAggPlanStage, getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage, getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; // Ensure group pushdown is enabled and capture the original value of // 'internalQuerySlotBasedExecutionDisableGroupPushdown' to use at the end of the test. diff --git a/jstests/noPassthroughWithMongod/query/index_bounds_static_limit.js b/jstests/noPassthroughWithMongod/query/index_bounds_static_limit.js index b18e9c5c4d0..b5c1cd610fc 100644 --- a/jstests/noPassthroughWithMongod/query/index_bounds_static_limit.js +++ b/jstests/noPassthroughWithMongod/query/index_bounds_static_limit.js @@ -6,7 +6,7 @@ // does_not_support_stepdowns, // featureFlagSbeFull, // ] -import {getPlanStage, getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getPlanStage, getPlanStages} from "jstests/libs/query/analyze_plan.js"; const coll = db.index_bounds_static_limit; coll.drop(); diff --git a/jstests/noPassthroughWithMongod/query/large_in_with_indexes.js b/jstests/noPassthroughWithMongod/query/large_in_with_indexes.js index e19e0be061d..0d31763ed3f 100644 --- a/jstests/noPassthroughWithMongod/query/large_in_with_indexes.js +++ b/jstests/noPassthroughWithMongod/query/large_in_with_indexes.js @@ -1,6 +1,6 @@ // Tests that a query with $in filter over a large array chooses the optimal index. We ban SBE // multi planner to run as it chooses a plan with a suboptimal index. -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; // The SBE multi planner chooses the wrong index. diff --git a/jstests/noPassthroughWithMongod/query/lookup_match_pushdown.js b/jstests/noPassthroughWithMongod/query/lookup_match_pushdown.js index 304c95db155..6017079689c 100644 --- a/jstests/noPassthroughWithMongod/query/lookup_match_pushdown.js +++ b/jstests/noPassthroughWithMongod/query/lookup_match_pushdown.js @@ -2,7 +2,7 @@ * Tests that the $match stage is pushed before $lookup stage. */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const coll = db.lookup_match_pushdown; coll.drop(); diff --git a/jstests/noPassthroughWithMongod/query/lookup_with_limit.js b/jstests/noPassthroughWithMongod/query/lookup_with_limit.js index 29173bd5ffe..1ee059eaca3 100644 --- a/jstests/noPassthroughWithMongod/query/lookup_with_limit.js +++ b/jstests/noPassthroughWithMongod/query/lookup_with_limit.js @@ -1,12 +1,12 @@ /** * Tests that the $limit stage is pushed before $lookup stages, except when there is an $unwind. */ -import {flattenQueryPlanTree, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {flattenQueryPlanTree, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; import { checkSbeFullFeatureFlagEnabled, checkSbeFullyEnabled, checkSbeRestrictedOrFullyEnabled -} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/sbe_util.js"; const isFeatureFlagSbeFullEnabled = checkSbeFullFeatureFlagEnabled(db); const isSbeEnabled = checkSbeFullyEnabled(db); diff --git a/jstests/noPassthroughWithMongod/query/ne_array_indexability.js b/jstests/noPassthroughWithMongod/query/ne_array_indexability.js index e3cbe4fcd3f..fbf0e0c3d96 100644 --- a/jstests/noPassthroughWithMongod/query/ne_array_indexability.js +++ b/jstests/noPassthroughWithMongod/query/ne_array_indexability.js @@ -4,8 +4,8 @@ import { getPlanCacheKeyFromShape, getPlanCacheShapeHashFromObject -} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const isUsingSbePlanCache = checkSbeFullFeatureFlagEnabled(db); diff --git a/jstests/noPassthroughWithMongod/query/now_variable.js b/jstests/noPassthroughWithMongod/query/now_variable.js index 575dac1f578..65e001f0633 100644 --- a/jstests/noPassthroughWithMongod/query/now_variable.js +++ b/jstests/noPassthroughWithMongod/query/now_variable.js @@ -1,9 +1,9 @@ /** * Tests for the $$NOW and $$CLUSTER_TIME system variable. */ -import "jstests/libs/sbe_assert_error_override.js"; -import {getWinningPlan, isIxscan} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; +import {getWinningPlan, isIxscan} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const coll = db[jsTest.name()]; const otherColl = db[coll.getName() + "_other"]; diff --git a/jstests/noPassthroughWithMongod/query/or_clustered_collection_sbe_cache.js b/jstests/noPassthroughWithMongod/query/or_clustered_collection_sbe_cache.js index 4b60291cc0f..22a78f28825 100644 --- a/jstests/noPassthroughWithMongod/query/or_clustered_collection_sbe_cache.js +++ b/jstests/noPassthroughWithMongod/query/or_clustered_collection_sbe_cache.js @@ -3,7 +3,7 @@ * CLUSTERED_IXSCAN stages does not use the SBE plan cache. */ import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const mongod = MongoRunner.runMongod(); const dbName = "test"; diff --git a/jstests/noPassthroughWithMongod/query/plan_cache_not_in_regex.js b/jstests/noPassthroughWithMongod/query/plan_cache_not_in_regex.js index 7864e371742..9abea3421b7 100644 --- a/jstests/noPassthroughWithMongod/query/plan_cache_not_in_regex.js +++ b/jstests/noPassthroughWithMongod/query/plan_cache_not_in_regex.js @@ -2,7 +2,11 @@ * Tests that a $not-$in-$regex query, which cannot be supported by an index, cannot incorrectly * hijack the cached plan for an earlier $not-$in query. */ -import {getPlanCacheKeyFromShape, getWinningPlan, isCollscan} from "jstests/libs/analyze_plan.js"; +import { + getPlanCacheKeyFromShape, + getWinningPlan, + isCollscan +} from "jstests/libs/query/analyze_plan.js"; const coll = db.plan_cache_not_in_regex; coll.drop(); diff --git a/jstests/noPassthroughWithMongod/query/plan_cache_replanning.js b/jstests/noPassthroughWithMongod/query/plan_cache_replanning.js index 15b45ea8328..47e466ebc7f 100644 --- a/jstests/noPassthroughWithMongod/query/plan_cache_replanning.js +++ b/jstests/noPassthroughWithMongod/query/plan_cache_replanning.js @@ -3,14 +3,14 @@ * oscillates. It achieves this by creating two indexes, A and B, on a collection, and interleaving * queries which are "ideal" for index A with queries that are "ideal" for index B. */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { getCachedPlan, getPlanCacheKeyFromShape, getPlanCacheShapeHashFromObject, getPlanStage -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; -import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/sbe_util.js"; +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullFeatureFlagEnabled} from "jstests/libs/query/sbe_util.js"; const isSbePlanCacheEnabled = checkSbeFullFeatureFlagEnabled(db); diff --git a/jstests/noPassthroughWithMongod/query/plan_selection_no_results.js b/jstests/noPassthroughWithMongod/query/plan_selection_no_results.js index 40c32548f4d..4d384a1ab79 100644 --- a/jstests/noPassthroughWithMongod/query/plan_selection_no_results.js +++ b/jstests/noPassthroughWithMongod/query/plan_selection_no_results.js @@ -4,7 +4,7 @@ * The plan which is able to most cheaply determine that there are no results should be selected as * the winner. */ -import {getEngine, getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getEngine, getPlanStage} from "jstests/libs/query/analyze_plan.js"; const coll = db.plan_selection_no_results; coll.drop(); diff --git a/jstests/noPassthroughWithMongod/query/projection_optimizations.js b/jstests/noPassthroughWithMongod/query/projection_optimizations.js index 4da6e0a6e75..fc0e4e1c989 100644 --- a/jstests/noPassthroughWithMongod/query/projection_optimizations.js +++ b/jstests/noPassthroughWithMongod/query/projection_optimizations.js @@ -2,7 +2,7 @@ * Test projections with $and in cases where optimizations could be performed. */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getWinningPlan, isCollscan, isIndexOnly} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, isCollscan, isIndexOnly} from "jstests/libs/query/analyze_plan.js"; const coll = db.projection_and; coll.drop(); diff --git a/jstests/noPassthroughWithMongod/query/query_settings_standalone.js b/jstests/noPassthroughWithMongod/query/query_settings_standalone.js index 87c5ee034f1..3ebfabe9c6d 100644 --- a/jstests/noPassthroughWithMongod/query/query_settings_standalone.js +++ b/jstests/noPassthroughWithMongod/query/query_settings_standalone.js @@ -6,7 +6,7 @@ * ] */ -import {QuerySettingsUtils} from "jstests/libs/query_settings_utils.js"; +import {QuerySettingsUtils} from "jstests/libs/query/query_settings_utils.js"; const collName = jsTestName(); const qsutils = new QuerySettingsUtils(db, collName); diff --git a/jstests/noPassthroughWithMongod/query/sbe/sbe_index_count_scan_cache.js b/jstests/noPassthroughWithMongod/query/sbe/sbe_index_count_scan_cache.js index a10af4b8b9e..a12f66555af 100644 --- a/jstests/noPassthroughWithMongod/query/sbe/sbe_index_count_scan_cache.js +++ b/jstests/noPassthroughWithMongod/query/sbe/sbe_index_count_scan_cache.js @@ -6,7 +6,7 @@ * featureFlagSbeFull, * ] */ -import {getPlanStages, getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getWinningPlan} from "jstests/libs/query/analyze_plan.js"; const testDb = db.getSiblingDB(jsTestName()); assert.commandWorked(testDb.dropDatabase()); diff --git a/jstests/query_golden/array_index.js b/jstests/query_golden/array_index.js index 6177427c104..9f1d7f6a9fe 100644 --- a/jstests/query_golden/array_index.js +++ b/jstests/query_golden/array_index.js @@ -8,7 +8,7 @@ * ] */ import {show} from "jstests/libs/golden_test.js"; -import {getPlanSkeleton} from "jstests/libs/optimizer_utils.js"; +import {getPlanSkeleton} from "jstests/libs/query/optimizer_utils.js"; db.setLogLevel(4, "query"); diff --git a/jstests/query_golden/ce_mixed.js b/jstests/query_golden/ce_mixed.js index bf6b37369ca..1950fa2fae9 100644 --- a/jstests/query_golden/ce_mixed.js +++ b/jstests/query_golden/ce_mixed.js @@ -11,7 +11,7 @@ import { runHistogramsTest, summarizeExplainForCE } from "jstests/libs/ce_stats_utils.js"; -import {forceCE} from "jstests/libs/optimizer_utils.js"; +import {forceCE} from "jstests/libs/query/optimizer_utils.js"; const collCard = 300; const numberBuckets = 5; diff --git a/jstests/query_golden/ce_sampled_histogram.js b/jstests/query_golden/ce_sampled_histogram.js index 846bbf8e048..41e5f3bc26e 100644 --- a/jstests/query_golden/ce_sampled_histogram.js +++ b/jstests/query_golden/ce_sampled_histogram.js @@ -12,7 +12,7 @@ import { summarizeExplainForCE } from "jstests/libs/ce_stats_utils.js"; import {loadJSONDataset} from "jstests/libs/load_ce_test_data.js"; -import {forceCE, round2} from "jstests/libs/optimizer_utils.js"; +import {forceCE, round2} from "jstests/libs/query/optimizer_utils.js"; import {computeStrategyErrors} from "jstests/query_golden/libs/compute_errors.js"; /** diff --git a/jstests/query_golden/extraneous_project.js b/jstests/query_golden/extraneous_project.js index 1ae3a65ab3e..026808cf8d8 100644 --- a/jstests/query_golden/extraneous_project.js +++ b/jstests/query_golden/extraneous_project.js @@ -7,7 +7,7 @@ * ] */ import {show} from "jstests/libs/golden_test.js"; -import {getPlanSkeleton} from "jstests/libs/optimizer_utils.js"; +import {getPlanSkeleton} from "jstests/libs/query/optimizer_utils.js"; db.setLogLevel(4, "query"); diff --git a/jstests/query_golden/libs/compute_errors.js b/jstests/query_golden/libs/compute_errors.js index 1c06853eb57..151591f0174 100644 --- a/jstests/query_golden/libs/compute_errors.js +++ b/jstests/query_golden/libs/compute_errors.js @@ -1,4 +1,4 @@ -import {round2} from "jstests/libs/optimizer_utils.js"; +import {round2} from "jstests/libs/query/optimizer_utils.js"; /** * Compute cardinality estimation errors for a testcase and CE strategy. diff --git a/jstests/query_golden/libs/run_queries_ce.js b/jstests/query_golden/libs/run_queries_ce.js index b0244386646..996ddbb20d0 100644 --- a/jstests/query_golden/libs/run_queries_ce.js +++ b/jstests/query_golden/libs/run_queries_ce.js @@ -4,7 +4,7 @@ import { getPlanSkeleton, navigateToRootNode, round2 -} from "jstests/libs/optimizer_utils.js"; +} from "jstests/libs/query/optimizer_utils.js"; import { aggegateOptimizationTimesPerStrategy, aggregateErrorsPerCategory, diff --git a/jstests/query_golden/non_multikey_paths.js b/jstests/query_golden/non_multikey_paths.js index 988bac0a216..ba431d7e3e6 100644 --- a/jstests/query_golden/non_multikey_paths.js +++ b/jstests/query_golden/non_multikey_paths.js @@ -7,7 +7,7 @@ * requires_cqf, * ] */ -import {leftmostLeafStage, prettyInterval} from "jstests/libs/optimizer_utils.js"; +import {leftmostLeafStage, prettyInterval} from "jstests/libs/query/optimizer_utils.js"; db.setLogLevel(4, "query"); diff --git a/jstests/query_golden/not_pushdown.js b/jstests/query_golden/not_pushdown.js index 76e17bdee21..2df8383d5ff 100644 --- a/jstests/query_golden/not_pushdown.js +++ b/jstests/query_golden/not_pushdown.js @@ -8,7 +8,7 @@ * requires_cqf, * ] */ -import {findSubtrees} from "jstests/libs/optimizer_utils.js"; +import {findSubtrees} from "jstests/libs/query/optimizer_utils.js"; const coll = db.cqf_not_pushdown; coll.drop(); diff --git a/jstests/query_golden/null_missing.js b/jstests/query_golden/null_missing.js index 01bad7370ed..c7d1b4da4f6 100644 --- a/jstests/query_golden/null_missing.js +++ b/jstests/query_golden/null_missing.js @@ -7,7 +7,7 @@ * requires_cqf, * ] */ -import {getPlanSkeleton} from "jstests/libs/optimizer_utils.js"; +import {getPlanSkeleton} from "jstests/libs/query/optimizer_utils.js"; db.setLogLevel(4, "query"); diff --git a/jstests/replsets/apply_ops_inserts_do_not_include_fromMigrate_field.js b/jstests/replsets/apply_ops_inserts_do_not_include_fromMigrate_field.js index 0c8209b4b48..b3f3c90475c 100644 --- a/jstests/replsets/apply_ops_inserts_do_not_include_fromMigrate_field.js +++ b/jstests/replsets/apply_ops_inserts_do_not_include_fromMigrate_field.js @@ -9,7 +9,7 @@ * multiversion_incompatible, * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; const rst = new ReplSetTest({nodes: [{}, {rsConfig: {priority: 0, votes: 0}}]}); diff --git a/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js b/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js index ef34a58c4e6..64a0ba445b4 100644 --- a/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js +++ b/jstests/replsets/change_stream_pit_pre_image_deletion_asymmetric.js @@ -7,7 +7,7 @@ * requires_fcv_60, * ] */ -import {getPreImages} from "jstests/libs/change_stream_util.js"; +import {getPreImages} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {getFirstOplogEntry, getLatestOp} from "jstests/replsets/rslib.js"; diff --git a/jstests/replsets/change_stream_pit_pre_images.js b/jstests/replsets/change_stream_pit_pre_images.js index 78756e00693..27bf2c0da92 100644 --- a/jstests/replsets/change_stream_pit_pre_images.js +++ b/jstests/replsets/change_stream_pit_pre_images.js @@ -12,8 +12,8 @@ * ] */ import {PrepareHelpers} from "jstests/core/txns/libs/prepare_helpers.js"; -import {getPreImages, getPreImagesCollection} from "jstests/libs/change_stream_util.js"; import {configureFailPoint} from "jstests/libs/fail_point_util.js"; +import {getPreImages, getPreImagesCollection} from "jstests/libs/query/change_stream_util.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {TransactionsUtil} from "jstests/libs/transactions_util.js"; diff --git a/jstests/replsets/preserve_record_ids_apply_ops_txns.js b/jstests/replsets/preserve_record_ids_apply_ops_txns.js index c7492a6af3c..fb4a6d1d2bb 100644 --- a/jstests/replsets/preserve_record_ids_apply_ops_txns.js +++ b/jstests/replsets/preserve_record_ids_apply_ops_txns.js @@ -10,7 +10,7 @@ * exclude_when_record_ids_replicated * ] */ -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; import { validateShowRecordIdReplicatesAcrossNodes, } from "jstests/libs/replicated_record_ids_utils.js"; diff --git a/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js b/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js index ea6045b5091..140d445175f 100644 --- a/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js +++ b/jstests/sharding/analyze_shard_key/libs/sample_nested_agg_queries_common.js @@ -2,7 +2,7 @@ * Utilities for testing basic support for sampling nested aggregate queries (i.e. ones inside * $lookup, $graphLookup, $unionWith) on a sharded cluster. */ -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {QuerySamplingUtil} from "jstests/sharding/analyze_shard_key/libs/query_sampling_util.js"; // Make the periodic jobs for refreshing sample rates and writing sampled queries and diffs have a diff --git a/jstests/sharding/api_version_stage_allowance_checks.js b/jstests/sharding/api_version_stage_allowance_checks.js index 03cbea30eac..eaab0ec5d93 100644 --- a/jstests/sharding/api_version_stage_allowance_checks.js +++ b/jstests/sharding/api_version_stage_allowance_checks.js @@ -9,7 +9,7 @@ * ] */ -import {getSingleNodeExplain} from "jstests/libs/analyze_plan.js"; +import {getSingleNodeExplain} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 2}); diff --git a/jstests/sharding/clustered_coll_scan.js b/jstests/sharding/clustered_coll_scan.js index 9d2a477128c..4e41b117fe9 100644 --- a/jstests/sharding/clustered_coll_scan.js +++ b/jstests/sharding/clustered_coll_scan.js @@ -3,8 +3,8 @@ * (SERVER-83119) */ -import {isClusteredIxscan, isExpress} from "jstests/libs/analyze_plan.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {isClusteredIxscan, isExpress} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/sharding/compound_hashed_shard_key_covered_query.js b/jstests/sharding/compound_hashed_shard_key_covered_query.js index eb9b2b3f646..228a41efa20 100644 --- a/jstests/sharding/compound_hashed_shard_key_covered_query.js +++ b/jstests/sharding/compound_hashed_shard_key_covered_query.js @@ -2,7 +2,7 @@ * Test to verify the covering behaviour of compound hashed index on a cluster sharded with compound * hashed shard key. */ -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 2}); diff --git a/jstests/sharding/compound_hashed_shard_key_targeting.js b/jstests/sharding/compound_hashed_shard_key_targeting.js index 25c560c4a13..8dc694039b1 100644 --- a/jstests/sharding/compound_hashed_shard_key_targeting.js +++ b/jstests/sharding/compound_hashed_shard_key_targeting.js @@ -8,12 +8,12 @@ * ] */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; -import {assertStagesForExplainOfCommand} from "jstests/libs/analyze_plan.js"; import { profilerHasAtLeastOneMatchingEntryOrThrow, profilerHasSingleMatchingEntryOrThrow, profilerHasZeroMatchingEntriesOrThrow, } from "jstests/libs/profiler.js"; +import {assertStagesForExplainOfCommand} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import {findChunksUtil} from "jstests/sharding/libs/find_chunks_util.js"; import { diff --git a/jstests/sharding/covered_shard_key_indexes.js b/jstests/sharding/covered_shard_key_indexes.js index 2a0330aebfb..3f950fa1e71 100644 --- a/jstests/sharding/covered_shard_key_indexes.js +++ b/jstests/sharding/covered_shard_key_indexes.js @@ -3,7 +3,7 @@ // particular queries // -import {getChunkSkipsFromShard} from "jstests/libs/analyze_plan.js"; +import {getChunkSkipsFromShard} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 1}); diff --git a/jstests/sharding/error_propagation.js b/jstests/sharding/error_propagation.js index 184f3d8e40e..e40a62e9135 100644 --- a/jstests/sharding/error_propagation.js +++ b/jstests/sharding/error_propagation.js @@ -1,4 +1,4 @@ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/sharding/explain_find_transformed_query.js b/jstests/sharding/explain_find_transformed_query.js index 822edde96f8..214ab74afa4 100644 --- a/jstests/sharding/explain_find_transformed_query.js +++ b/jstests/sharding/explain_find_transformed_query.js @@ -17,6 +17,7 @@ * ] */ +import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import { getEngine, getPlanCacheKeyFromExplain, @@ -25,8 +26,7 @@ import { getQueryPlanner, getWinningPlan, getWinningSBEPlan -} from "jstests/libs/analyze_plan.js"; -import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/sharding/hashed_shard_key_index_optional_shard_collection.js b/jstests/sharding/hashed_shard_key_index_optional_shard_collection.js index 44a888ad5c4..ff6ff0b22e6 100644 --- a/jstests/sharding/hashed_shard_key_index_optional_shard_collection.js +++ b/jstests/sharding/hashed_shard_key_index_optional_shard_collection.js @@ -29,7 +29,7 @@ import { getWinningPlanFromExplain, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import { AnalyzeShardKeyUtil diff --git a/jstests/sharding/internal_txns/partial_index.js b/jstests/sharding/internal_txns/partial_index.js index ed566971bff..24f5c23f2fc 100644 --- a/jstests/sharding/internal_txns/partial_index.js +++ b/jstests/sharding/internal_txns/partial_index.js @@ -4,7 +4,7 @@ * * @tags: [requires_fcv_60, uses_transactions] */ -import {getWinningPlan} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan} from "jstests/libs/query/analyze_plan.js"; import {ReplSetTest} from "jstests/libs/replsettest.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/sharding/move_collection_changestreams_resumability.js b/jstests/sharding/move_collection_changestreams_resumability.js index 66ba3c5276f..92959135d4f 100644 --- a/jstests/sharding/move_collection_changestreams_resumability.js +++ b/jstests/sharding/move_collection_changestreams_resumability.js @@ -11,7 +11,7 @@ // uses_atclustertime, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ReshardingTest} from "jstests/sharding/libs/resharding_test_fixture.js"; // Use a higher frequency for periodic noops to speed up the test. diff --git a/jstests/sharding/query/agg/agg_explain_fmt.js b/jstests/sharding/query/agg/agg_explain_fmt.js index ac51f3baf30..b9ac7d0d006 100644 --- a/jstests/sharding/query/agg/agg_explain_fmt.js +++ b/jstests/sharding/query/agg/agg_explain_fmt.js @@ -5,7 +5,7 @@ * ] */ -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 2}); diff --git a/jstests/sharding/query/agg/agg_mongos_merge.js b/jstests/sharding/query/agg/agg_mongos_merge.js index 7ef3c8fb121..fa00e81caf9 100644 --- a/jstests/sharding/query/agg/agg_mongos_merge.js +++ b/jstests/sharding/query/agg/agg_mongos_merge.js @@ -16,7 +16,7 @@ * ] */ -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 2, mongos: 1}); diff --git a/jstests/sharding/query/change_streams/change_stream_on_system_collection.js b/jstests/sharding/query/change_streams/change_stream_on_system_collection.js index aad83eda824..c8a9ac7c1be 100644 --- a/jstests/sharding/query/change_streams/change_stream_on_system_collection.js +++ b/jstests/sharding/query/change_streams/change_stream_on_system_collection.js @@ -9,8 +9,8 @@ * uses_change_streams, * ] */ -import {assertChangeStreamEventEq} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {assertChangeStreamEventEq} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // This test involves opening change stream on the internal collection, which is not allowed through diff --git a/jstests/sharding/query/change_streams/change_stream_resume_from_different_mongos.js b/jstests/sharding/query/change_streams/change_stream_resume_from_different_mongos.js index 6499067f005..c4870339d1b 100644 --- a/jstests/sharding/query/change_streams/change_stream_resume_from_different_mongos.js +++ b/jstests/sharding/query/change_streams/change_stream_resume_from_different_mongos.js @@ -3,8 +3,8 @@ // requires_majority_read_concern, // uses_change_streams, // ] -import {ChangeStreamTest, ChangeStreamWatchMode} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest, ChangeStreamWatchMode} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/sharding/query/change_streams/change_stream_shard_failover.js b/jstests/sharding/query/change_streams/change_stream_shard_failover.js index 3ac43226e0c..1640d483a35 100644 --- a/jstests/sharding/query/change_streams/change_stream_shard_failover.js +++ b/jstests/sharding/query/change_streams/change_stream_shard_failover.js @@ -11,7 +11,7 @@ // stepdowns. TestData.skipCheckingUUIDsConsistentAcrossCluster = true; -import {ChangeStreamWatchMode, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamWatchMode, ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/sharding/query/change_streams/change_streams.js b/jstests/sharding/query/change_streams/change_streams.js index 89da2ee73bb..18b7e6288b4 100644 --- a/jstests/sharding/query/change_streams/change_streams.js +++ b/jstests/sharding/query/change_streams/change_streams.js @@ -7,7 +7,7 @@ import {assertErrorCode} from "jstests/aggregation/extras/utils.js"; import { assertChangeStreamEventEq, canonicalizeEventForTesting -} from "jstests/libs/change_stream_util.js"; +} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import {TwoPhaseDropCollectionTest} from "jstests/replsets/libs/two_phase_drops.js"; diff --git a/jstests/sharding/query/change_streams/change_streams_delete_in_txn_produces_correct_doc_key.js b/jstests/sharding/query/change_streams/change_streams_delete_in_txn_produces_correct_doc_key.js index a5ad4153e30..ece42c63326 100644 --- a/jstests/sharding/query/change_streams/change_streams_delete_in_txn_produces_correct_doc_key.js +++ b/jstests/sharding/query/change_streams/change_streams_delete_in_txn_produces_correct_doc_key.js @@ -6,8 +6,8 @@ // uses_change_streams, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Create a new sharded cluster. For this test, in addition to testing 'delete' events within a diff --git a/jstests/sharding/query/change_streams/change_streams_primary_shard_unaware.js b/jstests/sharding/query/change_streams/change_streams_primary_shard_unaware.js index 2e34fedddf6..299be8b5ce4 100644 --- a/jstests/sharding/query/change_streams/change_streams_primary_shard_unaware.js +++ b/jstests/sharding/query/change_streams/change_streams_primary_shard_unaware.js @@ -13,7 +13,7 @@ // embedded_router_incompatible, // uses_change_streams, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Returns true if the shard is aware that the collection is sharded. diff --git a/jstests/sharding/query/change_streams/change_streams_shards_start_in_sync.js b/jstests/sharding/query/change_streams/change_streams_shards_start_in_sync.js index 0aa0142ed26..f537af5cb53 100644 --- a/jstests/sharding/query/change_streams/change_streams_shards_start_in_sync.js +++ b/jstests/sharding/query/change_streams/change_streams_shards_start_in_sync.js @@ -54,7 +54,7 @@ assert.commandWorked(mongosDB.adminCommand( {moveChunk: mongosColl.getFullName(), find: {_id: 1}, to: st.rs1.getURL()})); async function checkStream() { - const {assertChangeStreamEventEq} = await import("jstests/libs/change_stream_util.js"); + const {assertChangeStreamEventEq} = await import("jstests/libs/query/change_stream_util.js"); const testDb = db.getSiblingDB(jsTestName()); let coll = testDb[jsTestName()]; diff --git a/jstests/sharding/query/change_streams/change_streams_survive_move_primary.js b/jstests/sharding/query/change_streams/change_streams_survive_move_primary.js index a8ea59b17a7..f2d9bb65c98 100644 --- a/jstests/sharding/query/change_streams/change_streams_survive_move_primary.js +++ b/jstests/sharding/query/change_streams/change_streams_survive_move_primary.js @@ -7,8 +7,8 @@ * uses_change_streams, * ] */ -import {ChangeStreamTest, ChangeStreamWatchMode} from 'jstests/libs/change_stream_util.js'; import {assertCreateCollection} from 'jstests/libs/collection_drop_recreate.js'; +import {ChangeStreamTest, ChangeStreamWatchMode} from 'jstests/libs/query/change_stream_util.js'; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/sharding/query/change_streams/change_streams_unsharded_becomes_sharded.js b/jstests/sharding/query/change_streams/change_streams_unsharded_becomes_sharded.js index ed5746084b7..9761b6368cb 100644 --- a/jstests/sharding/query/change_streams/change_streams_unsharded_becomes_sharded.js +++ b/jstests/sharding/query/change_streams/change_streams_unsharded_becomes_sharded.js @@ -10,7 +10,7 @@ // requires_majority_read_concern, // uses_change_streams, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const testName = "change_streams_unsharded_becomes_sharded"; diff --git a/jstests/sharding/query/change_streams/change_streams_whole_db.js b/jstests/sharding/query/change_streams/change_streams_whole_db.js index fd4f7f09bf5..feade16e40c 100644 --- a/jstests/sharding/query/change_streams/change_streams_whole_db.js +++ b/jstests/sharding/query/change_streams/change_streams_whole_db.js @@ -3,8 +3,8 @@ // requires_majority_read_concern, // uses_change_streams, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {assertDropCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ diff --git a/jstests/sharding/query/change_streams/change_streams_with_config_transitions.js b/jstests/sharding/query/change_streams/change_streams_with_config_transitions.js index 9674a0d7420..1737c5e1051 100644 --- a/jstests/sharding/query/change_streams/change_streams_with_config_transitions.js +++ b/jstests/sharding/query/change_streams/change_streams_with_config_transitions.js @@ -9,8 +9,8 @@ * ] */ -import {ChangeStreamTest, ChangeStreamWatchMode} from "jstests/libs/change_stream_util.js"; import {assertDropAndRecreateCollection} from "jstests/libs/collection_drop_recreate.js"; +import {ChangeStreamTest, ChangeStreamWatchMode} from "jstests/libs/query/change_stream_util.js"; import {ShardTransitionUtil} from "jstests/libs/shard_transition_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import { diff --git a/jstests/sharding/query/change_streams/resume_change_stream.js b/jstests/sharding/query/change_streams/resume_change_stream.js index 9154b3c7465..17af318e7dd 100644 --- a/jstests/sharding/query/change_streams/resume_change_stream.js +++ b/jstests/sharding/query/change_streams/resume_change_stream.js @@ -4,7 +4,7 @@ // requires_majority_read_concern, // uses_change_streams, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import {getFirstOplogEntry, getLatestOp} from "jstests/replsets/rslib.js"; diff --git a/jstests/sharding/query/distinct_scan_shard_filtering.js b/jstests/sharding/query/distinct_scan_shard_filtering.js index 1177a70e15e..929605c0f14 100644 --- a/jstests/sharding/query/distinct_scan_shard_filtering.js +++ b/jstests/sharding/query/distinct_scan_shard_filtering.js @@ -9,7 +9,7 @@ * ] */ -import {getWinningPlan, planHasStage} from "jstests/libs/analyze_plan.js"; +import {getWinningPlan, planHasStage} from "jstests/libs/query/analyze_plan.js"; import { assertPipelineResultsAndExplain, assertPlanDoesNotUseDistinctScan, @@ -18,7 +18,7 @@ import { assertPlanUsesIndexScan, coll, prepareCollection -} from "jstests/libs/group_to_distinct_scan_utils.js"; +} from "jstests/libs/query/group_to_distinct_scan_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; TestData.skipCheckOrphans = true; diff --git a/jstests/sharding/query/eof_plan.js b/jstests/sharding/query/eof_plan.js index 1bef482872b..b8073025e2b 100644 --- a/jstests/sharding/query/eof_plan.js +++ b/jstests/sharding/query/eof_plan.js @@ -8,7 +8,7 @@ * ] */ -import {getWinningPlanFromExplain} from 'jstests/libs/analyze_plan.js'; +import {getWinningPlanFromExplain} from 'jstests/libs/query/analyze_plan.js'; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({ shards: 2, diff --git a/jstests/sharding/query/geo/geo_near_random1.js b/jstests/sharding/query/geo/geo_near_random1.js index 64370182efe..928b73f7f13 100644 --- a/jstests/sharding/query/geo/geo_near_random1.js +++ b/jstests/sharding/query/geo/geo_near_random1.js @@ -2,10 +2,10 @@ * This tests all points using $near. */ -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; -var testName = "geo_near_random1"; +var testName = jsTestName(); var s = new ShardingTest({shards: 3}); var db = s.getDB("test"); diff --git a/jstests/sharding/query/geo/geo_near_random2.js b/jstests/sharding/query/geo/geo_near_random2.js index cc842bf015a..f3ffc9538e1 100644 --- a/jstests/sharding/query/geo/geo_near_random2.js +++ b/jstests/sharding/query/geo/geo_near_random2.js @@ -2,10 +2,10 @@ * This tests 1% of all points using $near and $nearSphere. */ -import {GeoNearRandomTest} from "jstests/libs/geo_near_random.js"; +import {GeoNearRandomTest} from "jstests/libs/query/geo_near_random.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; -var testName = "geo_near_random2"; +var testName = jsTestName(); var s = new ShardingTest({shards: 3}); var db = s.getDB("test"); diff --git a/jstests/sharding/query/lookup/lookup_targeting.js b/jstests/sharding/query/lookup/lookup_targeting.js index 9dc600d31cd..89ba0924846 100644 --- a/jstests/sharding/query/lookup/lookup_targeting.js +++ b/jstests/sharding/query/lookup/lookup_targeting.js @@ -23,7 +23,7 @@ import {configureFailPoint} from "jstests/libs/fail_point_util.js"; import {funWithArgs} from "jstests/libs/parallel_shell_helpers.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ShardTargetingTest} from "jstests/libs/shard_targeting_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; diff --git a/jstests/sharding/query/out_merge/merge_on_fields.js b/jstests/sharding/query/out_merge/merge_on_fields.js index 58d7b180969..e05063abf76 100644 --- a/jstests/sharding/query/out_merge/merge_on_fields.js +++ b/jstests/sharding/query/out_merge/merge_on_fields.js @@ -1,7 +1,7 @@ // Tests that the "on" fields are correctly automatically generated when the user does not specify // it in the $merge stage. import {withEachMergeMode} from "jstests/aggregation/extras/merge_helpers.js"; -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const st = new ShardingTest({shards: 2, rs: {nodes: 1}}); diff --git a/jstests/sharding/query/pipeline_length_limit.js b/jstests/sharding/query/pipeline_length_limit.js index faab93330ad..6a9e6fdf59a 100644 --- a/jstests/sharding/query/pipeline_length_limit.js +++ b/jstests/sharding/query/pipeline_length_limit.js @@ -5,7 +5,7 @@ * ] */ import {FixtureHelpers} from "jstests/libs/fixture_helpers.js"; -import {getExpectedPipelineLimit} from "jstests/libs/optimizer_utils.js"; +import {getExpectedPipelineLimit} from "jstests/libs/query/optimizer_utils.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; function testLimits(testDB, lengthLimit) { diff --git a/jstests/sharding/query/queries_elide_shard_filter.js b/jstests/sharding/query/queries_elide_shard_filter.js index eece44b090f..1666e4174f6 100644 --- a/jstests/sharding/query/queries_elide_shard_filter.js +++ b/jstests/sharding/query/queries_elide_shard_filter.js @@ -5,7 +5,7 @@ // @tags: [ // ] -import {getPlanStage} from "jstests/libs/analyze_plan.js"; +import {getPlanStage} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; function assertShardFilter(explain) { diff --git a/jstests/sharding/query/sample_timeseries.js b/jstests/sharding/query/sample_timeseries.js index e8f86604019..6a340194cb5 100644 --- a/jstests/sharding/query/sample_timeseries.js +++ b/jstests/sharding/query/sample_timeseries.js @@ -8,7 +8,7 @@ * ] */ import {documentEq} from "jstests/aggregation/extras/utils.js"; -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; // Test deliberately inserts orphans. diff --git a/jstests/sharding/query/sbe_plan_cache_does_not_block_range_deletion.js b/jstests/sharding/query/sbe_plan_cache_does_not_block_range_deletion.js index 2856822cddc..eb6756975ba 100644 --- a/jstests/sharding/query/sbe_plan_cache_does_not_block_range_deletion.js +++ b/jstests/sharding/query/sbe_plan_cache_does_not_block_range_deletion.js @@ -9,8 +9,8 @@ * requires_fcv_80 * ] */ -import {getPlanCacheKeyFromShape} from "jstests/libs/analyze_plan.js"; -import {checkSbeFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanCacheKeyFromShape} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "test"; diff --git a/jstests/sharding/query/sbe_plan_cache_refined_shard_key.js b/jstests/sharding/query/sbe_plan_cache_refined_shard_key.js index b6548b5ae0e..69f4fe45fd3 100644 --- a/jstests/sharding/query/sbe_plan_cache_refined_shard_key.js +++ b/jstests/sharding/query/sbe_plan_cache_refined_shard_key.js @@ -12,7 +12,7 @@ import { getPlanCacheKeyFromPipeline, getPlanCacheShapeHashFromObject -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = "testdb"; diff --git a/jstests/sharding/resharding_change_stream_internal_ops.js b/jstests/sharding/resharding_change_stream_internal_ops.js index 9a8b303fb02..68b9b94b7a4 100644 --- a/jstests/sharding/resharding_change_stream_internal_ops.js +++ b/jstests/sharding/resharding_change_stream_internal_ops.js @@ -9,8 +9,11 @@ // uses_atclustertime, // // ] -import {assertChangeStreamEventEq, ChangeStreamTest} from "jstests/libs/change_stream_util.js"; import {DiscoverTopology} from "jstests/libs/discover_topology.js"; +import { + assertChangeStreamEventEq, + ChangeStreamTest +} from "jstests/libs/query/change_stream_util.js"; import {ReshardingTest} from "jstests/sharding/libs/resharding_test_fixture.js"; // Use a higher frequency for periodic noops to speed up the test. diff --git a/jstests/sharding/resharding_change_streams_resumability.js b/jstests/sharding/resharding_change_streams_resumability.js index ce25973f12f..d664d6f8d27 100644 --- a/jstests/sharding/resharding_change_streams_resumability.js +++ b/jstests/sharding/resharding_change_streams_resumability.js @@ -5,7 +5,7 @@ // requires_majority_read_concern, // uses_atclustertime, // ] -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ReshardingTest} from "jstests/sharding/libs/resharding_test_fixture.js"; // Use a higher frequency for periodic noops to speed up the test. diff --git a/jstests/sharding/shard3.js b/jstests/sharding/shard3.js index dcc2474f46a..278659304af 100644 --- a/jstests/sharding/shard3.js +++ b/jstests/sharding/shard3.js @@ -1,5 +1,5 @@ // Include helpers for analyzing explain output. -import {getChunkSkipsFromAllShards} from "jstests/libs/analyze_plan.js"; +import {getChunkSkipsFromAllShards} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const s = new ShardingTest({name: "shard3", shards: 2, mongos: 2, other: {enableBalancer: true}}); diff --git a/jstests/sharding/single_shard_find_forwarding.js b/jstests/sharding/single_shard_find_forwarding.js index 19c526e7b71..9e540cd8b29 100644 --- a/jstests/sharding/single_shard_find_forwarding.js +++ b/jstests/sharding/single_shard_find_forwarding.js @@ -8,8 +8,8 @@ * meets expectation. It then runs the same test against a sharded collection with a single shard. */ -import {getPlanStages} from "jstests/libs/analyze_plan.js"; import {profilerHasSingleMatchingEntryOrThrow} from "jstests/libs/profiler.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; function testArraySorted(arr, key) { diff --git a/jstests/sharding/timeseries_indexes.js b/jstests/sharding/timeseries_indexes.js index f640b60c674..fde5c2be287 100644 --- a/jstests/sharding/timeseries_indexes.js +++ b/jstests/sharding/timeseries_indexes.js @@ -8,8 +8,8 @@ */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; Random.setRandomSeed(); diff --git a/jstests/sharding/timeseries_query.js b/jstests/sharding/timeseries_query.js index 5ef3a4d9935..bf5147f0c83 100644 --- a/jstests/sharding/timeseries_query.js +++ b/jstests/sharding/timeseries_query.js @@ -8,7 +8,7 @@ */ import {TimeseriesTest} from "jstests/core/timeseries/libs/timeseries.js"; -import {isClusteredIxscan, isCollscan, isIxscan} from "jstests/libs/analyze_plan.js"; +import {isClusteredIxscan, isCollscan, isIxscan} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; Random.setRandomSeed(); diff --git a/jstests/sharding/timeseries_query_extended_range.js b/jstests/sharding/timeseries_query_extended_range.js index 69d50f3070a..dd31df5c3c8 100644 --- a/jstests/sharding/timeseries_query_extended_range.js +++ b/jstests/sharding/timeseries_query_extended_range.js @@ -9,7 +9,7 @@ * ] */ -import {getQueryPlanner} from "jstests/libs/analyze_plan.js"; +import {getQueryPlanner} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; const dbName = 'test'; diff --git a/jstests/sharding/timeseries_update_multi_explain.js b/jstests/sharding/timeseries_update_multi_explain.js index 35623dde2d4..2a8e7bdf168 100644 --- a/jstests/sharding/timeseries_update_multi_explain.js +++ b/jstests/sharding/timeseries_update_multi_explain.js @@ -12,7 +12,7 @@ import { generateTimeValue, makeBucketFilter } from "jstests/core/timeseries/libs/timeseries_writes_util.js"; -import {getExecutionStages} from "jstests/libs/analyze_plan.js"; +import {getExecutionStages} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import {TimeseriesMultiUpdateUtil} from "jstests/sharding/libs/timeseries_update_multi_util.js"; diff --git a/jstests/sharding/unshard_collection_change_steams_resumability.js b/jstests/sharding/unshard_collection_change_steams_resumability.js index eca8f473c2d..61fb7d1fcf3 100644 --- a/jstests/sharding/unshard_collection_change_steams_resumability.js +++ b/jstests/sharding/unshard_collection_change_steams_resumability.js @@ -13,7 +13,7 @@ * ] */ -import {ChangeStreamTest} from "jstests/libs/change_stream_util.js"; +import {ChangeStreamTest} from "jstests/libs/query/change_stream_util.js"; import {ReshardingTest} from "jstests/sharding/libs/resharding_test_fixture.js"; // Use a higher frequency for periodic noops to speed up the test. diff --git a/jstests/sharding/updateOne_without_shard_key/explain.js b/jstests/sharding/updateOne_without_shard_key/explain.js index c705a2d7fa1..541d1883662 100644 --- a/jstests/sharding/updateOne_without_shard_key/explain.js +++ b/jstests/sharding/updateOne_without_shard_key/explain.js @@ -7,7 +7,7 @@ * ] */ -import {getExecutionStages, getPlanStages} from "jstests/libs/analyze_plan.js"; +import {getExecutionStages, getPlanStages} from "jstests/libs/query/analyze_plan.js"; import {ShardingTest} from "jstests/libs/shardingtest.js"; import { WriteWithoutShardKeyTestUtil diff --git a/jstests/with_mongot/e2e/explain_execution_stats/search_meta_union_with_lookup_explain.js b/jstests/with_mongot/e2e/explain_execution_stats/search_meta_union_with_lookup_explain.js index e6ed05890ca..b49cf2cbdc6 100644 --- a/jstests/with_mongot/e2e/explain_execution_stats/search_meta_union_with_lookup_explain.js +++ b/jstests/with_mongot/e2e/explain_execution_stats/search_meta_union_with_lookup_explain.js @@ -5,7 +5,7 @@ * ] */ -import {getAggPlanStages, getUnionWithStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages, getUnionWithStage} from "jstests/libs/query/analyze_plan.js"; import {prepareUnionWithExplain} from "jstests/with_mongot/common_utils.js"; import { verifyE2ESearchMetaExplainOutput, diff --git a/jstests/with_mongot/e2e/explain_execution_stats/search_union_with_lookup_explain.js b/jstests/with_mongot/e2e/explain_execution_stats/search_union_with_lookup_explain.js index 7c351bd2c65..080d560bd58 100644 --- a/jstests/with_mongot/e2e/explain_execution_stats/search_union_with_lookup_explain.js +++ b/jstests/with_mongot/e2e/explain_execution_stats/search_union_with_lookup_explain.js @@ -5,7 +5,7 @@ * ] */ -import {getAggPlanStages, getUnionWithStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages, getUnionWithStage} from "jstests/libs/query/analyze_plan.js"; import {prepareUnionWithExplain} from "jstests/with_mongot/common_utils.js"; import { verifyE2ESearchExplainOutput, diff --git a/jstests/with_mongot/e2e/explain_execution_stats/vector_search_union_with_explain.js b/jstests/with_mongot/e2e/explain_execution_stats/vector_search_union_with_explain.js index d1adc4b7b98..93f221aed15 100644 --- a/jstests/with_mongot/e2e/explain_execution_stats/vector_search_union_with_explain.js +++ b/jstests/with_mongot/e2e/explain_execution_stats/vector_search_union_with_explain.js @@ -5,7 +5,7 @@ * ] */ -import {getUnionWithStage} from "jstests/libs/analyze_plan.js"; +import {getUnionWithStage} from "jstests/libs/query/analyze_plan.js"; import {prepareUnionWithExplain} from "jstests/with_mongot/common_utils.js"; import { generateRandomVectorEmbedding, diff --git a/jstests/with_mongot/e2e/lib/explain_utils.js b/jstests/with_mongot/e2e/lib/explain_utils.js index 9684161decb..d77710528f2 100644 --- a/jstests/with_mongot/e2e/lib/explain_utils.js +++ b/jstests/with_mongot/e2e/lib/explain_utils.js @@ -4,7 +4,7 @@ import { getAggPlanStages, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; import { validateMongotStageExplainExecutionStats, verifyShardsPartExplainOutput diff --git a/jstests/with_mongot/e2e/union_with_vector_search.js b/jstests/with_mongot/e2e/union_with_vector_search.js index 0018a96c30f..954b866904f 100644 --- a/jstests/with_mongot/e2e/union_with_vector_search.js +++ b/jstests/with_mongot/e2e/union_with_vector_search.js @@ -3,7 +3,7 @@ * The collection used for $vectorSearch in this test includes no score ties. */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; import { getMovieData, getPlotEmbeddingById diff --git a/jstests/with_mongot/e2e/vector_search_remove_embeddings.js b/jstests/with_mongot/e2e/vector_search_remove_embeddings.js index 668efe7dd05..3c6b856fc74 100644 --- a/jstests/with_mongot/e2e/vector_search_remove_embeddings.js +++ b/jstests/with_mongot/e2e/vector_search_remove_embeddings.js @@ -3,7 +3,7 @@ * instead of the embeddings. */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; import { getMovieData, getPlotEmbeddingById diff --git a/jstests/with_mongot/e2e/views/addFields_base_case.js b/jstests/with_mongot/e2e/views/addFields_base_case.js index 06281eed4db..7e0ec430f33 100644 --- a/jstests/with_mongot/e2e/views/addFields_base_case.js +++ b/jstests/with_mongot/e2e/views/addFields_base_case.js @@ -12,7 +12,6 @@ * ] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {aggPlanHasStage} from "jstests/libs/analyze_plan.js"; import {assertViewAppliedCorrectly} from "jstests/with_mongot/e2e/lib/explain_utils.js"; const testDb = db.getSiblingDB(jsTestName()); diff --git a/jstests/with_mongot/mongotmock/lib/utils.js b/jstests/with_mongot/mongotmock/lib/utils.js index 5a420a5fec4..29fb882c608 100644 --- a/jstests/with_mongot/mongotmock/lib/utils.js +++ b/jstests/with_mongot/mongotmock/lib/utils.js @@ -4,7 +4,7 @@ import { getAggPlanStage, -} from "jstests/libs/analyze_plan.js"; +} from "jstests/libs/query/analyze_plan.js"; import {validateMongotStageExplainExecutionStats} from "jstests/with_mongot/common_utils.js"; import { mongotMultiCursorResponseForBatch, diff --git a/jstests/with_mongot/search_mocked/limit_disables_prefetch.js b/jstests/with_mongot/search_mocked/limit_disables_prefetch.js index 213dc27df59..70acb0539c0 100644 --- a/jstests/with_mongot/search_mocked/limit_disables_prefetch.js +++ b/jstests/with_mongot/search_mocked/limit_disables_prefetch.js @@ -4,7 +4,7 @@ * @tags: [requires_fcv_71] */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestricted} from "jstests/libs/sbe_util.js"; +import {checkSbeRestricted} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { getDefaultProtocolVersionForPlanShardedSearch, diff --git a/jstests/with_mongot/search_mocked/search_and_lookup_with_cache.js b/jstests/with_mongot/search_mocked/search_and_lookup_with_cache.js index 9c9f097f63b..1fe5076952b 100644 --- a/jstests/with_mongot/search_mocked/search_and_lookup_with_cache.js +++ b/jstests/with_mongot/search_mocked/search_and_lookup_with_cache.js @@ -3,7 +3,7 @@ * from the cache. */ -import {checkSbeCompletelyDisabled, checkSbeRestricted} from "jstests/libs/sbe_util.js"; +import {checkSbeCompletelyDisabled, checkSbeRestricted} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {MongotMock} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; diff --git a/jstests/with_mongot/search_mocked/search_docsRequested.js b/jstests/with_mongot/search_mocked/search_docsRequested.js index 8d7beb4bbea..3365b1a250b 100644 --- a/jstests/with_mongot/search_mocked/search_docsRequested.js +++ b/jstests/with_mongot/search_mocked/search_docsRequested.js @@ -7,7 +7,7 @@ * @tags: [requires_fcv_71] */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { getDefaultProtocolVersionForPlanShardedSearch, diff --git a/jstests/with_mongot/search_mocked/search_explain.js b/jstests/with_mongot/search_mocked/search_explain.js index 9a827a68120..9e739167cf1 100644 --- a/jstests/with_mongot/search_mocked/search_explain.js +++ b/jstests/with_mongot/search_mocked/search_explain.js @@ -2,9 +2,9 @@ * Test the use of "explain" with the "$search" aggregation stage, but does not check the value of * executionStats. */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {MongotMock} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; import { @@ -12,6 +12,7 @@ import { setUpMongotReturnExplain, setUpMongotReturnExplainAndCursor, } from "jstests/with_mongot/mongotmock/lib/utils.js"; + // Set up mongotmock and point the mongod to it. const mongotmock = new MongotMock(); mongotmock.start(); diff --git a/jstests/with_mongot/search_mocked/search_explain_execution_stats.js b/jstests/with_mongot/search_mocked/search_explain_execution_stats.js index ca6b286b686..5ec1a06da7a 100644 --- a/jstests/with_mongot/search_mocked/search_explain_execution_stats.js +++ b/jstests/with_mongot/search_mocked/search_explain_execution_stats.js @@ -5,7 +5,7 @@ * */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { mongotCommandForQuery, diff --git a/jstests/with_mongot/search_mocked/search_explain_sbe.js b/jstests/with_mongot/search_mocked/search_explain_sbe.js index be484c0cbbe..036f293394d 100644 --- a/jstests/with_mongot/search_mocked/search_explain_sbe.js +++ b/jstests/with_mongot/search_mocked/search_explain_sbe.js @@ -2,7 +2,7 @@ * Test the use of "explain" with the "$search" aggregation stage in SBE. * @tags: [featureFlagSbeFull] */ -import {planHasStage} from "jstests/libs/analyze_plan.js"; +import {planHasStage} from "jstests/libs/query/analyze_plan.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {MongotMock} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; diff --git a/jstests/with_mongot/search_mocked/search_getMore_batchSize.js b/jstests/with_mongot/search_mocked/search_getMore_batchSize.js index bf46b8e346b..3d5c1844b58 100644 --- a/jstests/with_mongot/search_mocked/search_getMore_batchSize.js +++ b/jstests/with_mongot/search_mocked/search_getMore_batchSize.js @@ -2,9 +2,9 @@ * Tests that the batchSize field is sent to mongot correctly on GetMore requests. * @tags: [requires_fcv_81] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { mockAllRequestsWithBatchSizes, diff --git a/jstests/with_mongot/search_mocked/search_initial_batchSize.js b/jstests/with_mongot/search_mocked/search_initial_batchSize.js index e0fe05478fb..f59795e768a 100644 --- a/jstests/with_mongot/search_mocked/search_initial_batchSize.js +++ b/jstests/with_mongot/search_mocked/search_initial_batchSize.js @@ -3,7 +3,7 @@ * @tags: [requires_fcv_81] */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { getDefaultProtocolVersionForPlanShardedSearch, diff --git a/jstests/with_mongot/search_mocked/search_meta.js b/jstests/with_mongot/search_mocked/search_meta.js index 6e5f9229b88..4657f7c9334 100644 --- a/jstests/with_mongot/search_mocked/search_meta.js +++ b/jstests/with_mongot/search_mocked/search_meta.js @@ -1,9 +1,9 @@ /** * Verify that `$searchMeta` extracts SEARCH_META variable returned by mongot. */ -import {getPlanStages} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {mongotCommandForQuery, MongotMock} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; diff --git a/jstests/with_mongot/search_mocked/search_meta_explain.js b/jstests/with_mongot/search_mocked/search_meta_explain.js index 1948b42b477..d96487f635b 100644 --- a/jstests/with_mongot/search_mocked/search_meta_explain.js +++ b/jstests/with_mongot/search_mocked/search_meta_explain.js @@ -4,7 +4,7 @@ * @tags: [featureFlagSearchExplainExecutionStats] */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { mongotCommandForQuery, diff --git a/jstests/with_mongot/search_mocked/search_meta_var_explain.js b/jstests/with_mongot/search_mocked/search_meta_var_explain.js index e028e139d26..e3c40ac0826 100644 --- a/jstests/with_mongot/search_mocked/search_meta_var_explain.js +++ b/jstests/with_mongot/search_mocked/search_meta_var_explain.js @@ -4,9 +4,9 @@ * response. * @tags: [featureFlagSearchExplainExecutionStats] */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {prepareUnionWithExplain} from "jstests/with_mongot/common_utils.js"; import { diff --git a/jstests/with_mongot/search_mocked/search_metadata.js b/jstests/with_mongot/search_mocked/search_metadata.js index a0eb7d58769..57c74edb97c 100644 --- a/jstests/with_mongot/search_mocked/search_metadata.js +++ b/jstests/with_mongot/search_mocked/search_metadata.js @@ -3,7 +3,7 @@ * plumbed through the $search agg stage. */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { mongotCommandForQuery, diff --git a/jstests/with_mongot/search_mocked/search_query_stats.js b/jstests/with_mongot/search_mocked/search_query_stats.js index 03221d99a1b..59e1f874980 100644 --- a/jstests/with_mongot/search_mocked/search_query_stats.js +++ b/jstests/with_mongot/search_mocked/search_query_stats.js @@ -1,7 +1,7 @@ /** * Verify the query shape that is outputted by $queryStats for $search and $searchMeta queries. */ -import {getQueryStats} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats} from "jstests/libs/query/query_stats_utils.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {MongotMock} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; diff --git a/jstests/with_mongot/search_mocked/search_sbe.js b/jstests/with_mongot/search_mocked/search_sbe.js index c589b01fb97..96d2eeb7da0 100644 --- a/jstests/with_mongot/search_mocked/search_sbe.js +++ b/jstests/with_mongot/search_mocked/search_sbe.js @@ -3,9 +3,9 @@ * @tags: [featureFlagSbeFull] */ import {assertArrayEq} from "jstests/aggregation/extras/utils.js"; -import {getAggPlanStages, getWinningPlanFromExplain} from "jstests/libs/analyze_plan.js"; -import {assertEngine} from "jstests/libs/analyze_plan.js"; import {configureFailPoint} from "jstests/libs/fail_point_util.js"; +import {getAggPlanStages, getWinningPlanFromExplain} from "jstests/libs/query/analyze_plan.js"; +import {assertEngine} from "jstests/libs/query/analyze_plan.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { mongotCommandForQuery, diff --git a/jstests/with_mongot/search_mocked/search_sbe_shard.js b/jstests/with_mongot/search_mocked/search_sbe_shard.js index 320c2831d94..995d4e2899d 100644 --- a/jstests/with_mongot/search_mocked/search_sbe_shard.js +++ b/jstests/with_mongot/search_mocked/search_sbe_shard.js @@ -2,7 +2,7 @@ * Sharding tests for using "explain" with the $search aggregation stage in SBE. * @tags: [featureFlagSbeFull] */ -import {getPlanStages, getQueryPlanner} from "jstests/libs/analyze_plan.js"; +import {getPlanStages, getQueryPlanner} from "jstests/libs/query/analyze_plan.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { ShardingTestWithMongotMock diff --git a/jstests/with_mongot/search_mocked/search_sharded_union_with_lookup.js b/jstests/with_mongot/search_mocked/search_sharded_union_with_lookup.js index 639b52d1214..d644d286d4c 100644 --- a/jstests/with_mongot/search_mocked/search_sharded_union_with_lookup.js +++ b/jstests/with_mongot/search_mocked/search_sharded_union_with_lookup.js @@ -2,9 +2,13 @@ * Sharding test of `$search` aggregation stage within $unionWith and $lookup stages. Also checks * explain results. */ -import {getAggPlanStage, getAggPlanStages, getUnionWithStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import { + getAggPlanStage, + getAggPlanStages, + getUnionWithStage +} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { getDefaultProtocolVersionForPlanShardedSearch, diff --git a/jstests/with_mongot/search_mocked/search_stored_fields.js b/jstests/with_mongot/search_mocked/search_stored_fields.js index a1630d79be0..30359657445 100644 --- a/jstests/with_mongot/search_mocked/search_stored_fields.js +++ b/jstests/with_mongot/search_mocked/search_stored_fields.js @@ -3,7 +3,7 @@ */ import {arrayEq} from "jstests/aggregation/extras/utils.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { MongotMock, diff --git a/jstests/with_mongot/search_mocked/search_union_with_lookup.js b/jstests/with_mongot/search_mocked/search_union_with_lookup.js index 22b93e49262..ed90fb90145 100644 --- a/jstests/with_mongot/search_mocked/search_union_with_lookup.js +++ b/jstests/with_mongot/search_mocked/search_union_with_lookup.js @@ -1,9 +1,9 @@ /** * Test of `$search` aggregation stage within $unionWith and $lookup stages. */ -import {getAggPlanStage} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStage} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {prepareUnionWithExplain} from "jstests/with_mongot/common_utils.js"; import {mongotCommandForQuery, MongotMock} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; diff --git a/jstests/with_mongot/search_mocked/shard_limit_test.js b/jstests/with_mongot/search_mocked/shard_limit_test.js index c619f7d3c63..b53f6f434e2 100644 --- a/jstests/with_mongot/search_mocked/shard_limit_test.js +++ b/jstests/with_mongot/search_mocked/shard_limit_test.js @@ -1,9 +1,9 @@ /** * Test that a $limit gets pushed to the shards. */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { getDefaultProtocolVersionForPlanShardedSearch, diff --git a/jstests/with_mongot/search_mocked/sharded_search_explain.js b/jstests/with_mongot/search_mocked/sharded_search_explain.js index 40bf2e215f7..b4c16614fb6 100644 --- a/jstests/with_mongot/search_mocked/sharded_search_explain.js +++ b/jstests/with_mongot/search_mocked/sharded_search_explain.js @@ -7,7 +7,7 @@ * @tags:[featureFlagSearchExplainExecutionStats_incompatible] */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {verifyShardsPartExplainOutput} from "jstests/with_mongot/common_utils.js"; import { diff --git a/jstests/with_mongot/search_mocked/sharded_search_explain_execution_stats.js b/jstests/with_mongot/search_mocked/sharded_search_explain_execution_stats.js index 8b2d10a171d..ebab3ca8ac0 100644 --- a/jstests/with_mongot/search_mocked/sharded_search_explain_execution_stats.js +++ b/jstests/with_mongot/search_mocked/sharded_search_explain_execution_stats.js @@ -5,7 +5,7 @@ * @tags:[featureFlagSearchExplainExecutionStats] */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {verifyShardsPartExplainOutput} from "jstests/with_mongot/common_utils.js"; import { diff --git a/jstests/with_mongot/search_mocked/sharded_search_meta_cursors.js b/jstests/with_mongot/search_mocked/sharded_search_meta_cursors.js index f6582fd7d35..f4def5bf8cd 100644 --- a/jstests/with_mongot/search_mocked/sharded_search_meta_cursors.js +++ b/jstests/with_mongot/search_mocked/sharded_search_meta_cursors.js @@ -4,9 +4,9 @@ * only return one cursor when requiresSearchMetaCursor is explicitly false. */ -import "jstests/libs/sbe_assert_error_override.js"; +import "jstests/libs/query/sbe_assert_error_override.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {mongotCommandForQuery} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; import { diff --git a/jstests/with_mongot/search_mocked/sharded_search_meta_explain.js b/jstests/with_mongot/search_mocked/sharded_search_meta_explain.js index 89c49366dad..3e091936ce3 100644 --- a/jstests/with_mongot/search_mocked/sharded_search_meta_explain.js +++ b/jstests/with_mongot/search_mocked/sharded_search_meta_explain.js @@ -4,7 +4,7 @@ * @tags: [featureFlagSearchExplainExecutionStats] */ import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {verifyShardsPartExplainOutput} from "jstests/with_mongot/common_utils.js"; import { diff --git a/jstests/with_mongot/search_mocked/sharded_search_query_stats.js b/jstests/with_mongot/search_mocked/sharded_search_query_stats.js index fb157f427d6..2ec3bd039dc 100644 --- a/jstests/with_mongot/search_mocked/sharded_search_query_stats.js +++ b/jstests/with_mongot/search_mocked/sharded_search_query_stats.js @@ -3,7 +3,7 @@ * @tags: [featureFlagQueryStats] */ -import {getQueryStatsAggCmd} from "jstests/libs/query_stats_utils.js"; +import {getQueryStatsAggCmd} from "jstests/libs/query/query_stats_utils.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { mockPlanShardedSearchResponse, diff --git a/jstests/with_mongot/search_mocked/sharded_sort.js b/jstests/with_mongot/search_mocked/sharded_sort.js index 25d5b0c93dc..6f287068286 100644 --- a/jstests/with_mongot/search_mocked/sharded_sort.js +++ b/jstests/with_mongot/search_mocked/sharded_sort.js @@ -5,9 +5,9 @@ * requires_fcv_70 * ] */ -import {getAggPlanStages, getQueryPlanner} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; -import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/sbe_util.js"; +import {getAggPlanStages, getQueryPlanner} from "jstests/libs/query/analyze_plan.js"; +import {checkSbeRestrictedOrFullyEnabled} from "jstests/libs/query/sbe_util.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import { getDefaultProtocolVersionForPlanShardedSearch, diff --git a/jstests/with_mongot/vector_search_mocked/sharded_vector_search_explain.js b/jstests/with_mongot/vector_search_mocked/sharded_vector_search_explain.js index 24cb6113691..7521bdc4683 100644 --- a/jstests/with_mongot/vector_search_mocked/sharded_vector_search_explain.js +++ b/jstests/with_mongot/vector_search_mocked/sharded_vector_search_explain.js @@ -4,8 +4,8 @@ * featureFlagVectorSearchPublicPreview, * ] */ -import {getAggPlanStages} from "jstests/libs/analyze_plan.js"; import {FeatureFlagUtil} from "jstests/libs/feature_flag_util.js"; +import {getAggPlanStages} from "jstests/libs/query/analyze_plan.js"; import {getUUIDFromListCollections} from "jstests/libs/uuid_util.js"; import {mongotCommandForVectorSearchQuery} from "jstests/with_mongot/mongotmock/lib/mongotmock.js"; import { diff --git a/jstests/with_mongot/vector_search_mocked/vector_search_query_stats.js b/jstests/with_mongot/vector_search_mocked/vector_search_query_stats.js index 3665f142454..b8532edd3da 100644 --- a/jstests/with_mongot/vector_search_mocked/vector_search_query_stats.js +++ b/jstests/with_mongot/vector_search_mocked/vector_search_query_stats.js @@ -5,7 +5,7 @@ * stats on a nonexistent collection. We use the mock framework because we need to override a server * parameter and test on different topologies. */ -import {getQueryStats, getValueAtPath} from "jstests/libs/query_stats_utils.js"; +import {getQueryStats, getValueAtPath} from "jstests/libs/query/query_stats_utils.js"; import { MongotMock, } from "jstests/with_mongot/mongotmock/lib/mongotmock.js";