worker/server: job status struct

The number of return values from the `jobStatus`
function was growing and getting out of hand. Not
all return values were being used in all cases
and so returning a single struct with the information
and status of a job makes more sense. Then in each case
the resulting fields can be used as needed.
This commit is contained in:
Gianluca Zuccarelli 2022-07-22 13:18:47 +01:00 committed by Tomáš Hozza
parent 9f4e765657
commit 967ac1c35e
7 changed files with 128 additions and 115 deletions

View file

@ -458,9 +458,9 @@ func TestKojiCompose(t *testing.T) {
// Finishing of the goroutine handling the manifest job is not deterministic and as a result, we may get
// the second osbuild job first.
// The build jobs ID is determined from the dependencies of the koji-finalize job dependencies.
_, finalizeJobDeps, err := workerServer.KojiFinalizeJobStatus(composeId, &worker.KojiFinalizeJobResult{})
finalizeInfo, err := workerServer.KojiFinalizeJobStatus(composeId, &worker.KojiFinalizeJobResult{})
require.NoError(t, err)
buildJobIDs := finalizeJobDeps[1:]
buildJobIDs := finalizeInfo.Deps[1:]
require.Len(t, buildJobIDs, 2)
// handle build jobs