Skip to content

Commit

Permalink
fix test case
Browse files Browse the repository at this point in the history
  • Loading branch information
cw-Guo committed Jun 14, 2024
1 parent 0fec663 commit d93b0bc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
31 changes: 30 additions & 1 deletion apis/fluentbit/v1alpha2/clusterinput_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,35 @@ func TestClusterInputList_Load_As_Yaml(t *testing.T) {
},
}

expectedYaml := `inputs:
- name: tail
alias: input0_alias
path: /logs/containers/apps0
exclude_path: /logs/containers/exclude_path
refresh_interval: 10
ignore_older: 5m
skip_long_lines: true
db: /fluent-bit/tail/pos.db
mem_buf_limit: 5MB
parser: docker
tag: logs.foo.bar
docker_mode: true
docker_mode_flush: 4
docker_mode_parser: docker-mode-parser
inotify_watcher: false
- name: dummy
alias: input2_alias
tag: logs.foo.bar
rate: 3
samples: 5
- name: prometheus_scrape
alias: input3_alias
tag: logs.foo.bar
host: https://example3.com
port: 433
scrape_interval: 10s
metrics_path: /metrics
`
inputs := ClusterInputList{
Items: []ClusterInput{*inputObj1, *inputObj2, *inputObj3},
}
Expand All @@ -325,7 +354,7 @@ func TestClusterInputList_Load_As_Yaml(t *testing.T) {
for i < 5 {
clusterInputs, err := inputs.LoadAsYaml(sl, 0)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(clusterInputs).To(Equal(inputExpectedYaml))
g.Expect(clusterInputs).To(Equal(expectedYaml))

i++
}
Expand Down
2 changes: 1 addition & 1 deletion apis/fluentbit/v1alpha2/clusteroutput_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ func TestClusterOutputList_Load_As_Yaml(t *testing.T) {
for i < 5 {
clusterInputs, err := outputs.LoadAsYaml(sl, 0)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(clusterInputs).To(Equal(outputExpected))
g.Expect(clusterInputs).To(Equal(outputExpectedYaml))

i++
}
Expand Down

0 comments on commit d93b0bc

Please sign in to comment.