chore: remove dbfake.WorkspaceWithAgent (#10879)

Replace dbfake.WorkspaceWithAgent() with the builder pattern and remove this function.
This commit is contained in:
Spike Curtis
2023-11-27 14:30:15 +04:00
committed by GitHub
parent 82d5130b07
commit 78283a7fb9
9 changed files with 127 additions and 125 deletions
-13
View File
@@ -96,19 +96,6 @@ func Workspace(t testing.TB, db database.Store, seed database.Workspace) databas
return r.Workspace
}
// WorkspaceWithAgent is a helper that generates a workspace with a single resource
// that has an agent attached to it. The agent token is returned.
func WorkspaceWithAgent(
t testing.TB, db database.Store, seed database.Workspace,
mutations ...func([]*sdkproto.Agent) []*sdkproto.Agent,
) (
database.Workspace, string,
) {
t.Helper()
r := NewWorkspaceBuilder(t, db).Seed(seed).WithAgent(mutations...).Do()
return r.Workspace, r.AgentToken
}
type WorkspaceBuildBuilder struct {
t testing.TB
db database.Store