Merge the worker_status table with the worker table (#2111)

This commit is contained in:
Todd authored and GitHub committed 2022-06-01 13:25:29 -07:00
1 parent 46e97a2b91
commit 731a45eba6
27 files changed
+1169 -764

No files matched your search

+5 -7
View File
@@ -3,6 +3,7 @@ package servers
import (
"context"
"math/rand"
"strings"
"testing"
"time"
@@ -89,16 +90,13 @@ func TestWorker(t *testing.T, conn *db.DB, wrapper wrapping.Wrapper) *Worker {
id, err := newWorkerId(context.Background())
require.NoError(t, err)
name := "test-worker-" + id
wStatus := NewWorkerStatus(id,
name := "test-worker-" + strings.ToLower(id)
wrk := NewWorkerForStatus(scope.Global.String(),
WithName(name),
WithAddress("127.0.0.1"))
_, _, err = serversRepo.UpsertWorkerStatus(context.Background(), wStatus)
wrk, err = serversRepo.UpsertWorkerStatus(context.Background(), wrk)
require.NoError(t, err)
wrk := NewWorker(scope.Global.String(), WithPublicId(id))
require.NoError(t, rw.LookupById(context.Background(), wrk))
wrk.ReportedStatus = wStatus
require.NotNil(t, wrk)
return wrk
}