Esempio n. 1
0
    def run_basic_healthchecks(self) -> None:
        """
        Runs basic healthchecks on the flows contained in this Storage class
        """
        if not hasattr(self, "_flows"):
            return

        _healthcheck.result_handler_check(self._flows.values())  # type: ignore
Esempio n. 2
0
    def test_raises_for_checkpointed_tasks(self, kwargs):
        @task(**kwargs)
        def up():
            pass

        f = Flow("foo-test", tasks=[up])

        with pytest.raises(ValueError, match="have a result handler."):
            healthchecks.result_handler_check([f])
Esempio n. 3
0
    def test_raises_for_tasks_with_upstream_dependencies_with_no_result_handlers(
            self, kwargs):
        @task
        def up():
            pass

        @task(**kwargs, result_handler=42)
        def down(x):
            pass

        with Flow("upstream-test") as f:
            result = down(x=up)

        with pytest.raises(
                ValueError,
                match="upstream dependencies do not have result handlers."):
            healthchecks.result_handler_check([f])
Esempio n. 4
0
    def test_doesnt_raise_for_checkpointed_tasks_if_flow_has_result_handler(
            self, kwargs):
        @task(**kwargs)
        def up():
            pass

        f = Flow("foo-test", tasks=[up], result_handler=42)
        assert healthchecks.result_handler_check([f]) is None
Esempio n. 5
0
    def test_no_raise_on_normal_flow(self):
        @task
        def up():
            pass

        @task
        def down(x):
            pass

        with Flow("THIS IS A TEST") as flow:
            result = down(x=up, upstream_tasks=[Task(), Task()])

        assert healthchecks.result_handler_check([flow]) is None
Esempio n. 6
0
    def test_doesnt_raise_for_tasks_with_non_keyed_edges(self, kwargs):
        @task
        def up():
            pass

        @task(**kwargs, result_handler=42)
        def down():
            pass

        with Flow("non-keyed-test") as f:
            result = down(upstream_tasks=[up])

        assert healthchecks.result_handler_check([f]) is None