Lines Matching full:suite

39 from autotest_lib.server.cros.dynamic_suite import suite as SuiteBase
45 from autotest_lib.server.cros.dynamic_suite.suite import RetryHandler
46 from autotest_lib.server.cros.dynamic_suite.suite import Suite
50 """Unit tests for dynamic_suite Suite class.
53 @var _TAG: fake suite tag
113 @param suite_name: The suite name to parse control files for.
153 @param suite_name: The suite name to parse control files for.
186 predicate = lambda d: d.suite == self._TAG
218 look for all control files with the suite attribute.
223 predicate = lambda t: hasattr(t, 'suite')
233 predicate = lambda d: d.suite == self._TAG
265 """Should be able to schedule an ad-hoc suite by specifying
270 suite = Suite.create_from_predicates([predicate], self._BUILDS,
275 self.assertFalse(self.files['one'] in suite.tests)
276 self.assertFalse(self.files['two'] in suite.tests)
277 self.assertFalse(self.files['four'] in suite.tests)
278 self.assertTrue(self.files['five'] in suite.tests)
298 raises=False, suite_deps=[], suite=None, argument
307 @param suite_deps: If True, add suite level dependencies.
310 record_job_id = suite and suite._results_dir
312 self.mox.StubOutWithMock(suite, '_remember_job_keyval')
330 'suite': self._TAG,
367 suite._remember_job_keyval(fake_job)
381 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
387 self.expect_job_scheduling(recorder, suite=suite)
392 suite.schedule(recorder.record_entry)
393 for job in suite._jobs:
412 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
415 suite.schedule(recorder.record_entry)
433 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
437 suite.schedule(recorder.record_entry)
454 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
457 suite.schedule(recorder.record_entry)
488 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
492 suite.schedule(recorder.record_entry)
494 self.assertEqual(expected_retry_map, suite._retry_handler._retry_map)
498 """Test suite max retries."""
511 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
515 suite.schedule(recorder.record_entry)
516 self.assertEqual(suite._retry_handler._max_retries, 1)
518 job_id = next(six.iterkeys(suite._retry_handler._retry_map))
519 suite._retry_handler.add_retry(old_job_id=job_id, new_job_id=10)
520 self.assertEqual(suite._retry_handler._max_retries, 0)
524 """Should add suite dependencies to tests scheduled."""
538 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
541 suite.schedule(recorder.record_entry)
573 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
577 suite.schedule(recorder.record_entry)
581 """Create a Suite, using mocked tests and control file contents.
583 @return Suite object, after mocking out behavior needed to create it.
588 suite = Suite.create_from_name(
601 return suite
605 """Create a suite, returned a set of mocked results to expect.
612 self.suite = self._createSuiteWithMockedTestsAndControlFiles(
614 self.suite._results_dir = results_dir
648 def schedule_and_expect_these_results(self, suite, results, recorder): argument
649 """Create mox stubs for call to suite.schedule and
652 @param suite: suite object for which to stub out schedule(...)
672 self.mox.StubOutWithMock(suite, 'schedule')
673 suite.schedule(recorder.record_entry)
674 suite._retry_handler = RetryHandler({})
685 suite = self._createSuiteWithMockedTestsAndControlFiles()
691 self.schedule_and_expect_these_results(suite, results, recorder)
694 suite.schedule(recorder.record_entry)
695 suite.wait(recorder.record_entry)
700 suite = self._createSuiteWithMockedTestsAndControlFiles()
707 self.mox.StubOutWithMock(suite, 'schedule')
708 suite.schedule(recorder.record_entry)
715 suite.schedule(recorder.record_entry)
716 suite.wait(recorder.record_entry)
721 suite = self._createSuiteWithMockedTestsAndControlFiles()
732 self.mox.StubOutWithMock(suite._job_creator, 'create_job')
733 suite._job_creator.create_job(
738 suite.schedule(recorder.record_entry)
739 suite.wait(recorder.record_entry)
784 self.suite,
787 self.mox.StubOutWithMock(self.suite._job_creator, 'create_job')
788 self.suite._job_creator.create_job(
792 self.suite.schedule(self.recorder.record_entry)
793 self.suite._retry_handler._retry_map = {
797 self.suite._jobs_to_tests[self._FAKE_JOB_ID] = test_to_retry
798 self.suite.wait(self.recorder.record_entry)
806 self.assertEquals(self.suite._retry_handler._retry_map,
809 self.assertEquals(self.suite._jobs_to_tests[fake_new_job_id],
819 self.suite,
823 self.suite.schedule(self.recorder.record_entry)
824 self.suite._retry_handler._retry_map = {
828 self.suite._jobs_to_tests[self._FAKE_JOB_ID] = test_to_retry
829 expected_jobs_to_tests = self.suite._jobs_to_tests.copy()
830 expected_retry_map = self.suite._retry_handler._retry_map.copy()
831 self.suite.wait(self.recorder.record_entry)
834 self.assertEquals(self.suite._retry_handler._retry_map,
836 self.assertEquals(self.suite._jobs_to_tests, expected_jobs_to_tests)
840 """Make sure the suite survives even if the retry failed."""
846 self.suite,
849 self.mox.StubOutWithMock(self.suite._job_creator, 'create_job')
850 self.suite._job_creator.create_job(
854 self.mox.StubOutWithMock(self.suite, '_should_report')
855 self.suite._should_report(mox.IgnoreArg()).AndReturn(False)
859 self.suite.schedule(self.recorder.record_entry)
860 self.suite._retry_handler._retry_map = {
864 self.suite._jobs_to_tests[self._FAKE_JOB_ID] = test_to_retry
865 self.suite.wait(self.recorder.record_entry)
870 expected_jobs_to_tests = self.suite._jobs_to_tests.copy()
871 self.assertEquals(self.suite._retry_handler._retry_map,
873 self.assertEquals(self.suite._jobs_to_tests, expected_jobs_to_tests)