mirror of https://github.com/databricks/cli.git
skip test on windows
This commit is contained in:
parent
00266cb8b3
commit
2b1c5cbe63
|
@ -24,6 +24,8 @@ type Resolver struct {
|
|||
// Directory path within a Git repository containing the template.
|
||||
TemplateDir string
|
||||
|
||||
// Git tag or branch to download the template from. Only one of these can be
|
||||
// specified.
|
||||
Tag string
|
||||
Branch string
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package template
|
|||
|
||||
import (
|
||||
"context"
|
||||
"runtime"
|
||||
"testing"
|
||||
|
||||
"github.com/databricks/cli/cmd/root"
|
||||
|
@ -15,24 +16,31 @@ import (
|
|||
|
||||
func TestDefaultWriterConfigure(t *testing.T) {
|
||||
// Test on local file system.
|
||||
w1 := &defaultWriter{}
|
||||
err := w1.Configure(context.Background(), "/foo/bar", "/out/abc")
|
||||
w := &defaultWriter{}
|
||||
err := w.Configure(context.Background(), "/foo/bar", "/out/abc")
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "/foo/bar", w1.configPath)
|
||||
assert.IsType(t, &filer.LocalClient{}, w1.outputFiler)
|
||||
assert.Equal(t, "/foo/bar", w.configPath)
|
||||
assert.IsType(t, &filer.LocalClient{}, w.outputFiler)
|
||||
}
|
||||
|
||||
func TestDefaultWriterConfigureOnDBR(t *testing.T) {
|
||||
// This test is not valid on windows because a DBR image is always based on
|
||||
// Linux.
|
||||
if runtime.GOOS == "windows" {
|
||||
t.Skip("Skipping test on Windows")
|
||||
}
|
||||
|
||||
// Test on DBR
|
||||
ctx := dbr.MockRuntime(context.Background(), true)
|
||||
ctx = root.SetWorkspaceClient(ctx, &databricks.WorkspaceClient{
|
||||
Config: &workspaceConfig.Config{Host: "https://myhost.com"},
|
||||
})
|
||||
w2 := &defaultWriter{}
|
||||
err = w2.Configure(ctx, "/foo/bar", "/Workspace/out/abc")
|
||||
w := &defaultWriter{}
|
||||
err := w.Configure(ctx, "/foo/bar", "/Workspace/out/abc")
|
||||
assert.NoError(t, err)
|
||||
|
||||
assert.Equal(t, "/foo/bar", w2.configPath)
|
||||
assert.IsType(t, &filer.WorkspaceFilesExtensionsClient{}, w2.outputFiler)
|
||||
assert.Equal(t, "/foo/bar", w.configPath)
|
||||
assert.IsType(t, &filer.WorkspaceFilesExtensionsClient{}, w.outputFiler)
|
||||
}
|
||||
|
||||
func TestMaterializeForNonTemplateDirectory(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue