chore: add echo helper to create an agent with token (#6576)

This should reduce some LOC and duplication in tests!
This commit is contained in:
Kyle Carberry
2023-03-21 18:03:38 +00:00
committed by GitHub
parent d05b48267a
commit aaa3b31a0b
11 changed files with 84 additions and 363 deletions
+1 -17
View File
@@ -123,23 +123,7 @@ func TestProvisionerDaemonServe(t *testing.T) {
},
},
}},
ProvisionApply: []*proto.Provision_Response{{
Type: &proto.Provision_Response_Complete{
Complete: &proto.Provision_Complete{
Resources: []*proto.Resource{{
Name: "example",
Type: "aws_instance",
Agents: []*proto.Agent{{
Id: uuid.NewString(),
Name: "example",
Auth: &proto.Agent_Token{
Token: authToken,
},
}},
}},
},
},
}},
ProvisionApply: echo.ProvisionApplyWithAgent(authToken),
})
require.NoError(t, err)
file, err := client.Upload(context.Background(), codersdk.ContentTypeTar, bytes.NewReader(data))