diff options
author | Robert Guo <robertguo@me.com> | 2016-07-19 14:21:28 -0400 |
---|---|---|
committer | Robert Guo <robertguo@me.com> | 2016-07-27 18:02:44 -0400 |
commit | 4fa62d1e396647ed7e38cf62ec04efdcdf963497 (patch) | |
tree | 745d03dc14cb5f098e0d120ed2fd7a6568f529e9 | |
parent | 17e09342a6bc7ce22eb40e15eb056732f2cc81b0 (diff) | |
download | mongo-4fa62d1e396647ed7e38cf62ec04efdcdf963497.tar.gz |
SERVER-24719 run index validation on v3.2
-rw-r--r-- | buildscripts/resmokeconfig/suites/core_v33_validate.yml | 20 | ||||
-rw-r--r-- | buildscripts/resmokelib/testing/fixtures/standalone.py | 33 | ||||
-rw-r--r-- | buildscripts/resmokelib/testing/hooks.py | 35 | ||||
-rw-r--r-- | etc/evergreen.yml | 37 |
4 files changed, 123 insertions, 2 deletions
diff --git a/buildscripts/resmokeconfig/suites/core_v33_validate.yml b/buildscripts/resmokeconfig/suites/core_v33_validate.yml new file mode 100644 index 00000000000..33c195db873 --- /dev/null +++ b/buildscripts/resmokeconfig/suites/core_v33_validate.yml @@ -0,0 +1,20 @@ +selector: + js_test: + roots: + - jstests/core/*.js + +executor: + js_test: + config: + shell_options: + readMode: commands + hooks: + - class: ValidateCollections + improvedV33Validate: true + - class: CleanEveryN + n: 20 + fixture: + class: MongoDFixture + mongod_options: + set_parameters: + enableTestCommands: 1 diff --git a/buildscripts/resmokelib/testing/fixtures/standalone.py b/buildscripts/resmokelib/testing/fixtures/standalone.py index d4d4c780baa..87e661e2fab 100644 --- a/buildscripts/resmokelib/testing/fixtures/standalone.py +++ b/buildscripts/resmokelib/testing/fixtures/standalone.py @@ -59,6 +59,39 @@ class MongoDFixture(interface.Fixture): self.mongod = None + def reconfigure(self, mongod_executable, mongod_options): + self.original_mongod_executable = self.mongod_executable + self.original_mongod_options = self.mongod_options + self.original_preserve_dbpath = self.preserve_dbpath + + teardown_success = self.teardown() + + self.mongod_executable = mongod_executable + self.mongod_options = mongod_options + self.preserve_dbpath = True + + self.setup() + self.await_ready() + + if not teardown_success: + raise errors.TestFailure("%s did not exit cleanly" % (self)) + + def reset_configuration(self): + teardown_success = self.teardown() + + self.mongod_executable = self.original_mongod_executable + self.mongod_options = self.original_mongod_options + + self.setup() + self.await_ready() + + # Reset preserve_dbpath after calling setup(), since setup() should always preserve the + # dbpath. + self.preserve_dbpath = self.original_preserve_dbpath + + if not teardown_success: + raise errors.TestFailure("%s did not exit cleanly" % (self)) + def setup(self): if not self.preserve_dbpath: shutil.rmtree(self._dbpath, ignore_errors=True) diff --git a/buildscripts/resmokelib/testing/hooks.py b/buildscripts/resmokelib/testing/hooks.py index 1a438cf0867..84d62b25da7 100644 --- a/buildscripts/resmokelib/testing/hooks.py +++ b/buildscripts/resmokelib/testing/hooks.py @@ -166,10 +166,41 @@ class ValidateCollections(JsCustomBehavior): Runs full validation on all collections in all databases on every stand-alone node, primary replica-set node, or primary shard node. """ - def __init__(self, logger, fixture): - description = "Full collection validation" + + DEFAULT_N = 1 + + def __init__(self, logger, fixture, n=DEFAULT_N, improvedV33Validate=False): + description = "Collection validation" js_filename = os.path.join("jstests", "hooks", "run_validate_collections.js") JsCustomBehavior.__init__(self, logger, fixture, js_filename, description) + self.n = n + self.tests_run = 0 + self.improved_validate = improvedV33Validate + + def after_test(self, test, test_report): + self.tests_run += 1 + if self.tests_run >= self.n: + self.tests_run = 0 + + if not self.improved_validate: + JsCustomBehavior.after_test(self, test, test_report) + return + elif not isinstance(self.fixture, fixtures.MongoDFixture): + raise errors.TestFailure(("ValidateCollections with the improved validate command" + " can only be run against a stand-alone mongod")) + + # Need to remember the dbpath and port of the original mongod. + mongod_options = self.fixture.mongod_options.copy() + mongod_options["queryableBackupMode"] = "" + mongod_executable = "/data/multiversion/mongod-3.3.10" + if sys.platform == "win32": + mongod_executable += ".exe" + + self.fixture.reconfigure(mongod_executable, mongod_options) + + JsCustomBehavior.after_test(self, test, test_report) + + self.fixture.reset_configuration() class CheckReplDBHash(JsCustomBehavior): diff --git a/etc/evergreen.yml b/etc/evergreen.yml index 16c816b3f7a..8154e9e59c1 100644 --- a/etc/evergreen.yml +++ b/etc/evergreen.yml @@ -388,6 +388,17 @@ functions: rm -rf /data/install /data/multiversion ${python|python} buildscripts/setup_multiversion_mongodb.py /data/install /data/multiversion ${multiversion_platform_arch|"Linux/x86_64"} "2.4" "2.6" "3.0" "3.2.1" + "download mongod for validation checking" : + command: shell.exec + params: + working_dir: src + script: | + set -o errexit + set -o verbose + + rm -rf /data/install /data/multiversion + ${python|python} buildscripts/setup_multiversion_mongodb.py /data/install /data/multiversion ${multiversion_platform_arch|"Linux/x86_64"} "3.3.10" + pre: - command: shell.track - command: shell.exec @@ -1102,6 +1113,26 @@ tasks: run_multiple_jobs: true - <<: *task_template + name: jsCore_v33_validate + commands: + - func: "do setup" + - func: "download mongod for validation checking" + - func: "run tests" + vars: + resmoke_args: --suites=core_v33_validate --storageEngine=mmapv1 + run_multiple_jobs: true + +- <<: *task_template + name: jsCore_v33_validate_WT + commands: + - func: "do setup" + - func: "download mongod for validation checking" + - func: "run tests" + vars: + resmoke_args: --suites=core_v33_validate --storageEngine=wiredTiger + run_multiple_jobs: true + +- <<: *task_template name: jsCore_inMem commands: - func: "do setup" @@ -3572,6 +3603,8 @@ buildvariants: - name: jsCore_small_oplog_WT - name: jsCore_small_oplog_rs - name: jsCore_small_oplog_rs_WT + - name: jsCore_v33_validate + - name: jsCore_v33_validate_WT - name: mmap - name: mongosTest - name: noPassthrough @@ -4271,6 +4304,8 @@ buildvariants: - name: jsCore_small_oplog_WT - name: jsCore_small_oplog_rs - name: jsCore_small_oplog_rs_WT + - name: jsCore_v33_validate + - name: jsCore_v33_validate_WT - name: jstestfuzz - name: jstestfuzz_WT - name: jstestfuzz_replication_WT @@ -6058,6 +6093,8 @@ buildvariants: - name: jsCore_small_oplog_WT - name: jsCore_small_oplog_rs - name: jsCore_small_oplog_rs_WT + - name: jsCore_v33_validate + - name: jsCore_v33_validate_WT - name: mmap - name: mongosTest - name: multiversion |