summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorDavid Percy <david.percy@mongodb.com>2022-07-12 20:24:57 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-17 15:37:04 +0000
commitb902366ad23713ed7493e121f0218fead287bc6d (patch)
tree762de8a4a020d82ff3cf43faf7a35ba736e37a30 /buildscripts
parentaca57c0414496efbfaa914343e3b599366f15a14 (diff)
downloadmongo-b902366ad23713ed7493e121f0218fead287bc6d.tar.gz
SERVER-67415 Create golden-data JS suites
Adds two new suites: query_golden_classic and query_golden_cqf, which use the golden-data test framework (docs/golden_data_test_framework.md). These suites diff the expected and actual output instead of using assert.eq and similar functions. This change includes some refactoring of the golden-test classes to avoid pulling the unittest library into the mongo shell.
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/resmokeconfig/suites/cqf.yml1
-rw-r--r--buildscripts/resmokeconfig/suites/query_golden_classic.yml35
-rw-r--r--buildscripts/resmokeconfig/suites/query_golden_cqf.yml36
3 files changed, 72 insertions, 0 deletions
diff --git a/buildscripts/resmokeconfig/suites/cqf.yml b/buildscripts/resmokeconfig/suites/cqf.yml
index dbbe808a0f4..484bee8d793 100644
--- a/buildscripts/resmokeconfig/suites/cqf.yml
+++ b/buildscripts/resmokeconfig/suites/cqf.yml
@@ -24,6 +24,7 @@ executor:
fixture:
class: MongoDFixture
mongod_options:
+ # Keep in sync with query_golden_cqf.yml.
set_parameters:
enableTestCommands: 1
featureFlagCommonQueryFramework: true
diff --git a/buildscripts/resmokeconfig/suites/query_golden_classic.yml b/buildscripts/resmokeconfig/suites/query_golden_classic.yml
new file mode 100644
index 00000000000..44915921403
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/query_golden_classic.yml
@@ -0,0 +1,35 @@
+test_kind: js_test
+
+selector:
+ roots:
+ - jstests/query_golden/**/*.js
+ exclude_files:
+ - jstests/query_golden/libs/**
+ exclude_with_any_tags:
+ - requires_cqf
+executor:
+ archive:
+ hooks:
+ - ValidateCollections
+ config:
+ shell_options:
+ crashOnInvalidBSONError: ""
+ objcheck: ""
+ eval: |
+ // Keep in sync with query_golden_cqf.yml.
+ load("jstests/libs/override_methods/detect_spawning_own_mongod.js");
+ load("jstests/libs/golden_test.js");
+ _openGoldenData(jsTestName(), {relativePath: "jstests/query_golden/expected_output"});
+ hooks:
+ - class: ValidateCollections
+ shell_options:
+ global_vars:
+ TestData:
+ skipValidationOnNamespaceNotFound: false
+ - class: CleanEveryN
+ n: 20
+ fixture:
+ class: MongoDFixture
+ mongod_options:
+ set_parameters:
+ enableTestCommands: 1
diff --git a/buildscripts/resmokeconfig/suites/query_golden_cqf.yml b/buildscripts/resmokeconfig/suites/query_golden_cqf.yml
new file mode 100644
index 00000000000..1d809a79a75
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/query_golden_cqf.yml
@@ -0,0 +1,36 @@
+test_kind: js_test
+
+selector:
+ roots:
+ - jstests/query_golden/**/*.js
+ exclude_files:
+ - jstests/query_golden/libs/**
+executor:
+ archive:
+ hooks:
+ - ValidateCollections
+ config:
+ shell_options:
+ crashOnInvalidBSONError: ""
+ objcheck: ""
+ eval: |
+ // Keep in sync with query_golden_classic.yml.
+ load("jstests/libs/override_methods/detect_spawning_own_mongod.js");
+ load("jstests/libs/golden_test.js");
+ _openGoldenData(jsTestName(), {relativePath: "jstests/query_golden/expected_output"});
+ hooks:
+ - class: ValidateCollections
+ shell_options:
+ global_vars:
+ TestData:
+ skipValidationOnNamespaceNotFound: false
+ - class: CleanEveryN
+ n: 20
+ fixture:
+ class: MongoDFixture
+ mongod_options:
+ # Keep in sync with cqf.yml.
+ set_parameters:
+ enableTestCommands: 1
+ featureFlagCommonQueryFramework: true
+ internalQueryFrameworkControl: "forceBonsai"