chore(): increase test coverage and update dependencies
Some checks are pending
ci/woodpecker/pr/pr Pipeline is pending
Some checks are pending
ci/woodpecker/pr/pr Pipeline is pending
This commit is contained in:
40
internal/logging/logging_test.go
Normal file
40
internal/logging/logging_test.go
Normal 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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user