Closed viniciussbs closed 2 months ago
I've only suggested this because it wouldn't add new code to be maintained. It would just expose something that already exists.
It's a good suggestion, and something I'm sure many people could have used in the past.
Done. This will be available in Oban v2.19
Thank you so much!
Thanks for this issue and the PR! We also need this change to test job broadcasting, having access to the job ID in tests is required.
Is your feature request related to a problem? Please describe.
I have some jobs that have their IDs stored somewhere when they're performed - for specific business rules. I would like to test this behaviour using existing test helpers, but
perform_job/3
only returns the result, not the job itself.Describe the Solution You'd Like
perform_job/3
the code that builds the job to a new function calledbuild_job/3
perform_job/1
that would receive a job as argument and just execute itperform_job/3
justworker |> build_job(args, opts) |> perform_job()
Describe Alternatives You've Considered
perform_job/3
return both the job and the result, but this would be a breaking change that can be avoided.Additional Context
I know we have
with_testing_mode/2
, but I believe simple helpers are more straightforward.