Lines Matching full:suite

29 from autotest_lib.server.cros.dynamic_suite.suite import Suite
30 from autotest_lib.server.cros.dynamic_suite.suite import RetryHandler
38 """Unit tests for dynamic_suite Suite class.
41 @var _TAG: fake suite tag
96 @param suite_name: The suite name to parse control files for.
131 tests = Suite.find_and_parse_tests(self.getter, predicate, self._TAG)
141 look for all control files with the suite attribute.
145 fs_getter = Suite.create_fs_getter(autodir)
146 predicate = lambda t: hasattr(t, 'suite')
147 Suite.find_and_parse_tests(fs_getter, predicate, add_experimental=True,
156 predicate = lambda d: d.suite == self._TAG
157 tests = Suite.find_and_parse_tests(self.getter,
175 predicate = Suite.matches_attribute_expression_predicate('attr:attr')
176 tests = Suite.find_and_parse_tests(self.getter,
190 """Should be able to schedule an ad-hoc suite by specifying
194 predicate = Suite.test_name_equals_predicate('name-data_five')
195 suite = Suite.create_from_predicates([predicate], self._BUILDS,
200 self.assertFalse(self.files['one'] in suite.tests)
201 self.assertFalse(self.files['two'] in suite.tests)
202 self.assertFalse(self.files['one'] in suite.unstable_tests())
203 self.assertFalse(self.files['two'] in suite.stable_tests())
204 self.assertFalse(self.files['one'] in suite.stable_tests())
205 self.assertFalse(self.files['two'] in suite.unstable_tests())
206 self.assertFalse(self.files['four'] in suite.tests)
207 self.assertTrue(self.files['five'] in suite.tests)
214 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
219 self.assertTrue(self.files['one'] in suite.tests)
220 self.assertTrue(self.files['two'] in suite.tests)
221 self.assertTrue(self.files['one'] in suite.unstable_tests())
222 self.assertTrue(self.files['two'] in suite.stable_tests())
223 self.assertFalse(self.files['one'] in suite.stable_tests())
224 self.assertFalse(self.files['two'] in suite.unstable_tests())
226 self.assertFalse(self.files['four'] in suite.tests)
234 self.mox.StubOutWithMock(Suite, 'find_and_parse_tests')
235 Suite.find_and_parse_tests(
246 raises=False, suite_deps=[], suite=None): argument
255 @param suite_deps: If True, add suite level dependencies.
257 record_job_id = suite and suite._results_dir
259 self.mox.StubOutWithMock(suite, '_remember_provided_job_id')
285 keyvals={'build': build, 'suite': self._TAG,
311 suite._remember_provided_job_id(fake_job)
319 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
325 self.expect_job_scheduling(recorder, add_experimental=True, suite=suite)
327 suite.schedule(recorder.record_entry, True)
328 for job in suite._jobs:
339 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
342 suite.schedule(recorder.record_entry, add_experimental=False)
353 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
357 suite.schedule(recorder.record_entry, add_experimental=False)
366 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
369 suite.schedule(recorder.record_entry, add_experimental=True)
378 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
382 suite.schedule(recorder.record_entry, add_experimental=True)
395 self.assertEqual(expected_retry_map, suite._retry_handler._retry_map)
403 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
407 suite.schedule(recorder.record_entry, add_experimental=True)
408 self.assertEqual(suite._retry_handler._max_retries, 1)
410 job_id = suite._retry_handler._retry_map.iterkeys().next()
411 suite._retry_handler.add_retry(old_job_id=job_id, new_job_id=10)
412 self.assertEqual(suite._retry_handler._max_retries, 0)
416 """Should add suite dependencies to tests scheduled."""
423 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
426 suite.schedule(recorder.record_entry, add_experimental=False)
430 """Create a Suite, using mocked tests and control file contents.
432 @return Suite object, after mocking out behavior needed to create it.
436 suite = Suite.create_from_name(self._TAG, self._BUILDS, self._BOARD,
442 return suite
447 """Create a suite, returned a set of mocked results to expect.
456 self.suite = self._createSuiteWithMockedTestsAndControlFiles(
458 self.suite._results_dir = results_dir
468 self.suite._tko.run = self.mox.CreateMock(frontend.RpcClient.run)
469 self.suite._tko.run('get_detailed_test_views',
496 def schedule_and_expect_these_results(self, suite, results, recorder): argument
497 """Create mox stubs for call to suite.schedule and
500 @param suite: suite object for which to stub out schedule(...)
520 self.mox.StubOutWithMock(suite, 'schedule')
521 suite.schedule(recorder.record_entry, True)
522 suite._retry_handler = RetryHandler({})
526 self.afe, self.tko, suite._jobs).AndReturn(
532 suite = self._createSuiteWithMockedTestsAndControlFiles()
538 self.schedule_and_expect_these_results(suite, results, recorder)
541 suite.schedule(recorder.record_entry, True)
542 suite.wait(recorder.record_entry)
547 suite = self._createSuiteWithMockedTestsAndControlFiles()
554 self.mox.StubOutWithMock(suite, 'schedule')
555 suite.schedule(recorder.record_entry, True)
563 suite.schedule(recorder.record_entry, True)
564 suite.wait(recorder.record_entry)
569 suite = self._createSuiteWithMockedTestsAndControlFiles()
580 self.mox.StubOutWithMock(suite, '_create_job')
581 suite._create_job(mox.IgnoreArg(), retry_for=mox.IgnoreArg()).AndRaise(
585 suite.schedule(recorder.record_entry, True)
586 suite.wait(recorder.record_entry)
594 tests = Suite.find_and_parse_tests(self.getter,
672 self.suite,
679 self.suite.schedule(self.recorder.record_entry, True)
680 self.suite._jobs_to_tests[self._FAKE_JOB_ID] = self.files['seven']
681 self.suite.wait(self.recorder.record_entry)
686 Make sure the suite survives even if we cannot file bugs.
690 self.suite,
701 self.suite.schedule(self.recorder.record_entry, True)
702 self.suite._jobs_to_tests[self._FAKE_JOB_ID] = self.files['seven']
703 self.suite.wait(self.recorder.record_entry)
715 self.suite,
718 self.mox.StubOutWithMock(self.suite, '_create_job')
719 self.suite._create_job(
723 self.suite.schedule(self.recorder.record_entry, True)
724 self.suite._retry_handler._retry_map = {
728 self.suite._jobs_to_tests[self._FAKE_JOB_ID] = test_to_retry
729 self.suite.wait(self.recorder.record_entry)
737 self.assertEquals(self.suite._retry_handler._retry_map,
740 self.assertEquals(self.suite._jobs_to_tests[fake_new_job_id],
751 self.suite,
757 self.suite.schedule(self.recorder.record_entry, True)
758 self.suite._retry_handler._retry_map = {
762 self.suite._jobs_to_tests[self._FAKE_JOB_ID] = test_to_retry
763 expected_jobs_to_tests = self.suite._jobs_to_tests.copy()
764 expected_retry_map = self.suite._retry_handler._retry_map.copy()
765 self.suite.wait(self.recorder.record_entry)
767 self.assertEquals(self.suite._retry_handler._retry_map,
769 self.assertEquals(self.suite._jobs_to_tests, expected_jobs_to_tests)
773 """Make sure the suite survives even if the retry failed."""
779 self.suite,
782 self.mox.StubOutWithMock(self.suite, '_create_job')
783 self.suite._create_job(
787 self.mox.StubOutWithMock(self.suite, 'should_report')
788 self.suite.should_report(mox.IgnoreArg()).AndReturn(False)
792 self.suite.schedule(self.recorder.record_entry, True)
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)
803 expected_jobs_to_tests = self.suite._jobs_to_tests.copy()
804 self.assertEquals(self.suite._retry_handler._retry_map,
806 self.assertEquals(self.suite._jobs_to_tests, expected_jobs_to_tests)