mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
refactor(agent): add agenttest.New helper function (#9812)
* Adds agenttest.New() helper function * Makes sure agent gets closed on test cleanup * Makes sure you don't forget to set session token * Sets the agent and client logger automatically
This commit is contained in:
@ -798,7 +798,7 @@ func AwaitWorkspaceBuildJob(t *testing.T, client *codersdk.Client, build uuid.UU
|
||||
// AwaitWorkspaceAgents waits for all resources with agents to be connected. If
|
||||
// specific agents are provided, it will wait for those agents to be connected
|
||||
// but will not fail if other agents are not connected.
|
||||
func AwaitWorkspaceAgents(t *testing.T, client *codersdk.Client, workspaceID uuid.UUID, agentNames ...string) []codersdk.WorkspaceResource {
|
||||
func AwaitWorkspaceAgents(t testing.TB, client *codersdk.Client, workspaceID uuid.UUID, agentNames ...string) []codersdk.WorkspaceResource {
|
||||
t.Helper()
|
||||
|
||||
agentNamesMap := make(map[string]struct{}, len(agentNames))
|
||||
|
Reference in New Issue
Block a user