| Index: tools/mb/mb_unittest.py
|
| diff --git a/tools/mb/mb_unittest.py b/tools/mb/mb_unittest.py
|
| index 6870b24f862b5f9ad47d60b76a40486252f38da8..b0957008817b4f1ceb08f0532d9c726633fcdb5a 100755
|
| --- a/tools/mb/mb_unittest.py
|
| +++ b/tools/mb/mb_unittest.py
|
| @@ -114,7 +114,7 @@ TEST_CONFIG = """\
|
| 'fake_gn_debug_builder': 'gn_debug_goma',
|
| 'fake_gyp_builder': 'gyp_debug',
|
| 'fake_gn_args_bot': '//build/args/bots/fake_master/fake_gn_args_bot.gn',
|
| - 'fake_multi_phase': ['gn_phase_1', 'gn_phase_2'],
|
| + 'fake_multi_phase': { 'phase_1': 'gn_phase_1', 'phase_2': 'gn_phase_2'},
|
| },
|
| },
|
| 'configs': {
|
| @@ -468,27 +468,23 @@ class UnitTest(unittest.TestCase):
|
|
|
| # Check that passing a --phase to a single-phase builder fails.
|
| mbw = self.check(['lookup', '-m', 'fake_master', '-b', 'fake_gn_builder',
|
| - '--phase', '1'],
|
| - ret=1)
|
| + '--phase', 'phase_1'], ret=1)
|
| self.assertIn('Must not specify a build --phase', mbw.out)
|
|
|
| - # Check different ranges; 0 and 3 are out of bounds, 1 and 2 should work.
|
| + # Check that passing a wrong phase key to a multi-phase builder fails.
|
| mbw = self.check(['lookup', '-m', 'fake_master', '-b', 'fake_multi_phase',
|
| - '--phase', '0'], ret=1)
|
| - self.assertIn('Phase 0 out of bounds', mbw.out)
|
| + '--phase', 'wrong_phase'], ret=1)
|
| + self.assertIn('Phase wrong_phase doesn\'t exist', mbw.out)
|
|
|
| + # Check that passing a correct phase key to a multi-phase builder passes.
|
| mbw = self.check(['lookup', '-m', 'fake_master', '-b', 'fake_multi_phase',
|
| - '--phase', '1'], ret=0)
|
| + '--phase', 'phase_1'], ret=0)
|
| self.assertIn('phase = 1', mbw.out)
|
|
|
| mbw = self.check(['lookup', '-m', 'fake_master', '-b', 'fake_multi_phase',
|
| - '--phase', '2'], ret=0)
|
| + '--phase', 'phase_2'], ret=0)
|
| self.assertIn('phase = 2', mbw.out)
|
|
|
| - mbw = self.check(['lookup', '-m', 'fake_master', '-b', 'fake_multi_phase',
|
| - '--phase', '3'], ret=1)
|
| - self.assertIn('Phase 3 out of bounds', mbw.out)
|
| -
|
| def test_validate(self):
|
| mbw = self.fake_mbw()
|
| self.check(['validate'], mbw=mbw, ret=0)
|
|
|