Add chunk plan cache configuration and storage
This commit is contained in:
20
internal/framework/pipeline/chunk_cache_test.go
Normal file
20
internal/framework/pipeline/chunk_cache_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package pipeline
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestParseChunkCacheMode(t *testing.T) {
|
||||
for _, value := range []ChunkCacheMode{ChunkCacheAuto, ChunkCacheBypass, ChunkCacheRefresh} {
|
||||
got, err := ParseChunkCacheMode(string(value))
|
||||
if err != nil || got != value {
|
||||
t.Fatalf("ParseChunkCacheMode(%q) = %q, %v", value, got, err)
|
||||
}
|
||||
if err := value.Validate(); err != nil {
|
||||
t.Fatalf("%q.Validate() error = %v", value, err)
|
||||
}
|
||||
}
|
||||
for _, value := range []string{"", "enabled", "AUTO", "auto,refresh"} {
|
||||
if _, err := ParseChunkCacheMode(value); err == nil {
|
||||
t.Fatalf("ParseChunkCacheMode(%q) error = nil, want error", value)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user