def test_luigi_sanity_foo(self, simple_foo): try: shutil.rmtree("/tmp/bar") except FileNotFoundError: pass result = dbnd_luigi_build(tasks=[simple_foo]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_sanity_foo(self, simple_foo): try: shutil.rmtree("/tmp/bar") except FileNotFoundError: pass with dbnd_config({CoreConfig.tracker: ["file", "console"]}): result = dbnd_luigi_build(tasks=[simple_foo]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_sanity_complex_foo(self, complex_foo): with dbnd_config({CoreConfig.databand_url: "http://localhost:8080"}): try: shutil.rmtree("/tmp/bar") except FileNotFoundError: pass result = dbnd_luigi_build(tasks=[complex_foo]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_build_exception(self, top10_artists_run_error): with mock.patch("dbnd_luigi.luigi_tracking.handler") as handler: result = dbnd_luigi_build(tasks=[top10_artists_run_error]) assert handler.on_failure.call_count == 1 assert handler.on_success.call_count == 3 assert handler.on_dependency_discovered.call_count == 3 assert handler.on_run_start.call_count == 4 assert result.status == LuigiStatusCode.FAILED get_luigi_run_manager().stop_tracking()
def test_luigi_wrapper_task_run_fail(self, wrapper_task_run_fail): delete_task_output(wrapper_task_run_fail) with mock.patch("dbnd_luigi.luigi_tracking.handler") as handler: result = dbnd_luigi_build(tasks=[wrapper_task_run_fail]) assert handler.on_failure.call_count == 1 assert handler.on_success.call_count == 1 assert handler.on_dependency_discovered.call_count == 1 assert handler.on_run_start.call_count == 2 assert result.status == LuigiStatusCode.FAILED
def test_luigi_build_exception(self, top10_artists_run_error): with dbnd_config({CoreConfig.tracker: ["file", "console"]}): with mock.patch("dbnd_luigi.luigi_tracking.handler") as handler: result = dbnd_luigi_build(tasks=[top10_artists_run_error]) assert handler.on_failure.call_count == 1 assert handler.on_success.call_count == 3 assert handler.on_dependency_discovered.call_count == 3 assert handler.on_run_start.call_count == 4 assert result.status == LuigiStatusCode.FAILED
def test_luigi_orphan_task(self, streams): with dbnd_config({CoreConfig.tracker: ["file", "console"]}): result = dbnd_luigi_build(tasks=[streams]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_sanity_top_10_artists(self, top10_artists): with dbnd_config({CoreConfig.databand_url: "http://localhost:8080"}): with dbnd_config({CoreConfig.tracker: ["file", "console"]}): result = dbnd_luigi_build(tasks=[top10_artists]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_wrapper_task_sanity(self, wrapper_task): with dbnd_config({CoreConfig.tracker: ["file", "console"]}): result = dbnd_luigi_build(tasks=[wrapper_task]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_requires_exception(self, top10_artists_requires_error): logging.info("STARTING TO RUN test_luigi_requires_exception") result = dbnd_luigi_build(tasks=[top10_artists_requires_error]) assert result.status == LuigiStatusCode.SCHEDULING_FAILED
def test_luigi_sanity_complex_foo(self, complex_foo): with dbnd_config({CoreConfig.databand_url: "http://localhost:8080"}): result = dbnd_luigi_build(tasks=[complex_foo]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_sanity_foo(self, simple_foo): result = dbnd_luigi_build(tasks=[simple_foo]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_sanity_top_10_artists(self, top10_artists): result = dbnd_luigi_build(tasks=[top10_artists]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_wrapper_task_sanity(self, wrapper_task): result = dbnd_luigi_build(tasks=[wrapper_task]) assert result.status == LuigiStatusCode.SUCCESS
def test_luigi_output_exception(self, top10_artists_output_error): result = dbnd_luigi_build(tasks=[top10_artists_output_error]) assert result.status == LuigiStatusCode.SCHEDULING_FAILED
def test_luigi_output_exception(self, top10_artists_output_error): with dbnd_config({CoreConfig.tracker: ["file", "console"]}): with pytest.raises(LuigiTestException): result = dbnd_luigi_build(tasks=[top10_artists_output_error]) assert result.status == LuigiStatusCode.SCHEDULING_FAILED
def test_luigi_orphan_task(self, streams): result = dbnd_luigi_build(tasks=[streams]) assert result.status == LuigiStatusCode.SUCCESS