def test_no_new_crashes(self):
        new_crash_source = ESNewCrashSource(self.config)
        self.health_check()

        generator = new_crash_source.new_crashes(
            utc_now() - datetime.timedelta(days=1),
            'Firefox',
            ['43.0.1']
        )
        assert list(generator) == []

        self.index_crash(
            a_processed_crash,
            raw_crash=a_raw_crash,
            crash_id=a_processed_crash['uuid']
        )
        self.refresh_index()

        # Same test now that there is a processed crash in there
        # but notably under a different name and version.
        generator = new_crash_source.new_crashes(
            utc_now() - datetime.timedelta(days=1),
            'Firefox',
            ['43.0.1']
        )
        assert list(generator) == []
Exemplo n.º 2
0
    def test_no_new_crashes(self):
        new_crash_source = ESNewCrashSource(self.config)
        self.health_check()

        generator = new_crash_source.new_crashes(
            utc_now() - datetime.timedelta(days=1),
            'Firefox',
            ['43.0.1']
        )
        eq_(list(generator), [])

        self.index_crash(
            a_processed_crash,
            raw_crash=a_raw_crash,
            crash_id=a_processed_crash['uuid']
        )
        self.refresh_index()

        # Same test now that there is a processed crash in there
        # but notably under a different name and version.
        generator = new_crash_source.new_crashes(
            utc_now() - datetime.timedelta(days=1),
            'Firefox',
            ['43.0.1']
        )
        eq_(list(generator), [])
Exemplo n.º 3
0
    def test_new_crashes(self):
        new_crash_source = ESNewCrashSource(self.config)
        self.index_crash(a_processed_crash,
                         raw_crash=a_raw_crash,
                         crash_id=a_processed_crash['uuid'])
        self.index_crash(a_firefox_processed_crash,
                         raw_crash=a_raw_crash,
                         crash_id=a_firefox_processed_crash['uuid'])
        other_firefox_processed_crash = deepcopy(a_firefox_processed_crash)
        other_firefox_processed_crash['uuid'] = (
            other_firefox_processed_crash['uuid'].replace('a', 'e'))
        other_firefox_processed_crash['date_processed'] = (
            utc_now() - datetime.timedelta(days=1))
        self.index_crash(other_firefox_processed_crash,
                         raw_crash=a_raw_crash,
                         crash_id=other_firefox_processed_crash['uuid'])
        self.refresh_index()

        assert self.connection.get(
            index=self.config.elasticsearch.elasticsearch_index,
            id=a_processed_crash['uuid'])
        assert self.connection.get(
            index=self.config.elasticsearch.elasticsearch_index,
            id=a_firefox_processed_crash['uuid'])

        # same test now that there is a processed crash in there
        generator = new_crash_source.new_crashes(
            utc_now() - datetime.timedelta(days=1), 'Firefox', ['43.0.1'])
        assert list(generator) == [a_firefox_processed_crash['uuid']]
    def test_new_crashes(self):
        new_crash_source = ESNewCrashSource(self.config)
        self.index_crash(
            a_processed_crash,
            raw_crash=a_raw_crash,
            crash_id=a_processed_crash['uuid']
        )
        self.index_crash(
            a_firefox_processed_crash,
            raw_crash=a_raw_crash,
            crash_id=a_firefox_processed_crash['uuid']
        )
        other_firefox_processed_crash = deepcopy(a_firefox_processed_crash)
        other_firefox_processed_crash['uuid'] = (
            other_firefox_processed_crash['uuid'].replace('a', 'e')
        )
        other_firefox_processed_crash['date_processed'] = (
            utc_now() - datetime.timedelta(days=1)
        )
        self.index_crash(
            other_firefox_processed_crash,
            raw_crash=a_raw_crash,
            crash_id=other_firefox_processed_crash['uuid']
        )
        self.refresh_index()

        assert self.connection.get(
            index=self.config.elasticsearch.elasticsearch_index,
            id=a_processed_crash['uuid']
        )
        assert self.connection.get(
            index=self.config.elasticsearch.elasticsearch_index,
            id=a_firefox_processed_crash['uuid']
        )

        # same test now that there is a processed crash in there
        generator = new_crash_source.new_crashes(
            utc_now() - datetime.timedelta(days=1),
            'Firefox',
            ['43.0.1']
        )
        assert list(generator) == [a_firefox_processed_crash['uuid']]