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:
Spike Curtis
2025-09-25 16:18:37 +04:00
committed by GitHub
parent 5317d309d0
commit 289f0217c7
10 changed files with 458 additions and 2 deletions
+13 -2
View File
@@ -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{