Esempio n. 1
0
    def setup_method(self, test_method, dataset_name="events"):
        super().setup_method(test_method, dataset_name)
        from snuba.web.views import application

        assert application.testing is True
        application.config["PROPAGATE_EXCEPTIONS"] = False
        self.app = application.test_client()
Esempio n. 2
0
    def setup_method(self, test_method):
        super(TestState, self).setup_method(test_method)
        from snuba.web.views import application

        assert application.testing == True
        self.app = application.test_client()
        self.app.post = partial(self.app.post, headers={"referer": "test"})
Esempio n. 3
0
    def setup_method(self, test_method):
        super(TestReplacer, self).setup_method(test_method)

        from snuba.web.views import application

        assert application.testing is True

        self.app = application.test_client()
        self.app.post = partial(self.app.post, headers={"referer": "test"})
        self.replacer = replacer.ReplacerWorker(
            self.clickhouse, self.dataset, DummyMetricsBackend(strict=True))

        self.project_id = 1
Esempio n. 4
0
    def setup_method(self):
        from snuba.web.views import application

        assert application.testing is True

        self.app = application.test_client()
        self.app.post = partial(self.app.post, headers={"referer": "test"})
        self.storage = get_storage(StorageKey.EVENTS)

        self.replacer = replacer.ReplacerWorker(
            self.storage, DummyMetricsBackend(strict=True))

        self.project_id = 1
        self.event = get_raw_event()
Esempio n. 5
0
    def setup_method(self, test_method):
        super(TestReplacer, self).setup_method(test_method, "events_migration")

        from snuba.web.views import application

        assert application.testing is True

        self.app = application.test_client()
        self.app.post = partial(self.app.post, headers={"referer": "test"})

        self.replacer = replacer.ReplacerWorker(
            self.dataset.get_writable_storage(),
            DummyMetricsBackend(strict=True))

        self.project_id = 1
        self.event = get_raw_event()
Esempio n. 6
0
    def setup_method(self):
        from snuba.web.views import application

        assert application.testing is True

        self.app = application.test_client()
        self.app.post = partial(self.app.post, headers={"referer": "test"})

        self.storage = get_writable_storage(StorageKey.ERRORS)
        self.replacer = replacer.ReplacerWorker(
            self.storage, DummyMetricsBackend(strict=True))

        self.project_id = 1
        self.event = get_raw_event()
        settings.ERRORS_ROLLOUT_ALL = True
        settings.ERRORS_ROLLOUT_WRITABLE_STORAGE = True
Esempio n. 7
0
    def setup_method(self) -> None:
        from snuba.web.views import application

        assert application.testing is True

        self.app = application.test_client()
        self.storage = get_writable_storage(StorageKey.ERRORS)

        self.replacer = replacer.ReplacerWorker(
            self.storage,
            CONSUMER_GROUP,
            DummyMetricsBackend(strict=True),
        )

        self.project_id = 1
        self.event = get_raw_event()
Esempio n. 8
0
    def setup_method(self) -> None:
        from snuba.web.views import application

        assert application.testing is True

        self.app = application.test_client()

        self.storage = get_writable_storage(StorageKey.ERRORS)
        self.replacer = replacer.ReplacerWorker(
            self.storage,
            CONSUMER_GROUP,
            DummyMetricsBackend(strict=True),
        )

        # Total query time range is 24h before to 24h after now to account
        # for local machine time zones
        self.from_time = datetime.now().replace(
            minute=0, second=0, microsecond=0) - timedelta(days=1)

        self.to_time = self.from_time + timedelta(days=2)

        self.project_id = 1
        self.event = get_raw_event()
Esempio n. 9
0
    def setup_method(self, test_method):
        from snuba.web.views import application

        assert application.testing is True
        application.config["PROPAGATE_EXCEPTIONS"] = False
        self.app = application.test_client()