Extend unit tests for objects using `state_machine` transitions
We use state_machine
heavily in CommitStatus
es and Pipeline
s. We also have some integration tests, that do check some behavior related to transitions, but we do not have unit tests explicitly dedicated to transitions.
This may cause some unexpected problems in the future, because there is no way to see that we do not test some transitions, like transition loop-backs.
Because of the lack of tests, we recently had some calls to return
in around_transition
where this is actually being executed within the context of Proc
instance in place that does not support returning from block, which yields LocalJumpError
.
That being said, we may benefit from tests that explicitly exercise transitions, not only because this will help to avoid problems, but also because we will be able to test some explicit concepts (like: transition from running to success triggers call to PipelineSuccessWorker
asynchronously).