Replace the old log setup, with structured logging etc.

Fixes #11124
This commit is contained in:
Bjørn Erik Pedersen
2023-06-16 08:17:42 +02:00
parent 0e79446586
commit 7c9fada778
80 changed files with 1273 additions and 1082 deletions

View File

@@ -16,11 +16,11 @@ package postcss_test
import (
"fmt"
"path/filepath"
"runtime"
"strings"
"testing"
jww "github.com/spf13/jwalterweatherman"
"github.com/bep/logg"
qt "github.com/frankban/quicktest"
"github.com/gohugoio/hugo/htesting"
"github.com/gohugoio/hugo/hugofs"
@@ -124,7 +124,7 @@ func TestTransformPostCSS(t *testing.T) {
T: c,
NeedsOsFS: true,
NeedsNpmInstall: true,
LogLevel: jww.LevelInfo,
LogLevel: logg.LevelInfo,
WorkingDir: tempDir,
TxtarString: files,
}).Build()
@@ -148,6 +148,11 @@ func TestTransformPostCSSError(t *testing.T) {
t.Skip("Skip long running test when running locally")
}
if runtime.GOOS == "windows" {
//TODO(bep) This has started to fail on Windows with Go 1.19 on GitHub Actions for some mysterious reason.
t.Skip("Skip on Windows")
}
c := qt.New(t)
s, err := hugolib.NewIntegrationTestBuilder(
@@ -176,7 +181,7 @@ func TestTransformPostCSSImportError(t *testing.T) {
T: c,
NeedsOsFS: true,
NeedsNpmInstall: true,
LogLevel: jww.LevelInfo,
LogLevel: logg.LevelInfo,
TxtarString: strings.ReplaceAll(postCSSIntegrationTestFiles, `@import "components/all.css";`, `@import "components/doesnotexist.css";`),
}).BuildE()
@@ -201,7 +206,7 @@ func TestTransformPostCSSImporSkipInlineImportsNotFound(t *testing.T) {
T: c,
NeedsOsFS: true,
NeedsNpmInstall: true,
LogLevel: jww.LevelInfo,
LogLevel: logg.LevelInfo,
TxtarString: files,
}).Build()
@@ -233,7 +238,7 @@ func TestTransformPostCSSResourceCacheWithPathInBaseURL(t *testing.T) {
T: c,
NeedsOsFS: true,
NeedsNpmInstall: true,
LogLevel: jww.LevelInfo,
LogLevel: logg.LevelInfo,
TxtarString: files,
WorkingDir: tempDir,
}).Build()