Beispiel #1
0
    def test_do_not_return_tests_that_have_failed_recently(self):
        """Test that tests that have failed recently are not returned."""
        passing_experimental._MIN_DAYS_SINCE_FAILURE = 10
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))

        pass_times = {'test': self._datetime(2013, 3, 12)}
        fail_times = {'test': self._datetime(2013, 3, 13)}
        valid_tests = {'test'}

        self.mox.ReplayAll()
        results = passing_experimental.find_long_passing_tests(
            pass_times, fail_times, valid_tests)

        self.assertEqual(results, set([]))
Beispiel #2
0
    def test_return_tests_that_have_recent_pass_but_not_recent_failure(self):
        """Test returning tests that have recently passed but not failed."""
        passing_experimental._MIN_DAYS_SINCE_FAILURE = 10
        passing_experimental._MAX_DAYS_SINCE_LAST_PASS = 10
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))

        pass_times = {'test': self._datetime(2013, 3, 12)}
        fail_times = {'test': self._datetime(2013, 3, 1)}
        valid_tests = {'test'}

        self.mox.ReplayAll()
        results = passing_experimental.find_long_passing_tests(
            pass_times, fail_times, valid_tests)

        self.assertEqual(results, set(['test']))
Beispiel #3
0
    def test_handle_tests_that_have_never_passed(self):
        """Test that we can handle tests that have never passed."""
        passing_experimental._MIN_DAYS_SINCE_FAILURE = 10
        passing_experimental._MAX_DAYS_SINCE_LAST_PASS = 10
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))

        pass_times = {}
        fail_times = {'test': self._datetime(2013, 3, 11)}
        valid_tests = {'test'}

        self.mox.ReplayAll()
        results = passing_experimental.find_long_passing_tests(
            pass_times, fail_times, valid_tests)

        self.assertEqual(results, set([]))
Beispiel #4
0
    def test_filter_out_tests_that_are_not_valid(self):
        """Test that tests that are not valid are not returned."""
        passing_experimental._MIN_DAYS_SINCE_FAILURE = 10
        passing_experimental._MAX_DAYS_SINCE_LAST_PASS = 10
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))
        datetime.datetime.today().AndReturn(self._datetime(2013, 3, 20))

        pass_times = {'test2': self._datetime(2013, 3, 1)}
        fail_times = {'test2': self._datetime(2013, 3, 1)}
        valid_tests = {'test'}

        self.mox.ReplayAll()
        results = passing_experimental.find_long_passing_tests(
            pass_times, fail_times, valid_tests)

        self.assertEqual(results, set([]))