writing RSpec tests for complex batches/callbacks #1529
Unanswered
anarchivist
asked this question in
Q&A
Replies: 1 comment
-
|
I simply execute the whole batch through GoodJob's inline adapter and then assert that all of the intended side effects have taken place. I'll also use Timecop and (I use Timecop instead of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i'm using GoodJob for a work project, and i wanted to know if there's any guidance about how to test complex batches with RSpec. i've already made some refactoring passes to keep the jobs themselves lean and call methods on models or service objects elsewhere in the codebase.
for reference, the job structure sort of looks like this. there's a mix of jobs - some "mice" which are fairly easy to fan out, and others that need to wait until one sets of those "mice" are done.
flowchart CreateBatchForDataloadJob -->|add| PrepareDatafileObjectJob_1 & PrepareDatafileObjectJob_2 & PrepareDatafileObjectJob_N PrepareDatafileObjectJob_1 -->|add| CopyDatafileToDataverseMountJob_1 PrepareDatafileObjectJob_2 -->|add| CopyDatafileToDataverseMountJob_2 PrepareDatafileObjectJob_N -->|add|CopyDatafileToDataverseMountJob_N CopyDatafileToDataverseMountJob_1 & CopyDatafileToDataverseMountJob_2 & CopyDatafileToDataverseMountJob_N -.- CreateDatafilesInDataverseCallbackJob CreateBatchForDataloadJob -->|enqueue; on_success| CreateDatafilesInDataverseCallbackJob -->|add| UpdateDataverseWithMetadataJob_1 & UpdateDataverseWithMetadataJob_2 & UpdateDataverseWithMetadataJob_N -.- CleanupCallbackJob CreateDatafilesInDataverseCallbackJob -->|enqueue; on_success/on_discard| CleanupCallbackJobBeta Was this translation helpful? Give feedback.
All reactions