diff --git a/internal/manager/api_impl/jobs_test.go b/internal/manager/api_impl/jobs_test.go index 377e09f2..a7b23e75 100644 --- a/internal/manager/api_impl/jobs_test.go +++ b/internal/manager/api_impl/jobs_test.go @@ -48,10 +48,13 @@ func TestTaskUpdate(t *testing.T) { // Construct the task that's supposed to be updated. taskID := "181eab68-1123-4790-93b1-94309a899411" + jobID := "e4719398-7cfa-4877-9bab-97c2d6c158b5" + mockJob := persistence.Job{UUID: jobID} mockTask := persistence.Task{ UUID: taskID, Worker: &worker, WorkerID: &worker.ID, + Job: &mockJob, } // Expect the task to be fetched. @@ -64,6 +67,8 @@ func TestTaskUpdate(t *testing.T) { savedTask = *task return nil }) + // Expect the log to be written. + mf.logStorage.EXPECT().Write(gomock.Any(), jobID, taskID, "line1\nline2\n") // Do the call. echoCtx := mf.prepareMockedJSONRequest(&worker, taskUpdate) diff --git a/internal/manager/api_impl/test_support.go b/internal/manager/api_impl/test_support.go index 571c335d..d36793f3 100644 --- a/internal/manager/api_impl/test_support.go +++ b/internal/manager/api_impl/test_support.go @@ -39,6 +39,7 @@ type mockedFlamenco struct { flamenco *Flamenco jobCompiler *mocks.MockJobCompiler persistence *mocks.MockPersistenceService + logStorage *mocks.MockLogStorage config *mocks.MockConfigService } @@ -53,6 +54,7 @@ func newMockedFlamenco(mockCtrl *gomock.Controller) mockedFlamenco { flamenco: f, jobCompiler: jc, persistence: ps, + logStorage: ls, config: cs, } }