From b1e078f177d6f05a70802e3c4734848257592f13 Mon Sep 17 00:00:00 2001 From: Konstantin Khlebnikov Date: Fri, 12 Apr 2024 09:24:41 +0200 Subject: [PATCH] Use info stderr logger in tests --- api/v1/test_helpers.go | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/api/v1/test_helpers.go b/api/v1/test_helpers.go index a9e4ef5e..9544e7a9 100644 --- a/api/v1/test_helpers.go +++ b/api/v1/test_helpers.go @@ -29,6 +29,18 @@ var ( masterVolumeSize, _ = resource.ParseQuantity("5Gi") ) +func createLoggersSpec() []TextLoggerSpec { + return []TextLoggerSpec{ + { + BaseLoggerSpec: BaseLoggerSpec{ + MinLogLevel: LogLevelInfo, + Name: "info-stderr", + }, + WriterType: LogWriterTypeStderr, + }, + } +} + func CreateMinimalYtsaurusResource(namespace string) *Ytsaurus { return &Ytsaurus{ ObjectMeta: metav1.ObjectMeta{ @@ -84,15 +96,7 @@ func CreateMinimalYtsaurusResource(namespace string) *Ytsaurus { MountPath: "/yt/master-data", }, }, - Loggers: []TextLoggerSpec{ - { - BaseLoggerSpec: BaseLoggerSpec{ - MinLogLevel: LogLevelDebug, - Name: "debug", - }, - WriterType: LogWriterTypeFile, - }, - }, + Loggers: createLoggersSpec(), }, }, HTTPProxies: []HTTPProxiesSpec{ @@ -246,15 +250,7 @@ func CreateExecNodeInstanceSpec() InstanceSpec { corev1.ResourceMemory: execNodeMemory, }, }, - Loggers: []TextLoggerSpec{ - { - BaseLoggerSpec: BaseLoggerSpec{ - MinLogLevel: LogLevelDebug, - Name: "debug", - }, - WriterType: LogWriterTypeFile, - }, - }, + Loggers: createLoggersSpec(), Locations: []LocationSpec{ { LocationType: "ChunkCache", @@ -315,14 +311,6 @@ func CreateDataNodeInstanceSpec(instanceCount int) InstanceSpec { func CreateTabletNodeSpec(instanceCount int) InstanceSpec { return InstanceSpec{ InstanceCount: int32(instanceCount), - Loggers: []TextLoggerSpec{ - { - BaseLoggerSpec: BaseLoggerSpec{ - MinLogLevel: LogLevelDebug, - Name: "debug", - }, - WriterType: LogWriterTypeFile, - }, - }, + Loggers: createLoggersSpec(), } }