Skip to content

Commit 4f9434e

Browse files
committed
add test
1 parent 856a732 commit 4f9434e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

log_config_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type ConfigTestSuite struct {
1919
endpoint string
2020
projectName string
2121
logstoreName string
22+
compressType string
2223
accessKeyID string
2324
accessKeySecret string
2425
client Client
@@ -49,6 +50,7 @@ func (s *ConfigTestSuite) SetupSuite() {
4950
s.endpoint = os.Getenv("LOG_TEST_ENDPOINT")
5051
s.projectName = fmt.Sprintf("test-go-log-config-%d", time.Now().Unix())
5152
s.logstoreName = fmt.Sprintf("logstore-%d", time.Now().Unix())
53+
s.compressType = "lz4"
5254
s.accessKeyID = os.Getenv("LOG_TEST_ACCESS_KEY_ID")
5355
s.accessKeySecret = os.Getenv("LOG_TEST_ACCESS_KEY_SECRET")
5456
s.client.AccessKeyID = s.accessKeyID
@@ -107,6 +109,7 @@ func (s *ConfigTestSuite) TestNormalFileConfig() {
107109
OutputDetail: OutputDetail{
108110
ProjectName: s.projectName,
109111
LogStoreName: s.logstoreName,
112+
CompressType: s.compressType,
110113
},
111114
}
112115
regexConfig.Key = []string{"content"}
@@ -129,6 +132,7 @@ func (s *ConfigTestSuite) TestNormalFileConfig() {
129132
s.Equal(destConfig.InputType, InputTypeFile)
130133
s.Equal(destConfig.OutputDetail.ProjectName, s.projectName)
131134
s.Equal(destConfig.OutputDetail.LogStoreName, s.logstoreName)
135+
s.Equal(destConfig.OutputDetail.CompressType, s.compressType)
132136
s.Equal(destConfig.OutputType, OutputTypeLogService)
133137
regexConfigDest, ok := ConvertToRegexConfigInputDetail(destConfig.InputDetail)
134138
s.True(ok)

0 commit comments

Comments
 (0)