Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimirtool config: Add duration list tests for YAML #1508

Merged
merged 2 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/mimirtool/config/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,15 @@ func TestConvert_Cortex(t *testing.T) {
outFlagsFile: "testdata/uncommon-flag-values.txt",
},
{
name: "duration list flags with single element",
name: "duration list flags",
inFlagsFile: "testdata/duration-slice-old.flags.txt",
outFlagsFile: "testdata/duration-slice-new.flags.txt",
},
{
name: "duration list YAML",
inFile: "testdata/duration-list-old.yaml",
outFile: "testdata/duration-list-new.yaml",
},
}

for _, tc := range testCases {
Expand Down
10 changes: 10 additions & 0 deletions pkg/mimirtool/config/testdata/duration-list-new.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blocks_storage:
tsdb:
block_ranges_period:
- 3h0m0s

compactor:
block_ranges:
- 3h0m0s
- 13h0m0s
- 25h0m0s
10 changes: 10 additions & 0 deletions pkg/mimirtool/config/testdata/duration-list-old.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
blocks_storage:
tsdb:
block_ranges_period:
- 3h

compactor:
block_ranges:
- 3h
- 13h
- 25h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-blocks-storage.tsdb.block-ranges-period=2h0m0s
-compactor.block-ranges=2h0m0s,12h0m0s,24h0m0s
-compactor.block-ranges=2h0m0s,12h0m0s,25h0m0s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-blocks-storage.tsdb.block-ranges-period=2h
-compactor.block-ranges=2h,12h,24h
-compactor.block-ranges=2h,12h,25h