summaryrefslogtreecommitdiff
path: root/buildscripts/tests/resmokelib
diff options
context:
space:
mode:
authorRobert Guo <robert.guo@mongodb.com>2021-05-19 14:40:02 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-27 14:49:58 +0000
commit846a99de9a02454c5649cfaa4e69c785ddbfca62 (patch)
tree8a1e905b66363b2cf8740e546f2d9bb38cec38be /buildscripts/tests/resmokelib
parent1923c38e7d2ecd839c637789dfbda5b3a64da226 (diff)
downloadmongo-846a99de9a02454c5649cfaa4e69c785ddbfca62.tar.gz
SERVER-54622 Retrieve back-branch fixture files to assemble multiversion
remove task_path_suffix from evergreen_gen_multiversion_tasks.py replication works fix fixture API adherence test generate mongos port on startup fix sharding and reformat
Diffstat (limited to 'buildscripts/tests/resmokelib')
-rw-r--r--buildscripts/tests/resmokelib/testing/fixtures/test_api_adherence.py4
-rw-r--r--buildscripts/tests/resmokelib/testing/fixtures/test_builder.py24
2 files changed, 27 insertions, 1 deletions
diff --git a/buildscripts/tests/resmokelib/testing/fixtures/test_api_adherence.py b/buildscripts/tests/resmokelib/testing/fixtures/test_api_adherence.py
index 0ea3ca2acb3..7f0e1110a32 100644
--- a/buildscripts/tests/resmokelib/testing/fixtures/test_api_adherence.py
+++ b/buildscripts/tests/resmokelib/testing/fixtures/test_api_adherence.py
@@ -14,7 +14,9 @@ ALLOWED_IMPORTS = [
"buildscripts.resmokelib.utils.registry",
]
FIXTURE_PATH = os.path.normpath("buildscripts/resmokelib/testing/fixtures")
-IGNORED_FILES = ["__init__.py", "fixturelib.py"]
+
+# These files are not part of the fixure API.
+IGNORED_FILES = ["__init__.py", "fixturelib.py", "_builder.py"]
class AdherenceChecker(ast.NodeVisitor):
diff --git a/buildscripts/tests/resmokelib/testing/fixtures/test_builder.py b/buildscripts/tests/resmokelib/testing/fixtures/test_builder.py
new file mode 100644
index 00000000000..9717086a06f
--- /dev/null
+++ b/buildscripts/tests/resmokelib/testing/fixtures/test_builder.py
@@ -0,0 +1,24 @@
+"""Unit tests for the resmokelib.testing.fixtures.multiversion module."""
+
+import unittest
+import filecmp
+import os
+
+from buildscripts.resmokelib.testing.fixtures import _builder
+
+TEST_COMMIT = "9fbf58e9f1bee720d270cfa9621f581a0212e5ff"
+
+
+class TestFixtureBuilder(unittest.TestCase):
+ """Class that test retrieve_fixtures methods."""
+
+ def test_retrieve_fixtures(self):
+ """function to test retrieve_fixtures"""
+ dirpath = os.path.join("build", "multiversionfixture")
+ expected_standalone = os.path.join("buildscripts", "tests", "resmokelib", "testing",
+ "fixtures", "retrieved_fixture.txt")
+ _builder.retrieve_fixtures(dirpath, TEST_COMMIT)
+ retrieved_standalone = os.path.join(dirpath, "standalone.py")
+ self.assertTrue(
+ filecmp.cmpfiles(retrieved_standalone, expected_standalone,
+ ["standalone.py", "retrieved_fixture.txt"], shallow=False))