Fix Processed images count regression for multiple languages

Fixes #11002
This commit is contained in:
Bjørn Erik Pedersen
2023-05-28 11:35:00 +02:00
parent 43f1282e73
commit fd099331ec
8 changed files with 83 additions and 24 deletions

View File

@@ -370,12 +370,15 @@ var commonTestScriptsParam = testscript.Params{
}
func testSetupFunc() func(env *testscript.Env) error {
sourceDir, _ := os.Getwd()
return func(env *testscript.Env) error {
var keyVals []string
keyVals = append(keyVals, "HUGO_TESTRUN", "true")
hugoCachedDir := filepath.Join(env.WorkDir, "hugocache")
keyVals = append(keyVals, "HUGO_CACHEDIR", hugoCachedDir)
keyVals = append(keyVals, "SOURCE", sourceDir)
goVersion := runtime.Version()
// Strip all but the major and minor version.
goVersion = regexp.MustCompile(`^go(\d+\.\d+)`).FindStringSubmatch(goVersion)[1]