Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
yyuuttaaoo committed Apr 25, 2023
1 parent 856a732 commit 4f9434e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions log_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type ConfigTestSuite struct {
endpoint string
projectName string
logstoreName string
compressType string
accessKeyID string
accessKeySecret string
client Client
Expand Down Expand Up @@ -49,6 +50,7 @@ func (s *ConfigTestSuite) SetupSuite() {
s.endpoint = os.Getenv("LOG_TEST_ENDPOINT")
s.projectName = fmt.Sprintf("test-go-log-config-%d", time.Now().Unix())
s.logstoreName = fmt.Sprintf("logstore-%d", time.Now().Unix())
s.compressType = "lz4"
s.accessKeyID = os.Getenv("LOG_TEST_ACCESS_KEY_ID")
s.accessKeySecret = os.Getenv("LOG_TEST_ACCESS_KEY_SECRET")
s.client.AccessKeyID = s.accessKeyID
Expand Down Expand Up @@ -107,6 +109,7 @@ func (s *ConfigTestSuite) TestNormalFileConfig() {
OutputDetail: OutputDetail{
ProjectName: s.projectName,
LogStoreName: s.logstoreName,
CompressType: s.compressType,
},
}
regexConfig.Key = []string{"content"}
Expand All @@ -129,6 +132,7 @@ func (s *ConfigTestSuite) TestNormalFileConfig() {
s.Equal(destConfig.InputType, InputTypeFile)
s.Equal(destConfig.OutputDetail.ProjectName, s.projectName)
s.Equal(destConfig.OutputDetail.LogStoreName, s.logstoreName)
s.Equal(destConfig.OutputDetail.CompressType, s.compressType)
s.Equal(destConfig.OutputType, OutputTypeLogService)
regexConfigDest, ok := ConvertToRegexConfigInputDetail(destConfig.InputDetail)
s.True(ok)
Expand Down

0 comments on commit 4f9434e

Please sign in to comment.