示例#1
0
    def test_succeeded_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_success()
        pipeline_run.refresh_from_db()
        assert operation_run.last_status == OperationStatuses.SUCCEEDED
        assert operation_run.statuses.count() == 4
        assert pipeline_run.last_status == PipelineStatuses.FINISHED
        assert pipeline_run.statuses.count() == 4
示例#2
0
    def test_succeeded_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_success()
        pipeline_run.refresh_from_db()
        assert operation_run.last_status == OperationStatuses.SUCCEEDED
        assert operation_run.statuses.count() == 4
        assert pipeline_run.last_status == PipelineStatuses.FINISHED
        assert pipeline_run.statuses.count() == 4
示例#3
0
    def test_succeeded_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_success()
        operation_run.refresh_from_db()
        pipeline_run.refresh_from_db()
        assert operation_run.last_status == OperationStatuses.SUCCEEDED
        assert pipeline_run.last_status == PipelineLifeCycle.DONE
        assert pipeline_run.statuses.count() == 4