From f162b5516d444c1d15cb5251ee9857ddafa3a7e2 Mon Sep 17 00:00:00 2001 From: Bastian de Byl Date: Tue, 19 Jul 2022 09:19:22 -0400 Subject: [PATCH] 206-doublestar-mount Simplified config_test and fixed duplicate constants --- internal/plugin/config_test.go | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/internal/plugin/config_test.go b/internal/plugin/config_test.go index aacd8092..d033206c 100644 --- a/internal/plugin/config_test.go +++ b/internal/plugin/config_test.go @@ -4,19 +4,11 @@ import ( "fmt" "os" "reflect" - "strings" "testing" - "time" - "github.com/meltwater/drone-cache/archive" "github.com/meltwater/drone-cache/test" ) -const ( - testRoot = "testdata" - defaultStorageOperationTimeout = 5 * time.Second -) - func TestHandleMount(t *testing.T) { test.Ok(t, os.Mkdir(testRoot, 0755)) t.Cleanup(func() { @@ -62,7 +54,7 @@ func TestHandleMount(t *testing.T) { } for _, tc := range cases { - c := defaultConfig() + c := Config{} c.Mount = tc.mounts tc.makeFiles() @@ -72,23 +64,3 @@ func TestHandleMount(t *testing.T) { "expected mount differs from handled mount result:\nexpected: %v\ngot:%v", tc.expectedMounts, c.Mount) } } - -// Config plugin configuration - -func defaultConfig() *Config { - return &Config{ - CompressionLevel: archive.DefaultCompressionLevel, - StorageOperationTimeout: defaultStorageOperationTimeout, - Override: true, - } -} - -func containsGlob(a []string) bool { - for _, v := range a { - if strings.Contains(v, "**") { - return true - } - } - - return false -}