def test_failed_operation_runs_sets_pipeline_run_to_finished(self): operation_run = OperationRunFactory() assert operation_run.last_status == OperationStatuses.CREATED assert operation_run.statuses.count() == 1 pipeline_run = operation_run.pipeline_run assert pipeline_run.last_status == PipelineStatuses.CREATED assert pipeline_run.statuses.count() == 1 # Stopping the first operation does not stop the pipeline operation_run.on_scheduled() operation_run.on_run() operation_run.on_failure() pipeline_run.refresh_from_db() assert operation_run.last_status == OperationStatuses.FAILED assert operation_run.statuses.count() == 4 assert pipeline_run.last_status == PipelineStatuses.FINISHED assert pipeline_run.statuses.count() == 4
def test_failed_operation_runs_sets_pipeline_run_to_finished(self): operation_run = OperationRunFactory() assert operation_run.last_status == OperationStatuses.CREATED assert operation_run.statuses.count() == 1 pipeline_run = operation_run.pipeline_run assert pipeline_run.last_status == PipelineStatuses.CREATED assert pipeline_run.statuses.count() == 1 # Stopping the first operation does not stop the pipeline operation_run.on_scheduled() operation_run.on_run() operation_run.on_failure() pipeline_run.refresh_from_db() assert operation_run.last_status == OperationStatuses.FAILED assert operation_run.statuses.count() == 4 assert pipeline_run.last_status == PipelineStatuses.FINISHED assert pipeline_run.statuses.count() == 4
def test_failed_operation_runs_sets_pipeline_run_to_finished(self): operation_run = OperationRunFactory() start_operation_run(operation_run) operation_run.refresh_from_db() assert operation_run.last_status == OperationStatuses.CREATED pipeline_run = operation_run.pipeline_run assert pipeline_run.last_status == PipelineLifeCycle.CREATED assert pipeline_run.statuses.count() == 1 # Stopping the first operation does not stop the pipeline operation_run.set_status(OperationStatuses.SCHEDULED) operation_run.set_status(OperationStatuses.RUNNING) operation_run.on_failure() pipeline_run.refresh_from_db() operation_run.refresh_from_db() assert operation_run.last_status == OperationStatuses.FAILED assert pipeline_run.last_status == PipelineLifeCycle.DONE assert pipeline_run.statuses.count() == 4