mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
feat: add scaletest Runner for dynamicparameters load gen (#19890)
relates to https://github.com/coder/internal/issues/912 Adds a new scaletest Runner to generate dynamic parameters load. A later PR will add the CLI command, including creating the template & version.
This commit is contained in:
@@ -20,6 +20,9 @@ type DynamicParameterTemplateParams struct {
|
||||
Plan json.RawMessage
|
||||
ModulesArchive []byte
|
||||
|
||||
// ExtraFiles are additional files to include in the template, beyond the MainTF.
|
||||
ExtraFiles map[string][]byte
|
||||
|
||||
// Uses a zip archive instead of a tar
|
||||
Zip bool
|
||||
|
||||
@@ -36,9 +39,17 @@ type DynamicParameterTemplateParams struct {
|
||||
func DynamicParameterTemplate(t *testing.T, client *codersdk.Client, org uuid.UUID, args DynamicParameterTemplateParams) (codersdk.Template, codersdk.TemplateVersion) {
|
||||
t.Helper()
|
||||
|
||||
files := echo.WithExtraFiles(map[string][]byte{
|
||||
// Start with main.tf
|
||||
extraFiles := map[string][]byte{
|
||||
"main.tf": []byte(args.MainTF),
|
||||
})
|
||||
}
|
||||
|
||||
// Add any additional files
|
||||
for name, content := range args.ExtraFiles {
|
||||
extraFiles[name] = content
|
||||
}
|
||||
|
||||
files := echo.WithExtraFiles(extraFiles)
|
||||
files.ProvisionPlan = []*proto.Response{{
|
||||
Type: &proto.Response_Plan{
|
||||
Plan: &proto.PlanComplete{
|
||||
|
||||
Reference in New Issue
Block a user