weldr/store: keep the compose status up-to-date

This way it can be correctly exposed in the API. We listen on a channel
from the job-queue, where status updates are pushed when the worker is
running/finished (or, in the future, failed).

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-09-27 14:34:51 +02:00
parent cad89c6650
commit f880581a14
7 changed files with 36 additions and 21 deletions

View file

@ -112,13 +112,13 @@ func TestBasic(t *testing.T) {
}
for _, c := range cases {
api := weldr.New(repo, packages, nil, nil, nil, nil)
api := weldr.New(repo, packages, nil, nil, nil, nil, nil)
testRoute(t, api, "GET", c.Path, ``, c.ExpectedStatus, c.ExpectedJSON)
}
}
func TestBlueprints(t *testing.T) {
api := weldr.New(repo, packages, nil, nil, nil, nil)
api := weldr.New(repo, packages, nil, nil, nil, nil, nil)
testRoute(t, api, "POST", "/api/v0/blueprints/new",
`{"name":"test","description":"Test","packages":[{"name":"httpd","version":"2.4.*"}],"version":"0"}`,
@ -142,7 +142,7 @@ func TestBlueprints(t *testing.T) {
func TestCompose(t *testing.T) {
jobChannel := make(chan job.Job, 200)
api := weldr.New(repo, packages, nil, nil, nil, jobChannel)
api := weldr.New(repo, packages, nil, nil, nil, jobChannel, nil)
testRoute(t, api, "POST", "/api/v0/blueprints/new",
`{"name":"test","description":"Test","packages":[{"name":"httpd","version":"2.4.*"}],"version":"0"}`,