chore(): increase test coverage and update dependencies
Some checks are pending
ci/woodpecker/pr/pr Pipeline is pending

This commit is contained in:
2025-12-18 23:12:27 +01:00
parent e779c5a38b
commit 2d1aa62c61
15 changed files with 384 additions and 74 deletions

View File

@@ -0,0 +1,40 @@
package logging
import (
"testing"
"git.uploadfilter24.eu/covidnetes/woodpecker-autoscaler/internal/config"
log "github.com/sirupsen/logrus"
)
func TestLoggingDebug(t *testing.T) {
cfg := config.Config{LogLevel: "Debug"}
ConfigureLogger(&cfg)
if log.GetLevel() != log.DebugLevel {
t.Fatalf("expected DebugLevel, got %v", log.GetLevel())
}
}
func TestLoggingInfo(t *testing.T) {
cfg := config.Config{LogLevel: "Info"}
ConfigureLogger(&cfg)
if log.GetLevel() != log.InfoLevel {
t.Fatalf("expected InfoLevel, got %v", log.GetLevel())
}
}
func TestLoggingWarning(t *testing.T) {
cfg := config.Config{LogLevel: "Warn"}
ConfigureLogger(&cfg)
if log.GetLevel() != log.WarnLevel {
t.Fatalf("expected WarnLevel, got %v", log.GetLevel())
}
}
func TestLoggingError(t *testing.T) {
cfg := config.Config{LogLevel: "Error"}
ConfigureLogger(&cfg)
if log.GetLevel() != log.ErrorLevel {
t.Fatalf("expected ErrorLevel, got %v", log.GetLevel())
}
}