diff --git a/pavelib/bok_choy.py b/pavelib/bok_choy.py index 638284806f..84d4646cd4 100644 --- a/pavelib/bok_choy.py +++ b/pavelib/bok_choy.py @@ -20,6 +20,7 @@ __test__ = False # do not collect @cmdopts([ ('test_spec=', 't', 'Specific test to run'), ('fasttest', 'a', 'Skip some setup'), + ('extra_args=', 'e', 'adds as extra args to the test command'), make_option("--verbose", action="store_const", const=2, dest="verbosity"), make_option("-q", "--quiet", action="store_const", const=0, dest="verbosity"), make_option("-v", "--verbosity", action="count", dest="verbosity"), @@ -39,7 +40,8 @@ def test_bokchoy(options): opts = { 'test_spec': getattr(options, 'test_spec', None), 'fasttest': getattr(options, 'fasttest', False), - 'verbosity': getattr(options, 'verbosity', 2) + 'verbosity': getattr(options, 'verbosity', 2), + 'extra_args': getattr(options, 'extra_args', ''), } test_suite = BokChoyTestSuite('bok-choy', **opts) diff --git a/pavelib/utils/test/suites/bokchoy_suite.py b/pavelib/utils/test/suites/bokchoy_suite.py index 5103af23b9..178a2797e7 100644 --- a/pavelib/utils/test/suites/bokchoy_suite.py +++ b/pavelib/utils/test/suites/bokchoy_suite.py @@ -29,6 +29,7 @@ class BokChoyTestSuite(TestSuite): self.fasttest = kwargs.get('fasttest', False) self.test_spec = kwargs.get('test_spec', None) self.verbosity = kwargs.get('verbosity', 2) + self.extra_args = kwargs.get('extra_args', '') def __enter__(self): super(BokChoyTestSuite, self).__enter__() @@ -97,6 +98,7 @@ class BokChoyTestSuite(TestSuite): "--with-flaky", "--xunit-file={}".format(self.xunit_report), "--verbosity={}".format(self.verbosity), + self.extra_args, ] cmd = (" ").join(cmd) diff --git a/scripts/all-tests.sh b/scripts/all-tests.sh index afce8b7ad1..6f229fd2c4 100755 --- a/scripts/all-tests.sh +++ b/scripts/all-tests.sh @@ -114,7 +114,15 @@ END ;; "bok-choy") - rake test:bok_choy + case "$SHARD" in + "1") + rake test:bok_choy["-a shard_1"] + ;; + + "2") + rake test:bok_choy["-a '!shard_1'"] + ;; + esac rake test:bok_choy:coverage ;;