Here, add a new test helper called rivertest.WorkContext. Its purpose
is to generate a realistic looking context for testing JobArgs.Work
implementation, particularly by adding a client to context that makes
river.ClientFromContext available in tests, but may also be used to
add any other context-related features that may be added in the future.
We've talked about new test helpers for running Work implementations
and may still do that, but this is a primitive that makes testing a
little better without having to add anything heavyweight.
Here, add a new test helper called
rivertest.WorkContext
. Its purpose is to generate a realistic looking context for testingJobArgs.Work
implementation, particularly by adding a client to context that makesriver.ClientFromContext
available in tests, but may also be used to add any other context-related features that may be added in the future.We've talked about new test helpers for running
Work
implementations and may still do that, but this is a primitive that makes testing a little better without having to add anything heavyweight.Fixes #512.