Skip to content

Commit 4bc3093

Browse files
committed
change test names, add runtime go version in generated mod
1 parent 41190d9 commit 4bc3093

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

wasp/tmpl_generator.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
"os/exec"
99
"path/filepath"
10+
"runtime"
1011
"strings"
1112
"text/template"
1213

@@ -51,7 +52,7 @@ const (
5152
const (
5253
GoModTemplate = `module {{.ModuleName}}
5354
54-
go 1.25
55+
go {{.RuntimeVersion}}
5556
`
5657

5758
// TableTestTmpl is a load/chaos table test template
@@ -235,7 +236,8 @@ require.NoError(t, err)
235236

236237
// GoModParams params for generating go.mod file
237238
type GoModParams struct {
238-
ModuleName string
239+
ModuleName string
240+
RuntimeVersion string
239241
}
240242

241243
// TableTestParams params for generating a table test
@@ -480,7 +482,8 @@ func (g *LoadTestCodegen) Write() error {
480482
// GenerateGoMod generates a go.mod file
481483
func (g *LoadTestCodegen) GenerateGoMod() (string, error) {
482484
data := GoModParams{
483-
ModuleName: g.cfg.moduleName,
485+
ModuleName: g.cfg.moduleName,
486+
RuntimeVersion: strings.Replace(runtime.Version(), "go", "", -1),
484487
}
485488
return render(GoModTemplate, data)
486489
}
@@ -533,7 +536,7 @@ func (g *LoadTestCodegen) GenerateTestCases() ([]TestCaseParams, error) {
533536
return nil, err
534537
}
535538
testCases = append(testCases, TestCaseParams{
536-
Name: fmt.Sprintf("Fail pod %s", pod.Name),
539+
Name: fmt.Sprintf("Fail pod %s=%s", g.cfg.uniqPodLabelKey, pod.Labels[g.cfg.uniqPodLabelKey]),
537540
RunFunc: r,
538541
})
539542
}
@@ -551,7 +554,7 @@ func (g *LoadTestCodegen) GenerateTestCases() ([]TestCaseParams, error) {
551554
}
552555

553556
testCases = append(testCases, TestCaseParams{
554-
Name: fmt.Sprintf("Network delay for %s", pod.Name),
557+
Name: fmt.Sprintf("Delay network for pod %s=%s", g.cfg.uniqPodLabelKey, pod.Labels[g.cfg.uniqPodLabelKey]),
555558
RunFunc: r,
556559
})
557560
}

0 commit comments

Comments
 (0)