diff options
-rw-r--r-- | buildscripts/ciconfig/evergreen.py | 6 | ||||
-rw-r--r-- | buildscripts/tests/ciconfig/evergreen.yml | 6 | ||||
-rw-r--r-- | buildscripts/tests/ciconfig/test_evergreen.py | 15 |
3 files changed, 23 insertions, 4 deletions
diff --git a/buildscripts/ciconfig/evergreen.py b/buildscripts/ciconfig/evergreen.py index 325e8b236bf..da2112d6bf0 100644 --- a/buildscripts/ciconfig/evergreen.py +++ b/buildscripts/ciconfig/evergreen.py @@ -185,7 +185,11 @@ class VariantTask(Task): def combined_resmoke_args(self): """Return the combined resmoke arguments resulting from the concatenation of the task's resmoke_args parameter and the variant's test_flags parameter.""" - return "{} {}".format(self.resmoke_args, self.variant.test_flags) + test_flags = self.variant.test_flags + if test_flags: + return "{} {}".format(self.resmoke_args, test_flags) + else: + return self.resmoke_args class ResmokeArgs(object): diff --git a/buildscripts/tests/ciconfig/evergreen.yml b/buildscripts/tests/ciconfig/evergreen.yml index 9777fb5ef46..7931bf7a586 100644 --- a/buildscripts/tests/ciconfig/evergreen.yml +++ b/buildscripts/tests/ciconfig/evergreen.yml @@ -148,3 +148,9 @@ buildvariants: - name: resmoke_task distros: - pdp-11 +- name: debian + display_name: Debian + run_on: + - debian-stretch + tasks: + - name: resmoke_task diff --git a/buildscripts/tests/ciconfig/test_evergreen.py b/buildscripts/tests/ciconfig/test_evergreen.py index 56de9bca3d3..cf1dbddfb4c 100644 --- a/buildscripts/tests/ciconfig/test_evergreen.py +++ b/buildscripts/tests/ciconfig/test_evergreen.py @@ -43,10 +43,11 @@ class TestEvergreenProjectConfig(unittest.TestCase): self.assertIn("resmoke_task", self.conf.task_names) def test_list_variants(self): - self.assertEqual(2, len(self.conf.variants)) - self.assertEqual(2, len(self.conf.variant_names)) + self.assertEqual(3, len(self.conf.variants)) + self.assertEqual(3, len(self.conf.variant_names)) self.assertIn("osx-108", self.conf.variant_names) self.assertIn("ubuntu", self.conf.variant_names) + self.assertIn("debian", self.conf.variant_names) def test_get_variant(self): variant = self.conf.get_variant("osx-108") @@ -55,10 +56,11 @@ class TestEvergreenProjectConfig(unittest.TestCase): self.assertEqual("osx-108", variant.name) def test_list_distro_names(self): - self.assertEqual(3, len(self.conf.distro_names)) + self.assertEqual(4, len(self.conf.distro_names)) self.assertIn("localtestdistro", self.conf.distro_names) self.assertIn("ubuntu1404-test", self.conf.distro_names) self.assertIn("pdp-11", self.conf.distro_names) + self.assertIn("debian-stretch", self.conf.distro_names) class TestTask(unittest.TestCase): @@ -177,9 +179,16 @@ class TestVariant(unittest.TestCase): self.assertEqual(variant_ubuntu, task.variant) self.assertIn(task_name, variant_ubuntu.task_names) + # Check combined_resmoke_args when test_flags is set on the variant resmoke_task = variant_ubuntu.get_task("resmoke_task") self.assertEqual("--suites=somesuite --storageEngine=mmapv1 --param=value --ubuntu", resmoke_task.combined_resmoke_args) + # Check combined_resmoke_args when test_flags is not set on the variant + variant_debian = self.conf.get_variant("debian") + resmoke_task = variant_debian.get_task("resmoke_task") + self.assertEqual("--suites=somesuite --storageEngine=mmapv1", + resmoke_task.combined_resmoke_args) + if __name__ == "__main__": unittest.main() |